Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Object detection for specific flat objects

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.

like image 297
Gohu Avatar asked Feb 20 '11 17:02

Gohu


People also ask

Which object detection is best for small objects?

Feature-Fused SSD: Fast Detection for Small Objects.

Which sensor can detect almost every kind of material?

Capacitive Sensors Hence, these sensors can detect objects made from a wide variety of materials such as plastic, paper, wood, etc.

What is the best method for object detection?

Most Popular Object Detection Algorithms. Popular algorithms used to perform object detection include convolutional neural networks (R-CNN, Region-Based Convolutional Neural Networks), Fast R-CNN, and YOLO (You Only Look Once). The R-CNN's are in the R-CNN family, while YOLO is part of the single-shot detector family.


1 Answers

One way to do that would be to use a keypoint matcher. Opencv has a demo doing kind-of what you want (find http://imgur.com/a/Bbc6C#gxXGh in http://imgur.com/a/Bbc6C#UfTkn as a premade demo (in the opencv 2.2 distribution: samples/c/find_obj.cpp). The output is visualized in http://imgur.com/ZF1bh - you should be able to start from that to adapt it so it finds multiple instances of the image and counts them.

like image 93
etarion Avatar answered Oct 06 '22 05:10

etarion