Matcher Assertions failed error opencv Android

后端 未结 2 695
梦毁少年i
梦毁少年i 2020-12-31 04:02

I\'m writing code to find similar object from drawable in camerapreview. I am using the newest Opencv 2.4.4.

Below are my functions and an output from logcat. What a

相关标签:
2条回答
  • 2020-12-31 04:45

    (Open Cv Mat doestn't have type method) Try this method..

    public  void match(Mat object_desc, Mat scene_desc, MatOfDMatch matches)
    {
        if(object_desc.type() == scene_desc.type() &&
                object_desc.cols() == scene_desc.cols()) {            
            match_1(nativeObj, object_desc.nativeObj, scene_desc.nativeObj, matches.nativeObj);
        }
    
    }
    
    0 讨论(0)
  • 2020-12-31 04:54

    Just for the sake of closing this question:

    According to your comment, the following line was causing the problem:

    dm.match(object_desc, scene_desc, matches);
    

    I advised you to manually verify that:

    (object_desc.type == scene_desc.type &&
     object_desc.cols == object_scene.cols)
    

    The problem was eventually that for the first frame, object_desc.cols() != scene_desc.cols(). A simple if was enough to solve the problem.

    0 讨论(0)
提交回复
热议问题