OpenCV:cvThreshold 在某些图像尺寸下会崩溃
我正在尝试过滤掉图像中的噪音。图像的大小会不时发生变化。看来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
有什么想法吗?提前致谢, 干杯
I'm trying to filter out noise from an image. The size of the image changes from time to time. It seems that cvThreshold can only handle images with certain sizes. This code is working (although it does nothing):
IplImage* iplTresh = cvCreateImage(cvSize(65, 49), 8, 1);
cvThreshold(iplTresh, iplTresh, 100, 255, CV_THRESH_BINARY);
cvReleaseImage(&iplTresh);
This code is crashing (width changed from 65 to 89):
IplImage* iplTresh = cvCreateImage(cvSize(89, 49), 8, 1);
cvThreshold(iplTresh, iplTresh, 100, 255, CV_THRESH_BINARY);
cvReleaseImage(&iplTresh);
error message:
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
Any ideas? Thanks in advance,
cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论