How to draw an image according to the pixels of another image? - iphone

HI all ,what i want is to map the images.Suppose i have two images of persons,one is of fat person and another is of weak person,Now i want to match their faces ,eyes.I want to increase or decrease the face size eye size of one image according to another.As you can see in adobe photoshop you can make the face fat,make it squueze.I want to do the image manuplation in this.These types of operations i want to implement.I don't know from where to start.
Pleas guide and help me.Can i perform all this with core graphics if so then how
Any reference,tutorial address ,sample code ........appreciated.

You are probably going to have to deal with some sort of edge detection and face recognition algorithms, at the very least, if this is to be accomplished automatically. Otherwise, if the user is going to be resizing one image to match the other, this will require simple resizing operations driven by perhaps user pinch & gestures.
UPDATE:
For manual resizing:
Download the source code for the great book Cool iPhone Projects. One of the projects is called 'Touching'. This project contains code that accomplishes what you need: pinch and zoom functionality.

Related

detect coordinates of some element on image

Please tell me how to solve this problem.
Where to start and which way to go.
I have an image with some buttons :
How can i detect coordinates of blue round button for example?
The difficulty lies in the fact that these are not application buttons, but just a picture on the desktop.
I understand that this is a vast and complex question, but tell me at least the right way.
It will be useful to many people.
The first thing I can imagine is to do a desktop screen, and then try to detect pixels with blue color.
You don't need to do manual image detection because Apple's vision framework already does this. You can use it to detect rectangular regions, detect text, or recognize and image within an image, depending on your needs.
See Detecting Objects in Still Images

Copy face from Image

I'm a noob to this forum, but wanted to give it a try.
I'm currently learning Objective-C and Cocoa; trying to build my first iPhone app.
One thing I'm working on is allowing the user to cut his/her face from an image they have taken and paste it into another image. (The idea is cut from one image and paste into another image with a spot for a face to go.)
How can this be done? I am thinking I would allow the user to just touch and drag over their face, in the shape of a rectangle, and then allow them to copy.
Thanks for the help.
Ok, nevertheless your bit arrogant style of asking, here are some guidelines about how to start: generic obj-c/iOS development (start from hello world); UIImage class; camera API; image processing algorithms, face detection algorithms. Go on gradually and do not wish to resolve all problems at once. Write first an application that simple loads an arbitrary photo and shows it to the user. Then modify it that you can crop a specified rectangular area from the image and save it into the new file. Then write an app that switches on the camera that you can take an image and save it to the disk. Then unite what you wrote that you save only a cropped area of the captured image.
When you arrive to this point, you will know much more about software development image handling. AFTER THIS you can start looking for image processing algorithms. Start also here with something simple like a trivial blur filter or similar implemented by you. If you know already a bit of image processing, search for face detection algorithms on the net. It is even possible that you will find some ready framework that includes also these features, or at least you will understand the concepts. You can even come back here to stack overflow and ask for suggestions about a good face detection algorithms, however we still prefer if you have chosen already one and have some concrete issue with it.

iOS: Decompose UIImageView image into shapes and change their colors

I have been making an iPhone App where I need to identify and decompose different shapes(e.g Wall, Chair, Book, etc..) in UIImageView's image and change their color. So far I have implemented code to allow user to select color and apply it to selected area (pixel base) using gesture recogniser but what I am looking for is far more than what I have done!
Is it posible to detect the different shapes available in given image and change their color?
Thanks.
whatever algorithm you use, you should place it on top of one of the best frameworks for computer Vision, open CV for iOS
then you might check other projects in other languages that do this image segmentation using open cv, and with the theory may be roll your own solution ;)
good luck
Object recognition and detection is a very wide topic in computer science and, as far as I know, is not supported by UIImage's public methods. I think you have a long way to go in order to achieve your goal. Try and look up any open source iOS projects that handle object detection or maybe even look into non-native libraries that have iOS wrappers, such as openCV. Good luck, don't give up.

Zooming a hotspot when it clicked

I have to make some hot spots on my image , so that when i click anyone of them they zoom.
For example consider the image
When i click that butterfly then it zoom
Please provide a good solution
Following are my thinking
Use a button and click it and add a subImageView and zoom it.
Zoom a particular region of this image when touch at that place.
Both ideas have their limitations.In first i have to create a saperate image and also my app size will become very large.
and limitation of second is that it will not zoom exact required image.
I was also thinking of masking but i think that is also not very good way, because this is just a sample, i have many images like this and can be many hot spots on a single image.
please guide.
If you are dealing we rather large images you should check out CATiledLayer, which are very fast and efficient to use.
Check out this blog post, including the demo app:
http://www.cimgf.com/2011/03/01/subduing-catiledlayer/

Detecting particular objects in the image i.e image segmentation with opencv

I have to select any particular object visible in my image on i-phone.
Basically my project is to segment image objects on the basis of my touch.
The method I am following is to first detect contours of the image and then select a particular sequence based on finger touch.
Is there any other method which would be more robust because I have to run it on video frames?
I am using OpenCV and iphone for the project.
PLease help if there is any other idea which has been implemented or is feasible to implement.
Have you looked at SIFT or SURF implementations? They both track object features and are resilient (to a certain degree) to rotation, translation and scale.
Also check out FAST which is a corner detection algorithm which might help you, they have an app on the app store showing how quick it is too.