Ask Your Question

neo's profile - activity

2013-04-16 10:40:17 -0500 commented question matching causes assertion error (Features2d + Homography example) Android jni

Hi, Same problem here.

void FindPatent(Mat* imgFrame, Mat* imgPatent)
{
    vector<KeyPoint> keyPoints_1, keyPoints_2;
    Mat descriptors_1, descriptors_2;
    ORB orb;

    orb(*imgPatent, Mat(), keyPoints_1, descriptors_1);
    orb(*imgFrame, Mat(), keyPoints_2, descriptors_2);

    BFMatcher matcher(2);
    vector<DMatch> matches;
    matcher.match(descriptors_1, descriptors_2, matches);
...
...

I got same error when matcher.match(...)

Thanks, Neo

2013-04-16 10:35:17 -0500 answered a question matching causes assertion error (Features2d + Homography example) Android jni

Hi,
Same problem here.

void FindPatent(Mat* imgFrame, Mat* imgPatent)
{
    vector<KeyPoint> keyPoints_1, keyPoints_2;
    Mat descriptors_1, descriptors_2;
    ORB orb;
    CvMat* Hom;             // for cvFindHomography
    CvMat* obj_corners;     // patent corners
    CvMat* scene_corners;   // transform corners from patent by Hom


    Hom = cvCreateMat(3,3,CV_32FC1);
    obj_corners = cvCreateMat(1, 4, CV_32FC2);
    scene_corners = cvCreateMat(1, 4, CV_32FC2);

    float data[8] = {0, 0, imgPatent->cols, 0, imgPatent->cols, imgPatent->rows, 0, imgPatent->rows};
    for (int i =0; i < 8; i++)
    {
        obj_corners->data.fl[i] = data[i];
    }

    orb(*imgPatent, Mat(), keyPoints_1, descriptors_1);
    orb(*imgFrame, Mat(), keyPoints_2, descriptors_2);

    LOGD("%d, %d, %d\n", imgFrame->cols, imgFrame->rows, imgFrame->channels());
    LOGD("%d, %d, %d\n", imgPatent->cols, imgPatent->rows, imgPatent->channels());

    BFMatcher matcher(2);
    vector<DMatch> matches;
    matcher.match(descriptors_1, descriptors_2, matches);
...
...

I got same error when matcher.match(...)

Thanks,
Neo