V
V
Vasylj2014-12-14 02:35:12
OpenCV
Vasylj, 2014-12-14 02:35:12

How to determine the presence of an object in an image using OpenCV?

Hello.
It will NOT be about faces, books, numbers. The task, it seems to me, is somewhat simpler:
There is a forklift truck . Works with pickup pallets .
The camera of the Android phone "looks" at the plug. (behind, slightly above)
Task: To determine whether the forklift is loaded, that is, whether a pallet (filled with some objects) lies on the fork or not. Break the calculation process into blocks. Process the maximum number of blocks on the phone, and transfer what did not "fit" (for example, due to time) via Wi-Fi to the driver's terminal, process it there and display the result.
Software: OpenCV, OpenCV4Android Approach 1
was tried
:(based on a previous work by a colleague) The camera is set at a fixed point. The image shows two PointsOfInterest - points that lie on the teeth of the fork.

  1. Gradient recognition is done around the POI and the approximate contours of the fork tines are found.
  2. Rectangles are "drawn" around the teeth.
  3. The sum of the areas of rectangles for an unloaded fork is calculated
  4. If there is a pallet on the fork, then only one large rectangle is obtained.
  5. The area of ​​the large rectangle is much larger than the area for an unloaded fork.
  6. Profit

Unfortunately, the approach did not work well. Very slow and it was not possible to adjust the coefficients well.
Therefore, it was decided to take a new approach. The idea is simple:
Approach 2:
  1. Cut video from the camera into separate pictures.
  2. Split into training and test sets (loaded/empty).
  3. On the desktop, run several machine learning algorithms.
  4. The algorithm most suitable for the task of coding on the phone
  5. Profit

As far as I understand, it is best to calculate HOG for pictures and drive training on it.
But then a snag arises:
That is, general knowledge about machine learning from Wikipedia, Habr and the OpenCV documentation gives an understanding that you need to at least run a neural network in several versions , but ...

Question
:
  1. Is the idea of ​​the second approach viable?
  2. What are the best algorithms to use?
  3. What should I pay attention to that I missed?

I would be grateful for any hints.
Sorry if I missed the question too much.
I read about the Haar cascade on Habré , but it seems to be a bit too much.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rascko, 2015-01-08
@Rascko

And why not make it a little easier:
1. We hang a bright-bright LED / just some high-contrast object (LED + reflectors, for example) on each prong of the forklift fork
2. If the pallet closes them -> They are not recognized -> Something i.e. on a fork. If they are visible, then the fork is free.
Recognizing two bright luminous points with a known linear distance between them is, IMHO, easier than the contours of a fork and load, especially in a dark warehouse.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question