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
(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);
}
}
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.