Export to GitHub

cvblob - issue #23

Problem with signed char, cvLabel hangs


Posted on Jun 24, 2011 by Swift Monkey

Hi,

I am using cvblob on an ARM processor, and I discovered a bug in the code. It seems ARM uses an unsigned char by default, while x86 uses signed char.

This leads to an infinite loop in the contour-finding loop in cvLabel.

Specifically, in cvlabel.cpp, on lines 34 and 40, I changed const char movesE ... const char movesI ...

to

const signed char movesE ... const signed char movesI ...

And now it seems to work. However, I haven't yet checked the rest of the code for problems. Perhaps a solution would be to change the Makefile to compile with '-fsigned-char'.

Comment #1

Posted on Jun 24, 2011 by Quick Bear

Hi!

Thank you very much for the report and for the solutions. I will consider both solutions.

Comment #2

Posted on Nov 25, 2011 by Quick Rhino

I confirm what has been said by grendel....@gmail.com. I had the same problems and his workaround helped! Thank you very much grendel! cheers s.

Comment #3

Posted on Feb 1, 2012 by Massive Horse

I also had the same problem! thanks all!

Comment #4

Posted on Dec 22, 2012 by Quick Dog

Similar issue for ARM (et al.?) processors,

cvBlob/cvcontour.cpp , line 84:

change

const char cvChainCodeMoves[8][2] = { { 0, -1},

to

const signed char cvChainCodeMoves[8][2] = { { 0, -1},

(loses the sign on ARM which causes problems later)

Cheers,

Doug

Comment #5

Posted on Feb 8, 2013 by Massive Hippo

Thanks so much for pointing out the bug in cvLabel for ARM processors. I had given up on my Raspberry Pi ever working with cvBlob. I should have read this issue and saved myself hours of troubleshooting! It fixed the problem I had with cvLabel. Brilliant! Thanks.

Comment #6

Posted on Mar 24, 2013 by Quick Rhino

Thank you very much for this fix, you have saved my graduation! However this fix should be mainstreamed into the source code, and not have to make future users have to find the fix through Google.

Comment #7

Posted on Mar 28, 2013 by Swift Lion

Hello someone please help me regarding cross compilation of cvBlob for arm.I stucked on it for many days. Thanks in advance

Comment #8

Posted on Nov 18, 2013 by Massive Bird

Thank you so much for the workaround!

Comment #9

Posted on Jan 16, 2014 by Swift Camel

OMG thank you very much!! I was in the same situation as gary now, i finally have something working on my Raspberry Pi =D

Comment #10

Posted on Aug 1, 2014 by Happy Bear

Thank you so much!

Status: Accepted

Labels:
Type-Defect Priority-Medium