cvFloodFill flags in cvSegmentMotion() (Bug #1478)


Added by Frankie Fong over 13 years ago. Updated almost 13 years ago.


Status:Cancelled Start date:
Priority:High Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:imgproc, video
Target version:2.4.0
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

The flags to cvFloodFill() call at cvSegmentMotion() is
CV_FLOODFILL_MASK_ONLY + 2*256 + 4.

Does the '2*256' supposed to represent CV_FLOODFILL_FIXED_RANGE?
If that's the case, I don't think it is doing it correctly. CV_FLOODFILL_FIXED_RANGE is defined as (1 << 16).


History

Updated by Vadim Pisarevsky over 13 years ago

no, 2*256 (or (2 << 8) ) means that the just filled pixels are marked with value 2 in the mask. fixed range is not used.

  • Status changed from Open to Done
  • (deleted custom field) set to invalid

Updated by Frankie Fong over 13 years ago

Thanks for clarifying. So it means the 'newVal' argument is for the input 'image' and flats[15:8] in the 'flags' is for the 'mask'. I can't find this explanation in the documentation / code-comments though.

And now back to the floating-range versus fixed-range:

Here is a sentence from the "Learning OpenCV" book: "Finally, you must pass in seg_thresh, which is the maximum downward step ( from current time to previous motion) that you'll accept as attached motion. This parameter is provided because there might be overlapping silhouettes from recent and much older motion that you don't want to connect together." I am quoting the book because it seems like its author once was involved in Motion-Templates work (Bradski00).

My experiment with the sample app is that segmentMotion() does a better job of limiting the region with CV_FLOODFILL_FIXED_RANGE. Currently with a floating-range the region pretty much covers all the pixels within the 'duration' set up by updateMotionHistory(). With a fixed-range, it gives me a better control of the segmentation process.

That's my 2 cents.

  • Status changed from Done to Cancelled
  • (deleted custom field) deleted (invalid)

Updated by Andrey Kamaev almost 13 years ago

  • Target version set to 2.4.0

Also available in: Atom PDF