I'm using OpenCV in native code for my Gingerbread app, and it's crashing at the statement cvAddWeighted(...)
cvSetImageROI(image2,faces1);//faces1 is of type CvRect
IplImage *temp1 = cvLoadImage(filepath1);
IplImage *temp2 = cvCreateImage(cvSize(faces1.width,faces1.height),temp1->depth,temp1->nChannels);
cvResize(temp1,temp2);
cvAddWeighted(image2,alpha,temp2,beta,0.0,image2);
//cvCopy(temp2,image2);//
cvReleaseImage(&temp2);
cvReleaseImage(&temp1);
cvResetImageROI(image2);
I tested the code only for values of alpha and beta that satisfies beta = 1.0 - alpha, and the app crashes. I found out that it crashes because of the line cvAddWeighted by commenting out the entire block, and then uncommenting one successive line at a time. I also replaced the cvAddWeighted() call with a cvCopy(), but even then the app crashes. Any idea why?