ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

According to this answer on Stack Overflow, it may be from these lines:

Mat img_show;
drawMatches(test, test_kp, train, train_kp, good_matches, img_show);

The error message hints that it's not expecting an empty() image. You can try to initialize the image with black pixels first:

img_matches = Mat::zeros(img_1.size(), CV_8UC3 );

Notice I'm using the first image dimensions/size, assuming both images have the same size. Be sure double check your setup and use the appropriate size. Additionally you can put the block in a try...catch block to see the details:

try {  //your drawKeyPoints code here
} catch (cv::Exception &e) { 
  cerr <<  e.msg << endl;  
}

According to this answer on Stack Overflow, it may be from these lines:

Mat img_show;
drawMatches(test, test_kp, train, train_kp, good_matches, img_show);

The error message hints that it's not expecting an empty() image. You can try to initialize the image with black pixels first:

img_matches img_show = Mat::zeros(img_1.size(), CV_8UC3 );

Notice I'm using the first image dimensions/size, assuming both images have the same size. Be sure double check your setup and use the appropriate size. Additionally you can put the block in a try...catch block to see the details:

try {  //your drawKeyPoints code here
} catch (cv::Exception &e) { 
  cerr <<  e.msg << endl;  
}