Ask Your Question

zits's profile - activity

2019-01-11 10:13:55 -0600 received badge  Notable Question (source)
2014-11-14 07:39:36 -0600 received badge  Popular Question (source)
2013-05-04 12:01:17 -0600 received badge  Editor (source)
2013-05-04 11:59:45 -0600 asked a question 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 }

2013-05-04 11:47:23 -0600 asked a question 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 ? 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 ) { /// Source image to display Mat img_display; img.copyTo( img_display );

/// Create the result matrix int result_cols = img.cols - templ.cols + 1; int result_rows = img.rows - templ.rows + 1; result.create( result_cols, result_rows, CV_32FC1 ); /// Do the Matching and Normalize matchTemplate( img, templ, result, match_method ); normalize( result, result, 0, 1, NORM_MINMAX, -1, Mat() ); /// Localizing the best match with minMaxLoc double minVal; double maxVal; Point minLoc; Point maxLoc; Point matchLoc; minMaxLoc( result, &minVal, &maxVal, &minLoc, &maxLoc, Mat() ); /// For SQDIFF and SQDIFF_NORMED, the best matches are lower values. For all the other methods, the higher the better if( match_method == CV_TM_SQDIFF || match_method == CV_TM_SQDIFF_NORMED ) { matchLoc = minLoc; } else { matchLoc = maxLoc; } /// Show me what you got rectangle( img_display, matchLoc, Point( matchLoc.x + templ.cols , matchLoc.y + templ.rows ), Scalar::all(0), 2, 8, 0 ); rectangle( result, matchLoc, Point( matchLoc.x + templ.cols , matchLoc.y + templ.rows ), Scalar::all(0), 2, 8, 0 ); imshow( image_window, img_display ); imshow( result_window, result );

return; }

2013-05-02 13:30:46 -0600 commented answer Run time error: R6010 abort () called:

Thanks it worked :)

2013-05-02 13:12:32 -0600 asked a question Run time error: R6010 abort () called:

I am new to opencv.. I have this simple code:

//Header files
using namespace std;
using namespace cv;

int main()
{

    Mat image;  Mat templ;
    Mat result;
    int method = CV_TM_SQDIFF; 

    namedWindow( "result_window", CV_WINDOW_AUTOSIZE );

    image = imread ("Image.png", 1 );
    templ = imread ("template_m.png",1 ) ;

void matchTemplate (Mat image, Mat templ, Mat result, int method);

 imshow ( "result_window", result );
return 0;
}

But when i compile it it says abort() is called. Can anyone tell me what is the reason ??

2013-04-28 04:27:30 -0600 commented answer image comparison with a database

Ok thanks a lot @Guanta

2013-04-27 11:38:43 -0600 commented answer image comparison with a database

@simba1382 and @Guanta Did you implemented this by using bagofwords_classification.cpp from opencv version 2.4.x In case you did then plz help me in the changes that we are required to make in this .cpp files for proper working of code.. I am new to opencv and still trying sample code.

How and where to add the Feature detector,descriptor extractor, descriptor matcher ?? in that .cpp code

2013-04-27 07:29:40 -0600 received badge  Critic (source)
2013-04-27 07:29:36 -0600 received badge  Supporter (source)
2013-04-23 23:55:13 -0600 asked a question Comparing objects in an image from library of objects

I have created a library of objects at different angles. Now what i have to do is to take image from the stereo camera. And compare the objects detected with the already stored library of objects. Through edge detection techniques objects (from image taken) are separated and stored in a separate array of images...

Can anyone help me, how can i do this comparison ?? SURF and SIFT will work for me ??