Opencv: distort back

后端 未结 7 679
清歌不尽
清歌不尽 2021-02-02 02:53

I have the cameraMatrix and the distCoeff needed to undistort an image or a vector of points. Now I\'d like to distort them back.

Is it poss

7条回答
  •  隐瞒了意图╮
    2021-02-02 03:18

    You can easily distort back your points using ProjectPoints.

    cv::Mat rVec(3, 1, cv::DataType::type); // Rotation vector
    rVec.at(0) = 0;
    rVec.at(1) = 0;
    rVec.at(2) =0;
    cv::Mat tVec(3, 1, cv::DataType::type); // Translation vector
    tVec.at(0) =0;
    tVec.at(1) = 0;
    tVec.at(2) = 0;
    
    cv::projectPoints(points,rVec,tVec, cameraMatrix, distCoeffs,result);
    

    PS: in the opencv 3 they added a function for distort.

提交回复
热议问题