WarpPerspective: add some mirrors of the input image (Bug #195)


Added by Damien Michel almost 15 years ago. Updated almost 15 years ago.


Status:Done Start date:
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:imgproc, video
Target version:-
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

the output image contains the warped input image and a lot of its mirrors when using linear interpolation. this problem does not appears with cubic interpolation.

sample code:

void bugFunction()
{
    CvMat *mat = cvCreateMat(3,3,CV_32FC1);

    //fill the homography matrix
    mat->data.flr0 = 1.04956;
    mat->data.flr1 = -0.75147;
    mat->data.flr2 = 299.216;
    mat->data.flr3 = 0.96346;
    mat->data.flr4 = 0.795854;
    mat->data.flr5 = 454.582;
    mat->data.flr6 = 0.000338058;
    mat->data.flr7 = -1.03816e-005;
    mat->data.flr8 =1;

    IplImage *imIn = cvCreateImage(cvSize(104,32),8,3);
    IplImage *imOut = cvCreateImage(cvSize(1024,768),8,3);

    //draw something onto the input image
    cvZero(imIn);
    cvDrawCircle(imIn,cvPoint(20,15),5,cvScalar(255,0,0),-1);

    //set the output image white
    cvSet(imOut,cvScalar(255,255,255));
    IplImage *imOut2 = cvCloneImage(imOut);

    //that's where the problem is
    cvWarpPerspective(imIn,imOut,mat,CV_INTER_LINEAR);//do some mirroring ?
    cvWarpPerspective(imIn,imOut2,mat,CV_INTER_CUBIC);//or CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS works also as expected

    //show the expected result
    cvNamedWindow("nobugwin");
    cvShowImage("nobugwin",imOut2);

    //show the non expected result
    cvNamedWindow("bugwin");
    cvShowImage("bugwin",imOut);

    cvWaitKey(100000);

}

running with windows vista 32 bits, visual studio 2008 sp1, IPP enabled.


Associated revisions

Revision 7e8fab07
Added by Andrey Kamaev over 12 years ago

Merge pull request #195 from vpisarev/inv3x3_fix

now invert 3x3 on "bad" matrices works well on Windows

History

Updated by anonymous - almost 15 years ago

the problem is likely fixed in r2975. see #245.
If the problem is still there, please, reopen the ticket.

  • Status changed from Open to Done
  • (deleted custom field) set to fixed

Also available in: Atom PDF