Abort() called in feature matching code from opencv_tutorials codes
abort() called in feature matching code from opencv_tutorials codes
I am using a sample program for feature match used in opencv_tutorials but it is showing run time error abort() is called can any one specify the reason of such a runtime error ? The code is same as in http://docs.opencv.org/doc/tutorials/imgproc/histograms/template_matching/template_matching.html The only difference is i did not use command line arguments for input images.
Here is the code:
include "stdafx.h"
include "opencv2/highgui/highgui.hpp"
include "opencv2/imgproc/imgproc.hpp"
include <iostream>
include <stdio.h>
using namespace std; using namespace cv;
/// Global Variables Mat img; Mat templ; Mat result; char* image_window = "Source Image"; char* result_window = "Result window"; int match_method; int max_Trackbar = 5;
/// Function Headers void MatchingMethod( int, void* );
/* @function main */ int main( int argc, char* argv ) {
// Load image and template
img = imread( " Right .jpg", 1 ); templ = imread( "Temp.jpg", 1 );
// Create windows namedWindow( image_window, CV_WINDOW_AUTOSIZE ); namedWindow( result_window, CV_WINDOW_AUTOSIZE );
// Create Trackbar
char* trackbar_label = "Method: \n 0: SQDIFF \n 1: SQDIFF NORMED \n 2: TM CCORR \n 3: TM CCORR NORMED \n 4: TM COEFF \n 5: TM COEFF NORMED";
createTrackbar( trackbar_label, image_window, &match_method, max_Trackbar, MatchingMethod );
MatchingMethod( 0, 0 ); waitKey(0); return 0; }
/** * @function MatchingMethod * @brief Trackbar callback */
void MatchingMethod( int, void* ) {
// Same code as in sample code in above link }