1

I want to find out if there's a way to implement the certain algorithm for my iPhone and iPad app:

  • The user shoots a photo using the camera interface inside my app
  • The photo is then compared with one of the photos I have inside an app
  • And the photo that looks most alike is displayed

How do you do that? Any ideas? Thanks in advance!

Sergey Grischyov
  • 11,995
  • 20
  • 81
  • 120

3 Answers3

3

I haven't implemented anything yet, but from what i know edge detection will be neccessary in some step of your solution. There is an open source library providing edge detection:

Without having taken a closer look at it, I think this library might come handy for other tasks in your desired algorithm as well.

Toubey
  • 199
  • 3
  • 14
3

Take a look at AVFoundation and AVCam in Apple library .AVCam sample code demonstrates how to use the AV Foundation capture APIs for recording movies and taking still images.

and this tutorial tells how to use Open CV to compare images and here is a key method you should get start with

- (int)difference((int)topPixel,(int)bottomPixel)
{
    return abs(topPixel-bottomPixel);
}

and the last part about displaying the result, i hope it must be quite easy for you..

iMeMyself
  • 1,649
  • 13
  • 28
  • Question is for comparing photos. now how to take photos or recording movies. – Janak Nirmal Sep 27 '12 at 12:01
  • @Jennis yeah i understand , and i have done edit with an example method .. FYI im working on similar project and have used these methods to accomplish image comparison.. – iMeMyself Sep 27 '12 at 12:28
  • @Jennis if this question is just about comparison of images then its possible duplicate of http://stackoverflow.com/questions/9049535/ios-image-comparison and http://stackoverflow.com/questions/10055739/ios-comparing-the-two-images but i thought user also needs to know the way to capture and store image along with comparing – iMeMyself Sep 27 '12 at 12:39
1

Have a look to this similar question: Algorithm for finding similar images

The most reliable and general approach is to use wavelet transforms (multi-scale analysis).

Community
  • 1
  • 1
Bruno von Paris
  • 882
  • 1
  • 7
  • 26