pradeep
pradeep

Reputation: 48

during runtime the program strucks at frame no 27

I have written a program to count no of cars from the captured video. I have installed opencv and cvblob, raspbian wheezy OS on raspberry pi 2. The problem I am facing is "During run time the program hangs at cvLabel after certain no of iterations.

IplImage *labelImg =cvCreateImage(cvGetSize(greyImage), IPL_DEPTH_LABEL, 1); 
unsigned int result = cvLabel(greyImage, labelImg,blobs);

But when I run the same program on Virtual Machine in my laptop it will run completely. What might be the reason for this..? Please advice

Upvotes: -4

Views: 46

Answers (1)

pradeep
pradeep

Reputation: 48

I got the solution for my issue. The below changes are required specially for raspberry pi 2(armhf) which avoids the program to run infinite.

https://code.google.com/p/cvblob/issues/detail?id=23

go to /home/pi/cvblob/cvBlob

In cvLabel.h file

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

to

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

and in cvBlob/cvcontour.cpp , line 84:

change

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

to

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

Upvotes: 0

Related Questions