0
votes

I need to find the size of a "Moving Object" in opencv. I am not seeking for the actual size, just how much percentage it takes from the whole frame.

I am doing motion detection using the image differentiation method. I am also drawing contours as well. If I draw a "bounding Rect" I know I can get the area of the rectangle and find the approximate object area. But, bounding rect is super slow in real time.

Any good idea to get the approximate size of the moving object? I just need the approximate value so drawing a rectangle or something around the object and getting the area is enough.

1
Are you sure that you do everything right? Operation of contours finding is very slow by comparison with bounding box finding! Also, if you have contour of object stored in some array, why can't you analyse that array to find bounding box?Eddy_Em
Please define 'fast', 'slow', and 'super slow.' They will likely depend on your requirement for "real-time" system we don't know. In addition, posting code would be the fastest way to get an answer from us, software developers.Tae-Sung Shin

1 Answers

0
votes

Try this (minAreaRect)

http://opencv.willowgarage.com/documentation/cpp/structural_analysis_and_shape_descriptors.html#cv-minarearect

And also use Mat not IplImage This should work in less than 30 milliseconds which is required for real-time.

Also make sure your waitKey is not too much and I think it should do the trick