akluk – section A – project-02 – VariableFaces

sketch
It was a fun and exciting challenge to think about how a face could change and randomize.

var eyeSize = 20;
var faceWidth = 100;
var faceHeight = 150;
var mouthshape = 0;
var eye_diff = 0;
var pupilSize = 10;
var noseType = 1;
var noseHeight = 14;
var noseWidth = 10;
var skin_color = 255;
var selector = 0;

function setup() {
    createCanvas(300, 300);
}
 
function draw() {
    background(180);
    fill(skin_color);
    var pink = color(242,120,130);
    ellipse(width / 2, height / 2, faceWidth,  faceHeight);
    var eyeLX = (width / 2 - faceWidth * 0.3) + eye_diff;
    var eyeRX = width / 2 + faceWidth * 0.3 - eye_diff;
    var mouthHeight = (height/2) + faceHeight/4;

    //drawing eyes
    fill(255);
    ellipse(eyeLX, height * 0.45, eyeSize, eyeSize);
    ellipse(eyeRX, height * 0.45, eyeSize, eyeSize);

    //drawing pupils
    fill(0);
    ellipse(eyeLX, height * 0.45, pupilSize, pupilSize);
    ellipse(eyeRX, height * 0.45, pupilSize, pupilSize);

    //drawing mouth
    fill(pink);
    if (mouthshape == 0) {
    	ellipse(width/2, mouthHeight,faceWidth/3,faceHeight/4);
    }
    else if (mouthshape == 1) {
    	arc(width/2, mouthHeight, faceWidth/3, faceWidth/3, 0, PI,CHORD);
    }
    else if (mouthshape == 2) {
    	arc(width/2, mouthHeight + faceWidth/6, faceWidth/3, faceWidth/3, PI, 0,CHORD);
    } 
    else {
    	noFill();
    	arc(width/2, mouthHeight + faceWidth/10, faceWidth/10, faceWidth/10, 0.785, -HALF_PI);
    	arc(width/2, mouthHeight, faceWidth/10, faceWidth/10, 0.785, -HALF_PI);
    }

    //drawing nose 
    noFill();
    if (noseType == 0){
    	triangle(width/2,height/2,width/2-noseWidth,height/2+noseHeight,width/2+noseWidth,height/2+noseHeight)
    }
    else if (noseType == 1){
    	ellipse(width/2,height/2,noseWidth,noseHeight);
    }
    else{
    	line(width/2,height/2+noseHeight, width/2,height/2-noseHeight);
    	line(width/2,height/2+noseHeight,width/2+noseWidth,height/2+noseHeight);
    }

}
 
function mousePressed() {
    // when the user clicks, these variables are reassigned
    // to random values within specified ranges. For example,
    // 'faceWidth' gets a random value between 75 and 150.
    eye_type = random([0,1,2]);
    eye_diff = random(-15,15);
    faceWidth = random(180, 300);
    faceHeight = random(180, 300);
    eyeSize = random(30, 60);
    pupilSize = random(10,30);
    mouthshape = random([0,1,2,3]);
    noseType = random([0,1,2]);
    noseWidth = random(10,20);
    noseHeight = random(12,28);    //mouthshape = random(-1,2);
    selector = random([0,1,2,3,4]);
    if (selector == 0){
    	skin_color = color(255,205,148);
    }
    else if (selector == 1){
    	skin_color = color(86,46,25);
    }
    else if (selector == 2){
    	skin_color = color(255,255,255);
    }
    else if (selector == 3){
    	skin_color = color(255,227,159);
    }
    else {
    	skin_color = color(30,144,255);
    }


}

akluk – Section A – Looking outwards-02

The project that I decided to tackle is Weird Faces by Moka(or Matthias Dorfelt), from 2012-2013.

It is a project that is aimed towards creating a program/algorithm that generates various and unique faces. What I admire about this project is the ability that is make it so natural. I always expected a computer generated face to be very structured, exact, and calculated, kinda mechanic. However the creator was able to create an method to create very random and organic drawings. If I were simply shown the images, and not know it was a computer program, I would have thought an actual artist drew it.

The creator did not disclose what algorithm was used, but it was most likely a improved randomizer for the face shape, eyes, cheeks, mouth, nose and colors.

The creator’s artistic style seems to be quick similar. It usually uses very simple designs and looks quite abstract. It looks simply and random, however the general structure and object that the creator is still trying to describe is still evident and clear.

akluk – project 01 – face

sketch
It was a good and fun exercise to simply use basic shapes to build an interpretation of myself

function setup() {
    createCanvas(600,600);
    var backgrd = color(153,25,120)
    background(backgrd);
}

function draw() {
	var x_mid = 200;
	var y_mid = 200;
	var skin_c = color(255,201,167);
	var white = color(255,255,255);
	var black = color(0,0,0);
	var gold = color(212,175,55);
	var pink = color(242,120,130);
	var red = color(248,23,17);
	var maroon = color(181,3,0);
	stroke(0);
	strokeWeight(0);
	fill(black);
	rect(140,80,320,120,0,30,0,0);
	rect(140,30,120,50,50,0,0,0);
	triangle(260,30,260,90,455,90);
	strokeWeight(8);
	fill(red);
	rect(110,450,380,300,50,50,0,0);
	noStroke();
	fill(maroon);
	rect(300,453,187,300,0,50,0,0);
	stroke(0);
	//arc(300,235, 350,350, PI, 0, OPEN);
	fill(skin_c);
	ellipse(300,300,370,400);
	noFill();
	fill(white);
	ellipse(230,250,80,40);
	ellipse(370,250,80,40);
	noFill();
	ellipse(230,250,100,100);
	ellipse(370,250,100,100);
	fill(black);
	ellipse(210,255,10,10);
	ellipse(345,256,10,10);
	rect(280,250,40,3);
	noFill();
	arc(300,320, 40, 40, 0, PI+QUARTER_PI, OPEN);
	fill(pink);
	rect(230,370,140,90,0,0,40,80);
	fill(black);
	quad(180, 210, 185, 190, 250, 160, 258, 180);
	quad(350, 180, 358, 160, 420, 190, 425, 210);
	noStroke();
	triangle(250,100,350,100,300,140);
	rect(300,100,120,40);
	noFill();
	/*strokeWeight(12);
	rect(160,200,130,100, 0, 0, 18,18);
	rect(310,200,130,100, 0, 0, 18,18);
	stroke(gold);
	strokeWeight(10);
	arc(300,220,25,25,-2.4,-0.8);*/

}

akluk_LookingOutwards01

https://experiments.withgoogle.com/ai/quick-draw

Quick, draw! is a very simple game where the user simply draws or doodles on an empty canvas and the artificial intelligence/computer will attempt to guess and determine what the drawing is of, as the user doodles more the artificial intelligence gets better and more accurate with the guesses.

This application was developed by Jonas Jongejan, Henry Rowley, Takashi Kawashima, Jongmin Kim, Nick Fox-Gieg, and the a few other individuals in Google Creative Lab. The creators were first inspired during a hackathon where they wanted to a create a pictionary-esque game with artificial intelligence. It utilized technologies and algorithm that was developed by the Handwriting recognition engine developed for Google Translate (which also most likely what inspired it) as well as other machine learning concepts. The model was trained to become better and better at identifying doodles as more people provided more data and samples for it to analyze. It could be further developed into a picture keyboard.

I wish to do something with computer vision in the future so this is similar to what I strive to learn and understand in the future. It is also a very creative and fun way to apply machine learning and AI.