简体   繁体   中英

OpenCV boundary and intersection detection in a video

I am obtaining a feed from my camera and an example frame from it looks as follows

http://imgur.com/Tv7fb

The frame consists of a boundary and a moving object. I have the following questions.

1) How do I dynamically detect the boundary efficiently? The boundary is guaranteed to be of a different color to the rest of the surroundings.

2) How do I detect the boundary of the moving object efficiently? It is guaranteed to be the only moving object in the frame.

3) How do I determine an intersection between the boundary and the moving object? The boundary and object could be in any shape.

  1. Use segmentation techniques to find large areas of solid color. Choose, say, the largest solid color region as your boundary. Or, use the Hough transform to find strong lines in the image, and identify the boundary. Create a mask containing white pixels where your boundary region lies, black everywhere else.

  2. Use background subtraction . This can be done in a simple way by capturing a reference frame with no objects in the scene, and then just subtracting it from subsequent frames. Create a mask containing white pixels where your object is, black everywhere else.

  3. Intersect the masks created in 1 and 2 with a per-element AND operation (or a per-element multiply).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM