-1

I need to compare two images in a project, The images would be two fruits of the same kind -let's say two different images of two different apples-

To be more clear, the database will have images of the stages which an apple takes from the day it was picked from a tree until it gets rotten..

The user would upload an image of the apple they have and the software should compare it to all those images in the database and retrieve the data of the matching image and tell the user at which stage is it...

I did compare before images using OpenCv emgu but I really don't have much knowledge if it's the best way...

I need an expert advise is what i said in the project even possible? or the whole database images' will match the user's image! And is this "image processing" or something else? And is there any suggested tutorials to learn how to do this?

I know it seems not totally clear yet, but it's just a crazy idea that I wish I can get a way to know more how i can bring it to life!

N.B the project will be an android application

bslawski
  • 600
  • 1
  • 9
  • 22
Rawan.S
  • 29
  • 1
  • 5
  • What is the actual goal of your project? Rather than comparing images, it seems to me that you're interested in detecting the stage of decay of an apple (or something along that line). If that is so, I'd decide on a fairly limited number of stages, and collect a statistically significant sample of images for each one of them (this will probably be in the hundreds), and start analyzing them for different features that could be used to categorize them on. – Dan Mašek Oct 05 '16 at 02:41
  • Yes exactly that's what I have in mind, but before getting my self deeply inset in the project i want to know what I actually should use to compare images and whether it will even work or it will just be a waste of time and effort.. – Rawan.S Oct 05 '16 at 02:45
  • 1
    It sounds like an interesting idea, but it seems like a rather niche subject (and a very broad question). I wouldn't expect a concrete answer to this, and I would expect that this would be a long-term project involving research and experimentation. It really depends on how you define the problem. You could look for shriveled apples (compared to smooth ones) -- maybe some kind of frequency analysis? Use hue to detect the brown or black rotten areas? Some kind of feature detection for scabs (or again based hue)? Maybe feature detection to find the white spots of fungal infection? – Dan Mašek Oct 05 '16 at 03:44
  • Also, in the scope of things, I wouldn't really worry about Android or the specific platform. Focus on the detection algorithm and develop it on some comfortable platform (probably desktop). Porting it to another platform should be fairly trivial afterwards. – Dan Mašek Oct 05 '16 at 03:48

1 Answers1

3

This is an example of a supervised image classification problem, which is a pretty broad field. You can read up on image classification here.

The way that you would approach this problem would be to define a few stages of decay (fresh, starting to rot, half rotten, completely rotten), put together a dataset of many images of the fruit in each stage, and train an image classifier on each stage. The sample dataset should contain images of many different pieces of fruit in many different settings. If you want to support different types of fruit, you would need to train a different classifier for each fruit.

There are many image classification tools out there. To name a few:
OpenCV's haar classifier
dlib's hog classifier
Matlab's Computer Vision System Toolbox
VLFeat
It would be up to you to look into which approach would work best for your situation.

Given that this is a fairly broad problem, I wouldn't expect to come up with a solid solution quickly unless you've had experience with image classification. If you are trying to develop a product, I would recommend getting in touch with a computer vision expert that you could contract to solve it.

If you are just looking to learn more about image classification, however, this could be a fun way to play around with different tools and get a feel for what's out there. You may want to start by learning about Machine Learning in general. Caltech offers a free online course that gives a pretty good intro to the subject.

bslawski
  • 600
  • 1
  • 9
  • 22