How can I keep horizontal and vertical FoV after undistortion

asked 2017-07-10 22:33:39 -0600

Imkoe gravatar image

Hi everyone,

I've used initUndistortRectifyMap() and Remap() to undistort image, but I have no idea how to crop the ROI I want. I want it keep the region of original horizontal and vertical FoV, I've try getOptimalNewCameraMatrix() with different alpha 0~1, just can not get it.

Any idea? Thanks!

edit retag flag offensive close merge delete

Comments

It seems you are asking to retain everything present in the original distorted image. Do that by setting alpha to 1. If you set alpha to 0, then all pixels in the undistorted image are valid (not black). You cannot have all of the original image data still present, all pixels valid, and undistorted, unless your original image had zero distortion.

Der Luftmensch gravatar imageDer Luftmensch ( 2017-07-11 06:21:22 -0600 )edit

Actually, I expect getting a output image cropped by valid pixels and it's inscribed rectangular of that undistorted region. Can I use getOptimalNewCameraMatrix() to get it?

Imkoe gravatar imageImkoe ( 2017-07-12 01:47:31 -0600 )edit

Setting alpha to 0 doesn't do that? What does "keeping original FOV" mean?

Der Luftmensch gravatar imageDer Luftmensch ( 2017-07-12 06:24:05 -0600 )edit