OpenCV:cvThreshold因某些图像大小而崩溃

时间:2012-02-01 23:35:57

标签: c++ opencv

我正在尝试过滤图像中的噪点。图像的大小会不时变化。似乎cvThreshold只能处理具有特定大小的图像。此代码正在运行(尽管它什么都不做):

IplImage* iplTresh = cvCreateImage(cvSize(65, 49), 8, 1);
cvThreshold(iplTresh, iplTresh, 100, 255, CV_THRESH_BINARY);
cvReleaseImage(&iplTresh);

此代码崩溃(宽度从65更改为89):

IplImage* iplTresh = cvCreateImage(cvSize(89, 49), 8, 1);
cvThreshold(iplTresh, iplTresh, 100, 255, CV_THRESH_BINARY);
cvReleaseImage(&iplTresh);

错误消息:

Program received signal SIGILL, Illegal instruction.
0x00007ffff1529da7 in cv::threshold(cv::_InputArray const&, cv::_OutputArray const&, double, double, int) ()
from /usr/local/lib/libopencv_imgproc.so.2.3

有什么想法吗?提前致谢, 欢呼声

0 个答案:

没有答案