EXC_BAD_ACCESS when calling cvThreshold
Im getting EXC_BAD_ACCESS error when calling cvThreshold. Without that line (if I comment it), the image is displayed perfectly.
void CVWindow::processImage()
{
sourceImg = cvCreateImage(cvSize(640,480),8,1);
cvSetData(sourceImg, &m_img, sourceImg->widthStep);
cvThreshold(sourceImg, sourceImg, 100, 255, CV_THRESH_BINARY);
m_img = *sourceImg-开发者_如何学运维>imageData;
}
Any possible reasons? I have been searching for two days for a solution but cant find it. Thanks
精彩评论