-3

I'm using different coloured image borders on an image as unique identifiers for products.

blue border

red border

What I'm looking to do is to allow a user to take a photo of one of these images, and then determine which image has been photographed by using image recognition to compare the photograph to all of the possible different images (i.e. different border colours).

I have OpenCV to hand, I am working with Android, but I am completely new to OpenCV and image recognition. Can anyone help me with a solution?

Scott
  • 1,863
  • 2
  • 24
  • 43

2 Answers2

0

This is such a problem since you can go further in the solution as you would, probably not, want.

First of all, you have to know that the photo is not going to be ever an exactly shaped square, it is not going to have even the paralelism of your source image due to the concept of Homography. homography. So you will have to extract some features from your camera image and then guess the transformation that your image had suffered in order to know if the camera image fit any of your models (source images).

This is somehow better explained here.

Anyway! Although this is an interesting and actual topic in computer vision (which i highly suggest you to research), you still can get a crude solution if you can select a (approximate) square in your input with an approximate red or blue color. Try to think in big related components with a solid color...

I hope this helps you in any way!

Pahgo
  • 114
  • 6
0

First of all have you heard of QR codes? These will do the job you want and there are robust readers available.

These halftone QR codes are pretty cool http://vecg.cs.ucl.ac.uk/Projects/SmartGeometry/halftone_QR/halftoneQR_sigga13.html

Now with regards to you specific question, i would try to follow roughly this pipeline:

        //https://github.com/Itseez/opencv/blob/master/samples/cpp/squares.cpp
        Find set of Box like shapes 
        Find largest Box from set
        Find colour of largest box

Now, you will certainly have some problems with robustness, but this simple pipeline should reveal to you the difficult cases, then you can take it from there.

QED
  • 808
  • 8
  • 11
  • I'm fully aware of QR codes, but I am looking to do this without them. Thanks for the pointers though. – Scott Jun 24 '14 at 09:18