Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Error: fundamental matrix size overgrowing to 3x9

I am trying to find the fundamental matrix by manually identifying 7 corresponding points in two images and using the findFundamentalMatrix function. However on printing the matrix, it turn out to be 3x9. It seems to be a bug in my code but I cant seem to figure it out.

void mouseEventOne(int event, int x, int y, int, void* param){
 //select points in first image. store in one.
    }

void mouseEventTwo(int event, int x, int y, int, void* param) {
//select points in second image. store in two.
  set flag after 7 points
}

int main(int argc, char** argv) {

setMouseCallback("ImageOne", mouseEventOne, (void *) &ptOne);
setMouseCallback("ImageTwo", mouseEventTwo, (void *) &ptTwo);

for(;;) {

    if(one.size() == 7 && two.size() == 7 && flag){
        F = findFundamentalMat(one, two, CV_FM_7POINT);
        flag = false;
        cout<<F<<endl;
     }

    imshow("ImageOne", imageOne);
    imshow("ImageTwo", imageTwo);

    char s = (char)waitKey(30);
    switch(s){
        case 'q':
            return 0;
    }
}

Error: fundamental matrix size overgrowing to 3x9

I am trying to find the fundamental matrix by manually identifying 7 corresponding points in two images and using the findFundamentalMatrix function. However on printing the matrix, it turn turns out to be 3x9. It seems to be a bug in my code but I cant seem to figure it out.

void mouseEventOne(int event, int x, int y, int, void* param){
 //select points in first image. store in one.
    }

void mouseEventTwo(int event, int x, int y, int, void* param) {
//select points in second image. store in two.
  set flag after 7 points
}

int main(int argc, char** argv) {

setMouseCallback("ImageOne", mouseEventOne, (void *) &ptOne);
setMouseCallback("ImageTwo", mouseEventTwo, (void *) &ptTwo);

for(;;) {

    if(one.size() == 7 && two.size() == 7 && flag){
        F = findFundamentalMat(one, two, CV_FM_7POINT);
        flag = false;
        cout<<F<<endl;
     }

    imshow("ImageOne", imageOne);
    imshow("ImageTwo", imageTwo);

    char s = (char)waitKey(30);
    switch(s){
        case 'q':
            return 0;
    }
}

Error: fundamental matrix size overgrowing to 3x9

I am trying to find the fundamental matrix by manually identifying 7 corresponding points in two images and using the findFundamentalMatrix function. However on printing the matrix, it turns out to be 3x9. It seems to be a bug in my code but I cant seem to figure it out.

void mouseEventOne(int event, int x, int y, int, void* param){
 //select points in first image. store in one.
    }

void mouseEventTwo(int event, int x, int y, int, void* param) {
//select points in second image. store in two.
  set flag after 7 points
}

int main(int argc, char** argv) {

setMouseCallback("ImageOne", mouseEventOne, (void *) &ptOne);
setMouseCallback("ImageTwo", mouseEventTwo, (void *) &ptTwo);

for(;;) {

    if(one.size() == 7 && two.size() == 7 && flag){
        F = findFundamentalMat(one, two, CV_FM_7POINT);
        flag = false;
        cout<<F<<endl;
     }

    imshow("ImageOne", imageOne);
    imshow("ImageTwo", imageTwo);

    char s = (char)waitKey(30);
    switch(s){
        case 'q':
            return 0;
    }
}

Example of F that I get:

[-1.551177784481965e-05, 2.023178297273342e-05, 0.0005375762557272776; -1.135972383318399e-05, 3.375254552474079e-05, -0.003613682804598734; 0.008327856564262326, -0.01695104159607208, 1; 4.431840798641267e-07, -1.055708293644028e-06, -2.507080893426536e-05; 4.638855327440553e-06, 4.121047291061634e-06, -0.003793250696015148; -0.001440166620559569, -0.000516116119040233, 1; -2.981211382612034e-06, 3.513201920256684e-06, 9.568949524556974e-05; 1.205098346864506e-06, 1.048082229878526e-05, -0.003754710242238103; 0.0006563331661128546, -0.004043525616809762, 1]

click to hide/show revision 4
No.4 Revision

updated 2016-02-24 03:03:01 -0600

berak gravatar image

Error: fundamental matrix size overgrowing to 3x9

I am trying to find the fundamental matrix by manually identifying 7 corresponding points in two images and using the findFundamentalMatrix function. However on printing the matrix, it turns out to be 3x9. It seems to be a bug in my code but I cant seem to figure it out.

void mouseEventOne(int event, int x, int y, int, void* param){
 //select points in first image. store in one.
    }

void mouseEventTwo(int event, int x, int y, int, void* param) {
//select points in second image. store in two.
  set flag after 7 points
}

int main(int argc, char** argv) {

setMouseCallback("ImageOne", mouseEventOne, (void *) &ptOne);
setMouseCallback("ImageTwo", mouseEventTwo, (void *) &ptTwo);

for(;;) {

    if(one.size() == 7 && two.size() == 7 && flag){
        F = findFundamentalMat(one, two, CV_FM_7POINT);
        flag = false;
        cout<<F<<endl;
     }

    imshow("ImageOne", imageOne);
    imshow("ImageTwo", imageTwo);

    char s = (char)waitKey(30);
    switch(s){
        case 'q':
            return 0;
    }
}

Example of F that I get:

[-1.551177784481965e-05, 2.023178297273342e-05, 0.0005375762557272776;
 -1.135972383318399e-05, 3.375254552474079e-05, -0.003613682804598734;
 0.008327856564262326, -0.01695104159607208, 1;
 4.431840798641267e-07, -1.055708293644028e-06, -2.507080893426536e-05;
 4.638855327440553e-06, 4.121047291061634e-06, -0.003793250696015148;
 -0.001440166620559569, -0.000516116119040233, 1;
 -2.981211382612034e-06, 3.513201920256684e-06, 9.568949524556974e-05;
 1.205098346864506e-06, 1.048082229878526e-05, -0.003754710242238103;
 0.0006563331661128546, -0.004043525616809762, 1]

1]

Error: fundamental matrix size overgrowing to 3x9

I am trying to find the fundamental matrix by manually identifying 7 corresponding points in two images and using the findFundamentalMatrix function. However on printing the matrix, it turns out to be 3x9. It seems Seems to be a bug in my code but I cant seem to figure it out.

void mouseEventOne(int event, int x, int y, int, void* param){
 //select points in first image. store in one.
    }

void mouseEventTwo(int event, int x, int y, int, void* param) {
//select points in second image. store in two.
  set flag after 7 points
}

int main(int argc, char** argv) {

setMouseCallback("ImageOne", mouseEventOne, (void *) &ptOne);
setMouseCallback("ImageTwo", mouseEventTwo, (void *) &ptTwo);

for(;;) {

    if(one.size() == 7 && two.size() == 7 && flag){
        F = findFundamentalMat(one, two, CV_FM_7POINT);
        flag = false;
        cout<<F<<endl;
     }

    imshow("ImageOne", imageOne);
    imshow("ImageTwo", imageTwo);

    char s = (char)waitKey(30);
    switch(s){
        case 'q':
            return 0;
    }
}

Example of F that I get:

[-1.551177784481965e-05, 2.023178297273342e-05, 0.0005375762557272776;
 -1.135972383318399e-05, 3.375254552474079e-05, -0.003613682804598734;
 0.008327856564262326, -0.01695104159607208, 1;
 4.431840798641267e-07, -1.055708293644028e-06, -2.507080893426536e-05;
 4.638855327440553e-06, 4.121047291061634e-06, -0.003793250696015148;
 -0.001440166620559569, -0.000516116119040233, 1;
 -2.981211382612034e-06, 3.513201920256684e-06, 9.568949524556974e-05;
 1.205098346864506e-06, 1.048082229878526e-05, -0.003754710242238103;
 0.0006563331661128546, -0.004043525616809762, 1]