Agisoft Metashape
Agisoft Metashape => Camera Calibration => Topic started by: James on May 10, 2013, 05:23:48 PM
-
Ability to undistort single or multiple images based on calibration results. I realise this is available within photoscan once images are aligned, but sometimes i would like to be able to remove lens distortion for other purposes on individual images that can't be aligned in photoscan.
Thanks!
James
-
+1
Yes and aligning is time consuming too. Or the possibility to undistort images within Photoscan based on camera calibration results without prior aligning.
Thanks!
Karsten
-
Hello James and Karsten,
Thank you for the suggestion, we are considering this option.
Currently undistort procedure can be performed in PhotoScan Pro without prior alignment using Python scripts.
-
That's good to know, I am just dipping into the python script side of photoscan now.
Thanks
James
-
Hello once again,
I hope we'll be able to implement undistort functionality even for NA images in PhotoScan based on initial (or refined if available) calibration.
Currently it is possible to use the following script that saves the undistorted images to the user selected folder based on the user selected .xml file:
#Compatibility PhotoScan Pro 0.9.1
#No arguments required
import PhotoScan
doc = PhotoScan.app.document
chunk = doc.activeChunk
xml_path = PhotoScan.app.getOpenFileName("Please, select valid calibration xml file")
export_path = PhotoScan.app.getExistingDirectory("Please, specify the export folder")
PhotoScan.app.messageBox("Processing started.\nPress OK.")
calib = PhotoScan.Calibration()
calib.load(xml_path)
for photo in chunk.photos:
label = photo.label
image = photo.image()
uimage = image.undistort(calib, True, True)
PhotoScan.app.messageBox("Processing finished.\nPress OK.")
print("Script finished")
-
That's fantastic I shall give it a go, thanks!
-
I know this thread has been dead for a while, but I am also very interested in being able to undistort photos that I have not aligned. Has any progress been made towards this goal in the newer versions of Agisoft? I attempted to modified the above script to work with version 1.2.6 (see attached). It seems to be running with one catch: I get the message "please, select valid calibration xml file." What is this xml file? Where can I find it if I haven't aligned the image I want to "undistort." I am new to Agisoft and even newer to python, so any help would be much appreciated!
Thank you!
-
Hello ebf,
You should be able to undistort photos in the latest version of PhotoScan without the script, just basing on the Initial values of the Camera Calibration window.