Isolating a face
Posted: 2015-01-25T07:46:10-07:00
I have been working with some javascript face detection software and it works quite well but not 100%. So I have been thinking about changing to a method where the user clicks the top left of a face and bottom right and Imagemagick creates a box between those two points.
That got me thinking about the user clicking on a face and Imagemagick draws a box; but the problem with that is how big to draw the box? So taking this a step further if the user clicks on part of the face could imagemagick find the limits of that area/colour and I could build a box around those dimensions. I suppose I could use that as a mask and fill everything outside the mask say red and then trim but I am sure there must be a better way?
A sample face:

I should say I am looking to do two things:
1/ Highlight the face in the original image with a red border around it.
2/ Crop the face and double the size
That got me thinking about the user clicking on a face and Imagemagick draws a box; but the problem with that is how big to draw the box? So taking this a step further if the user clicks on part of the face could imagemagick find the limits of that area/colour and I could build a box around those dimensions. I suppose I could use that as a mask and fill everything outside the mask say red and then trim but I am sure there must be a better way?
A sample face:

I should say I am looking to do two things:
1/ Highlight the face in the original image with a red border around it.
2/ Crop the face and double the size