Bug in CV_IS_SUBMAT macro, fails to expand.

asked 2016-08-15 13:56:02 -0600

sumolx gravatar image

Seems within core/cvdef.h there is a typo within this macro, looking at the relationships between the flags and macros I believe the author's intent was to reference CV_SUBMAT_FLAG instead of CV_MAT_SUBMAT_FLAG as it is undefined. I'm looking to verify this is indeed an issue with others before I submit this defect.

edit retag flag offensive close merge delete

Comments

What is your opencv version your system and compiler?

LBerger gravatar imageLBerger ( 2016-08-15 14:23:18 -0600 )edit

i'd think, you are right about it .

still, i can't find any occurrence of CV_IS_SUBMAT in the whole codebase, so it's likely never used

(and that's why noone complained before...)

(it seems, CV_IS_MAT_CONT is used instead mostly)

berak gravatar imageberak ( 2016-08-16 00:40:51 -0600 )edit

nonetheless, report it here: https://github.com/opencv/opencv/issues

berak gravatar imageberak ( 2016-08-16 03:42:07 -0600 )edit

@sumoix, what about the issue ?

berak gravatar imageberak ( 2016-08-18 23:55:20 -0600 )edit

I will submit the bug sometime this weekend.

I am running a snapshot from the main opencv 3.x trunk. My compiler is clang on OSX el capitan with c++11 enabled.

sumolx gravatar imagesumolx ( 2016-08-19 14:06:49 -0600 )edit

btw, mind telling us, how you dicovered this ? how did it get in your way ? would it be specific to clang/OSX ?

berak gravatar imageberak ( 2016-08-19 14:10:40 -0600 )edit

Discovery: I was implementing a user driven routine which allowed users to nest detection algorithms within each other. For example user only wants to identify objects that move initially, then take those rectangles of interest and detect sub objects and so on until the final object has been identified then perform some action based on those findings.

The problem I was trying to solve was nested algorithms that use the same canvas (gray images) and prevent unnecessary conversions from color to gray. I found this macro could be used to identify if it was a sub matrix instead of comparing the number of channels and rbg thresholds for a gray image.

I have then found an alternate solution that works very well. But I figured this bug should be reported.

This is not a platform specific bug

sumolx gravatar imagesumolx ( 2016-08-19 14:46:20 -0600 )edit