gotomypc / find-object

Automatically exported from code.google.com/p/find-object
0 stars 0 forks source link

Error in keypoints size and descriptor rows in surf #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
i have use your surf code to demonstrate the algorithm in image matching for my 
final year project.
However, when i try to extract the keypoints and descriptors in a image using 
surf 
it give me a error thats '"ERROR : kpt=%lu != 
descriptors=%d\n,keypoints.size(),descriptors.rows"
The details of code is show below:

                // EXTRACT KEYPOINTS
        cv::FeatureDetector * detector = Settings::createFeaturesDetector();
        std::vector<cv::KeyPoint> keypoints;
        detector->detect(img, keypoints);
        delete detector;
        ui_->label_timeDetection->setText(QString::number(time.restart()));

        // EXTRACT DESCRIPTORS
        cv::Mat descriptors;
        cv::DescriptorExtractor * extractor = Settings::createDescriptorsExtractor();
        extractor->compute(img, keypoints, descriptors);
        delete extractor;
        if((int)keypoints.size() != descriptors.rows)
        {
            printf("ERROR : kpt=%lu != descriptors=%d\n", keypoints.size(), descriptors.rows);
        }

do your know why this happen??

I also have a problem in converting the data in data change. 
When the code 'data.convertTo(dataTree_, CV_32F,1,0);' a error also come out.

OpenCV Error: One of arguments' values is out of range (The total matrix size 
does not fit to "size_t" type) 

would u please help me to guess what problem here??
Thanks

Original issue reported on code.google.com by cklwa...@gmail.com on 24 Dec 2011 at 9:35

GoogleCodeExporter commented 9 years ago
Hello cklwayne,

Thank you for your comment, but I am not able to reproduce the problem on my 
system (Mac OS X 10.7 Lion / Ubuntu 10.10 maverick / Windows 7 (all 64 
bits))... so I need more information.
1) Are you using the binaries (which version)? or svn (which revision "svn 
info")?
2) On which operating system are you testing? and is 32 or 64 bits?
3) Is another detector/descriptor type work ? Are you using both detector 
"surf" and descriptor "surf"?
4) Can you see images from the camera?
5) Can you copy/paste the settings found in the ".find_object/find_object.ini" 
file to this issue. (See the "Uninstall" section on the project's main page to 
know where is this file, it is in your Documents on Windows or your Home on 
Mac/Linux).

Here some information about your errors. The error "printf("ERROR : kpt=%lu != 
descriptors=%d\n", keypoints.size(), descriptors.rows);" is shown only when the 
resulting keypoints vector and the descriptors matrix rows have not the same 
size, which is never supposed to happen unless there is a problem with the 
OpenCV extractor implementations (extractor->compute(...)). 
a- If you are using the binaries, it may be a problem with the OpenCV's dlls 
provided (so I need the information above to test it). For example, it may be a 
problem between 32 and 64 bits.
b- If your are using the code from source (svn), make sure your OpenCV 
installed version is >= 2.3.1 (which is the OpenCV version I am testing with). 

If you don't have the latest version 0.2.0 or revision -r58, you could also try 
to download/update to latest version.

Best,
Mathieu

Original comment by matla...@gmail.com on 4 Jan 2012 at 4:18

GoogleCodeExporter commented 9 years ago
Fixed a crash in Windows (r67) with lines after the code sniplet shown in this 
issue. This fix is in version 0.2.1. Let me know if this issue persists.

Original comment by matla...@gmail.com on 5 Jan 2012 at 12:52

GoogleCodeExporter commented 9 years ago
Cleanup : assuming it is fixed by r67. Feel free to reopen if this problem is 
still here, providing informations of Comment 1.

Original comment by matla...@gmail.com on 27 Feb 2012 at 6:28