当我使用cvIntegral()
if ((image = cvLoadImage(filename,1))==0){
return -1;//if there is something wrong exit with -1
}
image2 = cvCreateImage(cvSize(image->width++,image->height++),IPL_DEPTH_8U,1);
cvIntegral(image, image2, NULL,NULL);
cvReleaseImage(&image);//release image and exit
cvReleaseImage(&image2);//release image and exit
return 0;
这是错误
OpenCV错误:断言失败(sum.data == sum0.data&& sqsum.data == sqsum0.data&&在cvIntegral,file中的tilted.data == tilted0.data) /build/buildd/opencv-2.3.1/modules/imgproc/src/sumpixels.cpp,第306行 抛出'cv :: Exception'的实例后终止被调用 什么(): /build/buildd/opencv-2.3.1/modules/imgproc/src/sumpixels.cpp:306: 错误:(-215)sum.data == sum0.data&& sqsum.data == sqsum0.data&& 函数cvIntegral中的tilted.data == tilted0.data
答案 0 :(得分:2)
cvIntegral
期望输出图片的类型为CV_32F
或CV_64F
。此外,源图像和目标图像的通道数应相同。你应该这样做:
image2 = cvCreateImage(cvSize(image->width+1,image->height+1),IPL_DEPTH_32F,image->nChannels);