2015-02-17 80 views
0

我試圖運行的代碼序列:核心轉儲 - 32S,32F,8U

DescriptorMatcher * matcher = new BFMatcher(NORM_HAMMING); 
vector<DMatch> matches; 
matcher -> match(descriptorsImage1, descriptorsImage2, matches); 

它是造成此錯誤:

OpenCV Error: Assertion failed ((type == CV_8U && dtype == CV_32S) || dtype == CV_32F) in batchDistance, file /home/.../OpenCV/opencv-2.4.10/modules/core/src/stat.cpp, line 2480 
terminate called after throwing an instance of 'cv::Exception' 
    what(): /home/.../OpenCV/opencv-2.4.10/modules/core/src/stat.cpp:2480: error: (-215) (type == CV_8U && dtype == CV_32S) || dtype == CV_32F in function batchDistance 

Aborted (core dumped) 

有沒有人見過這個?

+0

這似乎相關:http://answers.opencv.org/question/10046/feature-2d-feature-matching-fails-with-assert-statcpp/?answer=10048#post-id-10048。 – 2015-02-18 00:05:02

回答

0

正如在評論中提到的那樣,您可能會誤用具有適當標準類型的描述符類型。

至於OpenCV中的文件說:

BFMatcher::BFMatcher(int normType=NORM_L2, bool crossCheck=false)

normType - 一個NORM_L1NORM_L2NORM_HAMMINGNORM_HAMMING2L1L2規範是優選的選擇爲SIFTSURF描述符,NORM_HAMMING應與ORBBRIEF使用,NORM_HAMMING2應與ORB使用時WTA_K==34(見ORB::ORB構造的描述)。