Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug - rendering #37

Open
GoogleCodeExporter opened this issue Feb 8, 2016 · 0 comments
Open

bug - rendering #37

GoogleCodeExporter opened this issue Feb 8, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

Hi, 

nice work with the cvBlob library.
However, while i was working on a project i discovered a bug in your code.

The function cvRebderBlob misses the last row and column of the blob's ROI.

The lines 181 and 182 in the cvblob.cpp contain a for loop whose for loop 
condition should be changed to include also the indexes blob->maxx and 
blob->maxy, so:

for (unsigned int r=blob->miny; r<=blob->maxy; r++, labels+=stepLbl, 
source+=stepSrc, imgData+=stepDst) 
for (unsigned int c=blob->minx; c<=blob->maxx; c++) 


i've included a minimal example code to test the difference. 
The example creates 10 by 10 pixel image and includes a square of 4 pixels . 
After that the cvLabel finds the blobs and they are rendered to an empty 10 by 
10 image. In addition all the pixel values are printed to std.
As you can see, 3 out of 4 pixels are missing in the rendered image.
With the '=' added to the for loops, the maxy and maxx are also included and 
the rendered image matches the input image.

Jaka

Original issue reported on code.google.com by jkrava...@gmail.com on 14 Feb 2013 at 9:35

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant