Trapezoid image12/14/2023 So once I calibrated my camera, the ROI is still seen as a trapezoid but I would need to remap this ROI into a rectangle of the size of a frame (let's say 640x480).Īs I mentionned above, I don't think that using warpPerspective would be a good idea because it would also distort the coins shapes and "fake" their real positions. To get very good results, I need to calibrate my camera correctly because it has an awful barrel distortion and it distorts the region of interest and the coins shapes in consequence. The main parameters I would like to track are their sizes and their positions (it is not about object detection here). I would like to track coins inside a region of interest. I provided two drawings (with my best Paint.NET skills) to express my needs. )ĮDIT (17/11/17) (see Der Luftmensch comment below) : The purpose of this is to keep a certain aspect of "depth" and "position" from the image but processing a rectangular ROI (to find contours, get their real positions, etc. In fact, I would like to know if we could find a much better warp or process knowing the translations and rotations matrices from the camera calibration. I could use cv::getPerspectiveTransform and cv::warpPerspective to remap from trapezoid to rectangle but it would only stretch the image and this is not the result I would expect. Now, I would like to remap the trapezoid chessboard into a rectangular chessboard of frame size. The result of this operation is the following : To undistort the image, I am using cv::initUndistortRectifyMap with matrix R set as identity matrix, as well as cv::remap. Everything outside the green area will be considered "cropped". I managed to "draw" the radial distortions which gives me this :įrom what I understand, everything in the green area will be remapped into a rectangle with the size of my frame. I would like to remap a trapezoid ROI to a rectangular ROI after correcting a barrel distortion on a frame.įrom this frame (and many others), I calculated the camera matrix and the distortion coefficients using the function cv::calibrateCamera.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |