Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I did not understand what you mean ..... but this helps you ?

    s_p[0] = Point(0,0);
    s_p[1] = Point(0,640);
    s_p[2] = Point(480,0);
    s_p[3] = Point(480,640);         

if (!ex_ctrl_4)
         {
             d_p[0] = Point(0,0);
             d_p[1] = Point(70,640);
             d_p[2] = Point(480,0);
             d_p[3] = Point(480,620);
         }
         else
         {
             d_p[0] = Point(0,0);
             d_p[1] = Point(0,640);
             d_p[2] = Point(480,0);
             d_p[3] = Point(480,640);
         }


    /*1st-------2nd
     |         |
     |         |
     |         |
    3rd-------4th*/


    transform_matrix = cv::getPerspectiveTransform(s_p, d_p);
    cv::warpPerspective(dest_image01, dest_image1, transform_matrix, cv::Size(640, 480));