关于” Assertion failed:src_picture->width%2== 0 && src——picture-》height%2== 0”的问题(还未决解)
2013-09-26 13:07
363 查看
在使用PyrSegmentation领域分割函数时出现的问题出现Assertionfailed:src_picture->width%2== 0 && src——picture-》height%2==
0…….
还有提示:Thisapplication has requested the Runtime to terminate it in an lead the way. BothPlease contact the application 's support team for more information. (PressRetry to debug the application)
经过多次尝试,发现输入的图像有些可以通过,有些却不能通过。(求高手解释,谢谢)
能通过的结果图
希望大牛们告诉我为什么有些图片(如下面的)不能通过?在这先谢谢啦^_^
这两图就是不能通过
0…….
还有提示:Thisapplication has requested the Runtime to terminate it in an lead the way. BothPlease contact the application 's support team for more information. (PressRetry to debug the application)
经过多次尝试,发现输入的图像有些可以通过,有些却不能通过。(求高手解释,谢谢)
#include "stdafx.h" #include"opencv2/opencv.hpp" #include "legacy.hpp" int _tmain(int argc, _TCHAR* argv[]) { cvNamedWindow("src"); cvNamedWindow("PyrSegmentation"); //加载图像 IplImage* src_picture= cvLoadImage("F://Opencv_picture//2.jpg"); IplImage* dst_picture= cvCreateImage(cvGetSize(src_picture), src_picture->depth, src_picture->nChannels); assert(src_picture->width%2 == 0 && src_picture->height%2 == 0); //分配内存 CvMemStorage* storage= cvCreateMemStorage(0); if(!storage) { printf("Storage Errors!\n"); } //分割部件的输出序列的指针 CvSeq* comp= NULL; //建立金字塔的最大层数 int levels =2; //建立连接的错误阈值 double threshold1= 150; //分割簇的错误阈值 double threshold2= 30; //金字塔图像分割 cvPyrSegmentation(src_picture, dst_picture, storage, &comp, levels, threshold1, threshold2); cvShowImage("src", src_picture); cvShowImage("PyrSegmentation", dst_picture); cvWaitKey(0); cvReleaseImage(&src_picture); cvReleaseImage(&dst_picture); cvDestroyWindow("src"); cvDestroyWindow("PyrSegMentation"); return 0; }
能通过的结果图
希望大牛们告诉我为什么有些图片(如下面的)不能通过?在这先谢谢啦^_^
这两图就是不能通过
相关文章推荐
- 关于List<Model>类型 GridView排序问题的解决
- Jsp页面关于BootStrap模态框和<a href onclick>事件不能同时使用,以及传参的问题
- 关于layout()->setSizeConstraint(QLayout::SetFixedSize)的问题
- 关于<base>标签影响锚点的问题
- 关于struts2的xml中<result type="redirect">参数问题
- 关于while(cin>>str)无法结束的问题
- C++关于std namespace与# include<iostream>关系的有关问题
- ASP.NET页面重复加载的问题之<img src="#" />
- 关于c++提取符号“>>”的重载问题
- 关于java中<T>问题
- 关于OpenCV Error: Assertion failed (size.width>0 && size.height>0)的问题
- Java基础--->09.关于JDK使用旧方法编译出错、警告问题。
- 关于servlet服务端接收客户端发送的List<?>数据的问题
- 关于1>LINK : fatal error LNK1168: 无法打开 ....exe或者....dll进行写入的问题
- 关于<a>标签的问题
- 菜鸟遇到的问题:LCD显示中文遇到问题-->关于字符串的编码方式
- 关于<c:forEach>取得集合数量的问题
- html <img>标签 src=""内的图片路径问题
- 关于<input type="text">不能显示空格的问题
- 最近的两个问题<input>与<frame src="/example/html/frame_a.html" name="showframe">