Best approach to create an image morphing app?

Go To StackoverFlow.com

-1

I also want to change user's skin color to blue like the avatar face which i don't know how to do? I have tried various methods to achieve skin color change but was not able to do it .i tried to find the skin color pixels and then replace them with blue color but then whole skin goes complete blue. I want so that skin turns blue but it looks real like all shadows of chin , nose etc. so that blue color may go dark or lighter depending upon face..

I have used the:

for (int i = 0; i < bytesInContext; i += 4) {



            int alpha =  data[i]; 
            int red = data[i+1]; 
            int green = data[i+2]; 
            int blue = data[i+3];



        if(((red>140)&&(red<190))||(green>120)&&(green<190)||(blue>150)&&(blue<150)){



                data[i]=255; 
                data[i+1]=13; 
                data[i+2]=43; 
                data[i+3]=63;


            }

Please can anyone tell me is there other ways to create such app and how to change the user's skin to blue color ??

2012-04-03 22:05
by Pankaj Kainthla


2

This is actually not one question, but multiple questions in one.

To change the skin color to blue, you can use a library such as OpenCV. Convert the image to the HSV color space, and increment the values in the H (hue) channel with 80 or so, and you might get the desired result.

To make the avatar, you could use the Viola-Jones face detection algorithm (also present in OpenCV) to extract only the face from the user's picture, and then add the images of your choice around and on top of it. I wouldn't be surprised if it looked properly horrible though.

Good luck.

2012-04-04 14:54
by dvhamme