How to solve this exception?
please help me, I have this code and it throws me that exception.
* Error in `/home/sony/Desktop/recognizingObjects/detectingShapes/chamfer': corrupted double-linked list: 0x0000000002620ee0 * Aborted (core dumped)
I guess it is when i call the function "chamerMatching( img, tpl, results, costs );"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/contrib/contrib.hpp"
#include <iostream>
using namespace cv;
using namespace std;
const char* keys =
{
"{1| |logo_in_clutter.png|image edge map }"
"{2| |logo.png |template edge map}"
};
int main( int argc, const char** argv )
{
CommandLineParser parser(argc, argv, keys);
string image = parser.get<string>("1");
string templ = parser.get<string>("2");
Mat img = imread(image.c_str(), 0);
Mat tpl = imread(templ.c_str(), 0);
if (img.empty() || tpl.empty())
{
cout << "Could not read image file " << image << " or " << templ << "." << endl;
return -1;
}
Mat cimg;
cvtColor(img, cimg, CV_GRAY2BGR);
// if the image and the template are not edge maps but normal grayscale images,
// you might want to uncomment the lines below to produce the maps. You can also
// run Sobel instead of Canny.
Canny(img, img, 5, 50, 3);
Canny(tpl, tpl, 5, 50, 3);
vector<vector<Point> > results;
vector<float> costs;
int best = chamerMatching( img, tpl, results, costs );
if( best < 0 )
{
cout << "matching not found" << endl;
return -1;
}
size_t i, n = results[best].size();
for( i = 0; i < n; i++ )
{
Point pt = results[best][i];
if( pt.inside(Rect(0, 0, cimg.cols, cimg.rows)) )
cimg.at<Vec3b>(pt) = Vec3b(0, 255, 0);
}
imshow("result", cimg);
waitKey();
return 0;
}
Why do you guess? Let's debug to find out where it crashes.
Simply said, that function does NOT exist ... So I am guessing your definition of that function is not included here or you copied someones code without knowing this is a own written code.
@StevenPuttemans resides in contrib
Ok excuse me. Weird that the search doesnt work on it...
I have the same problem. Anyone know how to solve it?
I m also using this code but getting debug assertion failed error... Expression :_Block_type_is_valid(pHead-->nBlockuse)..
Do you know how to use a debugger?
I am having the same problem, for reference, here is the backtrace (not enough space for all of it):
5 0x00007ffff6d9c1ce in cv::ChamferMatcher::Template::~Template() () from /usr/local/lib/libopencv_contrib.so.2.4
6 0x00007ffff6da4400 in cv::chamerMatching(cv::Mat&, cv::Mat&, std::vector<std::vector<cv::point_<int>, std::allocator<cv::point_<int> > >, std::allocator<std::vector<cv::point_<int>, std::allocator<cv::point_<int> > > > >&, std::vector<float, std::allocator<float=""> >&, double, int, double, int, int, int, double, double, double, double) () from /usr/local/lib/libopencv_contrib.so.2.4
7 0x0000000000404987 in main (argc=3, argv=0x7fffffffde88) at ...chamfer.cpp:55
offending line: int best = chamerMatching( img, tpl, results, costs );
@mjsobrep, please open a new topic. This one is more than one year old ...
http://stackoverflow.com/questions/19...