How to change the colour of skin in an image using Xcode? - ios

I am creating a new app in which either taking or selecting an existing photo of a person I want to have a control / action so that the skin colour can be changed. For example to show someone with pale skin what they would look like with a sun tan.
Any help would be great!

I am not sure what the requirement, but this is a link to the Apple docs that will help you get started. Check out the part where you can mask certain colors. So if you allowed the user to tap somewhere where skin is exposed, retain a reference to the color and then mask it is one way you could tackle this problem. Here is the apple doc: http://bit.ly/GzHtyH
Hope this helps
Tams

Related

How to get background and text color from an image like Apple Music does with album artwork?

I noticed that when you view an album on Apple Music the background color of the view controller changes and the text color seems to always be a color that pops from the background and is also somehow in the image.
Does anybody know how this is done or have any ideas about how to do something like this?
In fact you need to determine what are the main tints of your image.
You can do this by parsing the pixels of your image in order to get a weighted list of color buckets. Then you select two of them so they contrast each other.
You can find a lot of samples doing/teaching that on the internet.
And you can find sample codes doing a similar thing like this one:
https://github.com/timominous/TDImageColors
Edit: also look at the following answer: https://stackoverflow.com/a/13675803/5432134
Hope this helps ;)

bezier path select same color

In my application I have created 3D effect image for example suppose user have selected all the flower using bezier path than after clicking on done button all the image except flowers will become blur. I have done this successfully. Now I want to enhance this functionality. What I need is that when user select flower than only flower should be selectable not green color.
Thanks in advance
Edit:
Example of such application is https://itunes.apple.com/in/app/tadaa-hd-pro-camera/id410005685?mt=8 I just need some help to start this. in this application how they are selecting object?
Please suggest me some SDK or toll to start.
Thanks.

Project ideation using image processing

I am in my final year of BS Computer Science. I have chosen a project in the image processing domain. But I really don't know where to start from! Here is a rough draft of my project idea:
Project Description:
Often people are faced with the problem of deciding which colors to choose to paint their walls, doors and ceilings. They want to know how their rooms will look like after applying a certain color. We want to design a mobile application that can give people the opportunity to preview their rooms/walls/ceilings, etc, with a certain color before applying the color. Through our application the user can take photos of their rooms/walls/ceilings, etc, and change their colors virtually and preview them. This will give them a good estimate about the final look of their house.
Development will be in java using open CV libraries.
Can anyone provide some help?
For starting OpenCV with android you can follow the tutorial here.
And as your above description, I think you need to do the following...
Filter out the color of room's wall or ceiling color.
Replace with your preview color.
But as your room's color is not unique, you may need to mark the color manually and segment it. Here watershed algorithm might be helpful.
And one more thing is that there might be a chance of lighting variation, so you should use HSV color space instead of RGB.
And finally this is not the full solution, but you will get some idea about how to start with your project.
ImageMagick as a famous image processing library.You may look that one too.It can perform numerous operations with images
Thanks

Obtain iOS7-like blur effect with Qt

I was asking myself how I could obtain an iOS 7 like blur/transparency effect. Something like this:
(source: ilounge.com)
I'd like to apply this to a whole QDialog. I know how to obtain a nice transparency, but not how to get this blur.
Can someone help?
Thanks a lot!
Basically, you need to first get a screenshot of the desktop. Then you need to blur it. Then probably save the image to the harddrive. Then you need to set it as the background for your dialog.
And then you need to make the background for each button transparent, too.
If you use QGraphicsView or OpenGL, the last three steps may be very different.
http://qt-project.org/doc/qt-5.0/qtgui/qscreen.html#grabWindow
http://qt-project.org/doc/qt-5.0/qtwidgets/desktop-screenshot.html
Lines of code where it actually grabs the screen:
QScreen *screen = QGuiApplication::primaryScreen();
if (screen)
originalPixmap = screen->grabWindow(0);
In Qt 4.8, it used to be done this way:
http://qt-project.org/doc/qt-5.0/qtgui/qpixmap.html#grabWindow
To blur the screenshot, use this:
http://doc-snapshot.qt-project.org/4.8/qgraphicsblureffect.html
You may need to save it to the harddrive for QStylesheets to be able to find it.
To set the background image, try something like this:
http://qt-project.org/doc/qt-5.0/qtwidgets/stylesheet-reference.html#background-image-prop
Example of how to set a stylesheet:
qApp->setStyleSheet("QLineEdit { background-color: yellow }");
http://qt-project.org/doc/qt-4.8/stylesheet-examples.html
http://qt-project.org/forums/viewthread/1397
Hope that helps.
Thanks a lot for your help phyatt, I succeeded. Although my code works, the result is not as pretty as iOS':
iOS7-like blur with Qt
however, I'm going to post the whole code on my website, I'll post the link here in a while.
Stay tuned!
[EDIT] here's the link to the detailed how-to: iOS7 like blur effect with QT

Trying to change a person's skin colour

I am creating an app at the moment which take a picture of a person's face and I want to change the colour of their skin (just for fun!)
I have a piece of code that runs through the image pixel by pixel and finds the skin colour and then amends it to a new colour, which kind of works, but even though I am allowing for the differences in tones and adjusting the new colour in the same way it is still very hit and miss.
can anyone point me in the right direction?? is it even possible? I dont really want to use a filter as I dont think it would give the right effect.
Thanks
You should look at some computer vision techniques such as segmentation and feature extraction.

Resources