Hi Chris,

Chris Cinelli wrote:
> Hi,
> 
> I am trying to find an automated effective way to:
> 
> 1) detect the face edges and minimize the details in the face (like nose
> etc) in a portrait image.  
> The images are taken on white background but it may be a little gray and
> have shadows. The ideal result would be an image that has in black thick
> borders of the edges of the faces, the hair, eyebrows and a minimal details
> of nose and mouth. Everything on a white background. Anybody can help with
> that ?
> 
> 2) remove the background and make that part of the image transparent. Again
> it is still a portrait with a white-ish background.


regarding the background part, I tried this successfully myself,
albeit with a strictly white background. In your case, I would
copy the image and paint over the face in a bitmap editor like
Gimp etc. in order to remove the face completely and have just
the background on a separate image. You can then proceed as
follows (this is a shell script for Linux, but you can modify
this easily for any other OS):

----
#!/bin/sh

convert image_with_face.extension -fuzz 25% -background.extension \
-compose change-mask -composite final_image.extension

display final_image.extension
----

The last line is optional, of course. You may have
to try out different valuers for '-fuzz'.

Here's an example from my blog (the text is in
German, but I guess the image speaks for itself):

http://grafomatic01.twoday.net/stories/4839779/

I found this to work really smoothly, and as you can
see, the final image doesn't contain any color "spill"
at the edges of the object.

HTH,

Claus

-- 
Claus Cyrny : Webdesign |  Grafik | Fotografie
:: Web: http://home.arcor.de/ccyrny/ ::.
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to