Marking OpenCv Blob / Contour

Hi, I’ve been working on this for a while and still haven’t had a good solution.

I read the video frame by frame and use background subtraction in 'identify the area where there is movement, and use cvFindContours () to get the border of the rectangle of moving objects.

Assuming the program is kept simple, there can only be 2 people.

These objects move in such a way that they can overlap, rotate and go away at a certain interval.

How can I properly label these people x 2.

cvFindContour can return a border randomly. for Frame1, Frame2, Frame3 .... FrameN

I can initially compare a rectangular centroid to correctly identify a person. When a person overlaps and leaves, this approach will fail.

I tried to track the pixel color of the original obj (however, the person is quite similar, and some areas have similar colors, such as arm, leg, hair), therefore, not enough.

I considered using image statistics as:

CountNonZero (), SumPixels () I mean () Mean_StdDev () MinMaxLoc () Norm ()

to clearly distinguish between two objects. I think this will be the best approach.

+4
source share
3 answers

This is a complex problem and any solution will not be perfect. Computer vision is jokingly known as the AI-complete discipline: if you solve computer vision, and you decide all artificial intelligence.

Highlighting a background can be a good way to detect objects. If you need to improve background subtraction results, you can use MRF . Presumably, you can indicate when there is one object, and when two blobs merged, depending on the size of the blob. If the paths do not change quickly during merging blobs, you can do Kalman tracking and use some heuristics to subsequently fill in the gaps.

Although the colors are similar between two objects, you might consider using an average offset tracker . You may need to do particle filtering to track many hypotheses about who is who.

There are even more sophisticated methods called tiered tracking . There is a later work by Jojic and Frey , Winn , Zhou and Tao and others. Most of these methods come with very strong assumptions and / or require a lot of work for proper implementation.

If you are interested in this topic as a whole, I highly recommend taking a computer vision course and / or reading a textbook such as Ponce and Forsyth's .

+15
source

You can try to remember one corner of each frame (for example, top left). Then, when you get a new set of frames, you compare the distance of their angles to the previously saved ones. This, of course, is not an ideal solution.

  • If both drops cross their paths at some point, he is not sure what the result is.
  • If both drops move too fast, they can also lead to undesirable results.
+1
source

Sounds complicated, especially if there’s a lot of noise in the video.

Perhaps the identification of various cases in which two people interacted. Some examples:

  • Two people meet, then either the reverse course, or continue their name.
  • Two people meet, then only one person changes course or continues his course.
  • Two people meet, then one person remains, and the other moves in the "normal" direction to the camera view, i.e. to the side or to the camera.

Computer Vision tutorials can help identify other cases.

Consider measuring all the functions that you specified for each frame in the video, and then draw their results. Define this if there is a way to match something like the standard deviation of the pixel color in the bounding box that the person is after they cross paths.

+1
source

All Articles