我的程序在使用OpenCV进行图像处理时崩溃了
My program crashes when performing image processing with OpenCV
我使用OpenCV为我的学校项目。
当我使用OpenCV的"基础"时,我所有的程序都可以工作,但是当我必须做"大"图像处理时-例如使用findContours()或HoughLines或HoughLinesP,我的程序崩溃了…
你知道为什么吗?
编辑:代码:#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
using namespace cv;
using namespace std;
int main() {
cout << "lol";
IplImage* image = cvLoadImage("frame3.jpg", 0);
cout << "bas";
cvWaitKey(3000);
Mat src(image);
Mat color_dst;
cout << "la3";
imshow("source", src);
cout << "la4";
waitKey(3000);
cout << "la5";
vector<Vec4i> lines;
HoughLinesP(src, lines, 1, CV_PI / 180, 80, 30, 10);
cout << "la6";
for (size_t i = 0; i < lines.size(); i++) {
line(color_dst, Point(lines[i][0], lines[i][1]),
Point(lines[i][2], lines[i][3]), Scalar(0, 0, 255), 3, 8);
}
imshow("io", color_dst);
cvWaitKey(5000);
}
我认为它崩溃了,因为您建议line例程在未构建的图像上画一条线。
Mat color_dest
不创建图像缓冲区。使用具有图像大小和类型的构造函数之一。
相关文章:
- Qt中的RGB图像处理
- 有关图像处理应用程序的硬件和软件安全性的建议
- C++灰度图像处理
- CUDA 速度比预期慢 - 图像处理
- 如何将 MATLAB 图像处理库内置函数转换为 MATLAB 编码器代码生成不支持的 C++?
- 矢量化图像处理
- OpenGL (ES) 图像处理C++
- C++:灰度位图标题和实时绘画+opencv图像处理
- 在 Unity 中C++使用后台线程进行图像处理会导致崩溃
- 线程会影响树莓派的图像处理性能吗?
- 低性能 – 补丁匹配.GPU 上的图像处理 (CUDA)
- 如何使用OpENCV解决图像处理摄像头IO延迟
- 从单线程到多线程图像处理
- 如何使用win IoT在Raspberry Pi上的相机中显示视频流以及一些图像处理
- C 图像处理(来自单元格的裁剪图像)
- C++中的二进制图像处理
- 实时图像处理:HSV图像中的噪声(openCV)
- C 图像处理数据块进入数组 /指针
- OPENCV图像处理,向量下标超出范围
- 我的程序在使用OpenCV进行图像处理时崩溃了