Hello, everyone!
Has anybody ever managed to use PhotoScan distortion coefficients to undistort photos outside of PhotoScan in OpenCV? If so, I am really interested to know, how.
I have tried two approaches already with not very successful results.
First, I just used the coefficients with OpenCV undistort method. However, the results were weird - it's definitely that OpenCV uses a different approach to undistortion than PhotoScan.
I have found this paper
https://hal-amu.archives-ouvertes.fr/hal-01458821/document about transforming coefficients from PhotoScan to PhotoModeler and vice versa. Using similar idea, I tried to apply inverse distortion coefficients derived from the ones provided by PhotoScan, but the results were still far from what Export Undistort Photos produces. By the way, as I understand, PhotScan when undistorting images also scales them so that no blank pixels are present in the image, for the resolution of the image persists. Am I right?
OpenCV as I understand now uses coefficients exactly as is described in PhotoScan manual (e.g. here
http://www.agisoft.com/pdf/photoscan-pro_1_2_en.pdf, in Appendix C, chapter Frame Camera), i.e., we take color for pixel (x,y) as the color of pixel (x', y') from distorted image.