Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

opencv_surface_matching400.dll in opencv_ppf.exe: 0xC0000005: Access violation reading location 0x0000022773229068. I

Hello, I am trying to run this code

#include<opencv2\surface_matching.hpp>
#include <iostream>
#include "opencv2/core/utility.hpp"
#include "opencv2/surface_matching/ppf_helpers.hpp"

using namespace std;
using namespace cv;
using namespace ppf_match_3d;

int main()
{
Mat pc = loadPLYSimple("chicken_down.ply", 1);

// Now train the model
cout << "Training..." << endl;
int64 tick1 = cv::getTickCount();
ppf_match_3d::PPF3DDetector detector(0.025, 0.05);
detector.trainModel(pc);
int64 tick2 = cv::getTickCount();
cout << endl << "Training complete in "
    << (double)(tick2 - tick1) / cv::getTickFrequency()
    << " sec" << endl << "Loading model..." << endl;

// Read the scene
Mat pcTest = loadPLYSimple("rs13_down.ply", 1);

// Match the model to the scene and get the pose
cout << endl << "Starting matching..." << endl;
vector<Pose3DPtr> results;
tick1 = cv::getTickCount();
detector.match(pcTest, results, 1.0 / 40.0, 0.05);
tick2 = cv::getTickCount();
cout << endl << "PPF Elapsed Time " <<
    (tick2 - tick1) / cv::getTickFrequency() << " sec" << endl;


return 0;
    }

But it gives me the following runtime error :

Exception thrown at 0x00007FFD91F18804 (opencv_surface_matching400.dll) in opencv_ppf.exe: 0xC0000005: Access violation reading location 0x000001AC8B1FAD48.

If there is a handler for this exception, the program may be safely continued.

All paths are ok and I tried both Debug and release mode. I am using Opencv-4.0.0, VS-2015