Forum

Author Topic: how to distort the images again  (Read 6452 times)

saduka

  • Newbie
  • *
  • Posts: 33
    • View Profile
how to distort the images again
« on: May 27, 2019, 03:30:22 PM »
Halo, I generated the undistorted images in Metashape because I wanted to apply some functions on these undistorted images.
Code: [Select]
for camera in cameras:
            ur=parent_path+camera.label+".tif"
            ref=camera.photo.image()
            refUndis=ref.undistort(camera.sensor.calibration,True,True)
            refUndis.save(ur)

But then how can I distort the fixed images again back? Becase I need to generate orthomosaic from them.

James

  • Hero Member
  • *****
  • Posts: 769
    • View Profile
Re: how to distort the images again
« Reply #1 on: May 27, 2019, 10:45:55 PM »
I think an equivalent and simpler method would be to set all distortion parameters fixed to 0 (except focal length) and just use the undistorted images as they are.

saduka

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: how to distort the images again
« Reply #2 on: May 28, 2019, 08:58:42 AM »
I think an equivalent and simpler method would be to set all distortion parameters fixed to 0 (except focal length) and just use the undistorted images as they are.
Hey Jams. The problem is that my correction model assumes that the light beam from target through lens travels in straight line.

James

  • Hero Member
  • *****
  • Posts: 769
    • View Profile
Re: how to distort the images again
« Reply #3 on: May 28, 2019, 12:48:37 PM »
The problem is that my correction model assumes that the light beam from target through lens travels in straight line.

that is what is achieved by setting the parameters all to zero, as i understand it.

i only mean to do this after you re-import the undistorted images, in case you can't find any way to re-apply the original distortion.
« Last Edit: May 28, 2019, 12:50:26 PM by James »

saduka

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: how to distort the images again
« Reply #4 on: June 07, 2019, 12:53:07 PM »
The problem is that my correction model assumes that the light beam from target through lens travels in straight line.

that is what is achieved by setting the parameters all to zero, as i understand it.

i only mean to do this after you re-import the undistorted images, in case you can't find any way to re-apply the original distortion.


Thanks a lot James, a cool trick.