MasteringOpenCV / code

Code for the book "Mastering OpenCV with Practical Computer Vision Projects" by Packt Publishing 2012.
Other
2.74k stars 1.65k forks source link

Markerless Example Issue #5

Closed kodemint closed 11 years ago

kodemint commented 11 years ago

in the markerless sample, when you set enableRatioTest = true, the programs throws an exception. am on osx and opencv2.3.4

"OpenCV Error: Assertion failed (K == 1 && update == 0 && mask.empty()) in batchDistance, file /Users/premithk/Desktop/openCV/OpenCV-2.4.3/modules/core/src/stat.cpp, line 1830"

BloodAxe commented 11 years ago

Hi,

Thanks for informing about this issue. I will investigate your request and write an update here.

kodemint commented 11 years ago

thank you appreciate it and thanks for a wonderful book

BloodAxe commented 11 years ago

Hi,

I was not able to reproduce your issue using the code from this repository. The crash you describe can happen only in case when using BFBatcher with cross-checks enabled:

cv::BFMatcher(cv::NORM_HAMMING, true)

When a second argument is true this leads to cross-matching of query and train descriptors and only common matches are returned. In that knnMatch throws and assert because cross-matching cannot be done.

To use ratio test you'd like to either disable cross checks for BFMatcher, or switch to FlannBasedMatcher.

taitsnoopy commented 11 years ago

thank you ,I am a beginner ,Chinese students,I am interested in Opencv, my English is poor, and It's nice to communicate with you,It is my pleasure.

------------------ 原始邮件 ------------------ 发件人: "BloodAxe"notifications@github.com; 发送时间: 2013年3月11日(星期一) 下午2:31 收件人: "MasteringOpenCV/code"code@noreply.github.com;

主题: Re: [code] Markerless Example Issue (#5)

Hi,

I was not able to reproduce your issue using the code from this repository. The crash you describe can happen only in case when using BFBatcher with cross-checks enabled: cv::BFMatcher(cv::NORM_HAMMING, true)
When a second argument is true this leads to cross-matching of query and train descriptors and only common matches are returned. In that knnMatch throws and assert because cross-matching cannot be done.

To use ratio test you'd like to either disable cross checks for BFMatcher, or switch to FlannBasedMatcher.

— Reply to this email directly or view it on GitHub.

kodemint commented 11 years ago

thank you, got it :)