24

I need to make an iOS app with these features:

  • Use the camera capture a image.
  • Recognize that image: Does it match with a sample image or not?

Is there any online API to do that (from Google, Yahoo, ...)? For example, can I upload an image and I get an image URL and after that request a url to compare a new image with an exist one?

Undo
  • 25,519
  • 37
  • 106
  • 129
Kevin Duong
  • 658
  • 1
  • 8
  • 20
  • possible duplicate of [Very simple image recognition on iOS](http://stackoverflow.com/questions/4695268/very-simple-image-recognition-on-ios) – Brad Larson Apr 04 '11 at 17:14

8 Answers8

17

OpenCV library (for iPhone) contains many algorithms. You can simply compare color histograms of images, or use more complicated stuff. Which kind of matching do you mean? Finding duplicates or calculating measure of similarity of images?

If you want to match some simple template to find objects then try Viola & Jones algorithm and so called Haar cascades. OpenCV has trained collection of templates in XML files for detecting faces for example. OpenCV contains utility for training thus you are able to generate cascades for other kinds of objects

Community
  • 1
  • 1
Andrey Sboev
  • 7,454
  • 1
  • 20
  • 37
14

Just to extend the list:

tilo
  • 14,009
  • 6
  • 68
  • 85
14

You can also have a look at Moodstocks, they provide a great API and iOS SDK to implement image recognition in your app in minutes.

MartinMoizard
  • 6,600
  • 12
  • 45
  • 75
  • Good company, but VERY expensive. – Ethan Allen Feb 25 '16 at 00:50
  • Can you create your own library where the image can be compared to to determine the information to pre-pop a details view controller. Ex scan a wine bottle label and pre-pop the info stored in DB in the segue to the details view controller? – Famic Tech Jan 02 '19 at 21:59
10

Try the following two APIs:

Christian
  • 4,596
  • 1
  • 26
  • 33
Jan
  • 116
  • 2
3

The whole field of image recognition has changed with the advent of Deep Neural Networks. However you need a powerful machine to train your own neural net. You can also use vize.it, though - It is an easy-to-use online app that lets you define the task and classify images by using http API.

Disclaimer: I am a PhD student of Artificial Intelligence who is a member of the vize.it team.

user2812820
  • 139
  • 4
3

I found IQEngines, that work well.

Kevin Duong
  • 658
  • 1
  • 8
  • 20
1

Pastec is an open source (LGPL) alternative to the service already mentioned.

Its simple HTTP API allows to easily add, remove and search for matching images in the index. It is based on OpenCV and uses the ORB descriptor, which is patent-free.

MagSoft
  • 51
  • 3
  • To avoid frustration, I want to mention that Pastec ONLY compiles in Linux systems, it does not compile on Mac OS because of its sys/eventfd dependency. – Oscar Gomez Mar 26 '15 at 20:13
  • The dependency to eventfd has been removed so Pastec should now be compilable for OSX. – MagSoft Apr 08 '15 at 12:54
1

I've looked into Moodstocks, who seems to have perfected an image recognition system with a pay-per-month service. They have a great system (I've tested it for my own use and it's fantastic) BUT it's EXTREMELY expensive for me, which is why I am not using it. At the time of me writing this, the "up to 100,000" image service is about $12,000/year. For my project, I have nearly 4 million images I need to match against. YIKES.

So after many months of research on and off, I've come to the conclusion that if you're going to be comparing against 1000's of images or more (in my case 1 million+), you'll need to do the image comparison off of the device. Users mobile devices don't have the space, speed, and power to perform large amounts of computations to do this kind of work.

What that really means is that you need to set up an image recognition server on a high performance machine and make it public to your app. On the app, have the user take a picture of an object (or you can grab frames from the camera video), have it sent to your server for comparison, and then when a match is found report the results back to the app.

You can use a framework like Accord.NET or EmguCV to make a C# desktop application or service that runs on a Windows Server box to do this, for example.

What the Amazon iOS app does for image recognition from what I can guess is they appear to locate SURF points real-time and sends the data to the server while scanning instead of the entire image. My guess is that they use OpenCV on device to do this. But they still use server software to send back the matched product SKU.

Here's an awesome blog post by a guy who wanted to do image matching in .NET and he walks through every step including how it works, how to do it, and then give all his code in a sample application. Amazing post: https://sbrakl.wordpress.com/2015/01/30/love-affair-with-cbir-part-3/comment-page-1/

From what I've been able to learn is that the LoCATe algorithm performs the best and the quickest with large amounts of images, but also takes hours, days, and possibly weeks (depending on how many images you have) to create massive indexes for search. I think when it comes to image matching I've found the speed of creating a solid index is in relation to the speed of finding matches from queries.

Ethan Allen
  • 14,425
  • 24
  • 101
  • 194