Perspective Projection Distortion
Posted: 2012-09-09T05:14:48-07:00
I am buissy adding IM functions to my software and am working on Distort now, I am using the IM Core interface.
I tried putting random values in a Perspective Projection Distortion and sometimes I had a crash and sometimes no results at all.
I found that the crash was caused by using -ve values for Px or Py, you can see why if you inspect the equations given on the examples page, division by zero.
I also noticed that the 'shrinking' can only be done in one direction along each axis, so I have decided to make -ve values of Px,Py flip/flop the sourcxe image then flip/flop it back again when the distortion is done, and use abs(Px) and abs(Py) for the distort paramaters.
I noticed that it is easy to Distort an image away, are there any easy sanity checks on values to warn of this or when a distort is impossible?
Alan Hadley
I tried putting random values in a Perspective Projection Distortion and sometimes I had a crash and sometimes no results at all.
I found that the crash was caused by using -ve values for Px or Py, you can see why if you inspect the equations given on the examples page, division by zero.
I also noticed that the 'shrinking' can only be done in one direction along each axis, so I have decided to make -ve values of Px,Py flip/flop the sourcxe image then flip/flop it back again when the distortion is done, and use abs(Px) and abs(Py) for the distort paramaters.
I noticed that it is easy to Distort an image away, are there any easy sanity checks on values to warn of this or when a distort is impossible?
Alan Hadley