-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Connected component labelling bug #21783
Copy link
Copy link
Closed
Milestone
Description
System information (version)
- OpenCV => 4.x
Detailed description
Analyzing the code for connected component labelling, to understand the Grana method, I think I have found an issue in one of the condition defined to to check if the pixels are foreground, without going outside the image limits:
The extract from the cpp code is
#define condition_b c-1>=0 && r-2>=0 && img_row_prev_prev[c-1]>0
#define condition_c r-2>=0 && img_row_prev_prev[c]>0
#define condition_d c+1<w&& r-2>=0 && img_row_prev_prev[c+1]>0
#define condition_e c+2<w && r-1>=0 && img_row_prev[c-1]>0
but condition_e should be
#define condition_e c+2<w && r-1>=0 && img_row_prev_prev[c+2]>0
as pixel e is 2 rows above and 2 columns right of analyzed pixel o
Reactions are currently unavailable