in Education by
I wrote a program which gets matches between 2 pictures. And this is the code. but if I use BruteForceMatcher> (not flann) it works. #include #include "opencv2/core/core.hpp" #include "opencv2/features2d/features2d.hpp" #include "opencv2/highgui/highgui.hpp" using namespace cv; void help() { printf("\nThis program demonstrates using features2d detector, descriptor extractor and simple matcher\n" "Using the SURF desriptor:\n" "\n" "Usage:\n matcher_simple \n"); } int main() { Mat img1 = imread("C:\\Users\\Hayk\\Desktop\\source1.bmp", CV_LOAD_IMAGE_GRAYSCALE); Mat img2 = imread("C:\\Users\\Hayk\\Desktop\\source2.bmp", CV_LOAD_IMAGE_GRAYSCALE); if(img1.empty() || img2.empty()) { printf("Can't read one of the images\n"); return -1; } // detecting keypoints SurfFeatureDetector detector(6000); vector keypoints1, keypoints2; detector.detect(img1, keypoints1); detector.detect(img2, keypoints2); // computing descriptors SurfDescriptorExtractor extractor; Mat descriptors1, descriptors2; extractor.compute(img1, keypoints1, descriptors1); extractor.compute(img2, keypoints2, descriptors2); // matching descriptors FlannBasedMatcher matcher; vector matches; matcher.match(descriptors1, descriptors2, matches); // drawing the results namedWindow("matches", 1); Mat img_matches; drawMatches(img1, keypoints1, img2, keypoints2, matches, img_matches); imshow("matches", img_matches); waitKey(0); return 0; } And this error I am getting after running the program OpenCV Error: Assertion failed (dataset.type() == CvType::type()) in unknown function, file c:\Users\vp\work\ocv\opencv\modules\features2d\..\flann\include\o pencv2/flann/flann.hpp, line 105 Can anyone say to me what I am doing wrong? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Your code works just fine on Linux with OpenCV 2.3.1a. I've had several problems with the C++ OpenCV's interface for Windows. When I have to use Windows, I use the C interface.

Related questions

0 votes
    I wrote a program which gets matches between 2 pictures. And this is the code. but if I use ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    My last question on image recognition seemed to be too broad, so I would like to ask a more ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    I am writing a program that uses the XGetPixel() method. However, upon using it I get an error ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 27, 2022 in Education by JackTerrance
0 votes
    To my amazement I just discovered that the C99 stdint.h is missing from MS Visual Studio 2003 upwards. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    I am trying to understand the usage of private const in the class. My understanding is that private const is used to make ... (void) { int const MyExample::x = 3; std::cout...
asked Apr 12, 2022 in Education by JackTerrance
0 votes
    I am following simple examples to build up my understanding on private static members. However, I am getting ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    I have a managed C++ dll which uses a unmanaged C++ lib. I've added the lib file in the ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    ___________ function gives an error message if the desired package cannot be loaded. (a) Dplyr (b) Require (c ... of R Programming Select the correct answer from above options...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    _______ allows you to modify the error behavior so that you can browse the function call stack (a) debug() ... of R Programming Select the correct answer from above options...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    __________ prints out the function call stack after an error occurs. (a) trace() (b) traceback() (c) ... Debugging of R Programming Select the correct answer from above options...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    I want to user YOLOv3 for object detection in videos on macOS 10.14.1 I hence installed opencv 4. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    Below, I have a python script. The part that is not working is the function cv2.moveWindow("TrackBars" ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 3, 2022 in Education by JackTerrance
0 votes
    Below, I have a python script. The part that is not working is the function cv2.moveWindow("TrackBars" ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
...