功能.exe:0xc0000005:访问违规读取地点0x0000000000000000
Feature.exe: 0xC0000005: Access violation reading location 0x0000000000000000
我正在尝试使用DynamicAdaptedFeatureDetector
检测和提取图像功能,但是我正在收到访问违规错误。完整的错误是:Unhandled exception at 0x000007FEE08AB89A (opencv_features2d2411d.dll) in Feature.exe: 0xC0000005: Access violation reading location 0x0000000000000000.
我的示例代码是:
.
.
.
Ptr<FeatureDetector> detector;
vector<KeyPoint> keypoints1, keypoints2;
detector = new DynamicAdaptedFeatureDetector(new FastAdjuster(10, true), 5000, 10000, 10);
detector->detect(leftImg_roi, keypoints1);
detector->detect(rightImg_roi, keypoints2);
Ptr<DescriptorExtractor> extractor;
extractor = DescriptorExtractor::create("SIFT");
Mat descriptors1, descriptors2;
extractor->compute(leftImg_roi, keypoints1, descriptors1);
extractor->compute(rightImg_roi, keypoints2, descriptors2);
vector< vector<DMatch> > matches;
Ptr<DescriptorMatcher> matcher = DescriptorMatcher::create("BruteForce");
matcher->knnMatch(descriptors1, descriptors2, matches, 500);
.
.
.
错误在行中出现:extractor-> compute(rightimg_roi,kepoints2,distriptors2(;
来自图像的总检测到的关键点为:KePoints1 = 1649和KePoints2 = 1558
我的代码中有什么想法?
您正在获得null pointer exception
。当您尝试使用null指针时,系统正在尝试从地址0读取。这是不允许的,因此错误:Access violation reading location 0x0000000000000000
。
正如您所说的错误时发生在使用变量extractor
的线上。我的猜测是extractor
是无效的。如果没有,请检查其他变量,然后尝试使用debugger
逐步浏览您的代码。您并没有真正提供最小的完整且可验证的例子,所以我无法检查自己。
相关文章:
- 理解boost::asio-async_read在无需读取内容时的行为
- 使用新行和不使用新行读取文件
- 读取文件并输入到矢量中
- 用c++从输入文件中读取另一行
- 读取文件的最后一行并输入到链接列表时出错
- 在进程中对同一管道进行读取和写入时C++管道出现问题
- 无法找到/读取配置文件.conf-FileIOException
- 如何使用Luacneneneba API正确读取字符串和表参数
- C++将文本文件中的数据读取到结构数组中
- 正在将csv文件读取为双精度矢量
- 为什么 sscanf 无法从一个字符串中读取uint64_t和字符?
- 为什么在读取文件大小时文件IO速度会发生变化
- 正在读取二进制文件(is_open)
- 如何在c++中从文本文件中逐行读取整数
- SSH通过/sbin/SSH无法读取RSA密钥文件(从控制台运行)
- 独立读取-修改-写入顺序
- 从文本文件中读取时钟时间和事件时间并进行处理
- 如何从文本文件中读取值和数组
- 为什么文件名被设置为一个点,而不是在读取矢量中的文件名时
- 一种在C++中读取TXT配置文件的简单方法