I'm new to computer vision, and I want to detect specific and flat objects in an image (or video frame).
What do I mean with specific and flat?
Flat
Well, flat objects are like objects, but, you know, flat... What it means to me:
- Objects will always be viewed from approximately the same "frontal" angle, that is, the axis of the camera corresponds (more or less) with their surface normal. (But they may be rotated around that axis).
- Objects for which the angle of illumination doesn't change anything (i.e. it doesn't have bumps and creases that cast shadows).
Specific
- Ojects of which I know the exact appearance and shape. They are all exactly the same, there are no variations.
- I have a (precise) photograph (or representation) of them.
Examples of such objects
- The obverse of a $1 bill
- The Mona Lisa
- The front cover of the last issue of (your favorite magazine here)
- ...
I believe the problem is easy enough that I should be able to find a function of a computer vision library that basically works like that:
> findObjects("object.png", "image.png")
[object at x1, y1, rotated z1 degrees, size height1*width1,
object at x2, y2, rotated z2 degrees, size height2*width2,
...]
In fact I don't even really care about the sizes and locations of the objects, I just need a count.
But I can't find anything like this. All I can find are countless examples of face recognition with something called a Haar-classifier, which doesn't seem appropriate for my problem at all, because:
- Faces are not flat, and thus that classifier must cope with problems like different illuminations, shadows...
- It must recognize faces, that is, objects that are similar, but not exactly identical.
- It must recognize faces that it hasn't been trained with just because they "look like" faces.
- Proof that this is not suited: it must be trained with hundreds or thousands of positive and negative samples. In my problem, all the information needed is contained in a single sample. So that can't be right.
So, does something like this exists?
I'd prefer to use OpenCV since this seems to be the standard computer-vision library, but I am open to any solution.