logo       

Debug error with cvFitEllipse2: msg#01212

lib.opencv

Subject: Debug error with cvFitEllipse2

I'm trying to aproximate red pixels from a image to a ellipse.
when i build, i take succesful build, but when i start the debug a
fatal error appear in my screen. I think that my method of work to
cvPoint or
cvFitEllipse2 is not correct.

//source code:
void callback(IplImage* image){

IplImage* image1 = image;
int i,j;
int x,y;
int numpunts=0;
CvPoint* PointArray;
PointArray = (CvPoint*)malloc( 100000*sizeof(CvPoint) );

for(i=0; i<image1->height; i+=1){

for(j=(image1->widthStep)*i;
j<(image1->widthStep)*(i+1);j+=image1->nChannels){

r=(unsigned char)image1->imageData[j+2];
g=(unsigned char)image1->imageData[j+1];
b=(unsigned char)image1->imageData[j];

if ((r > 210) && (r< 2500) && (b > 70 ) && (b < 100)
&& (g>100) &&
(g<130) ){

y=j/3;
x=i;
PointArray[numpunts].x=x;
PointArray[numpunts].y=y;
numpunts++;
}
}
}

cvFitEllipse2( PointArray );
free(PointArray);

}


Any idea???
Thanks a lot









Change settings: http://www.yahoogroups.com/mygroups, select
Get Emails (get all posts)
Daily Digest (one summary email per day)
Read on the web (read posts on the web only)Or Unsubscribe by mailing
OpenCV-unsubscribe@xxxxxxxxxxxxxxx



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise