Wolfgang Hugemann on  wrote...
| > As you are using PTlens, how does it decide what 'barrel' correction
| > parameters it should use?
| > 
| > I am not certain if IM should do that itself or not.  Or prehaps as a
| > speciallised wrapper operators around distort.
| 
| Anthony,
| 
| I have been working on this issue (with Fred Weinhaus) for some time.
| The point is that the transformation is fairly simple, its more or less
| a re-calculation of the radius vector to the image centre by a
| polynominal approach.
| 
| The essential thing is the parameters used in this transformation and
| they are not that easy to fit. (You essentially have a photograph of an
| object with straight lines and tell you fit algorithm that these are
| straight.) Tom Niemann has built up a large (crypted) database of camara
| parameters that PTlens uses.
| 
| PTlens gets the make and model of the camera as well focal length from
| the EXIF data within the JPEG photograph. It then chooses the correct
| parameters for the transformation itself. (The parameters have been
| determined at several focal lengths for each camera model.)
| 
| This all is not that easy to implement in any other image manipulation
| program, even not in IM.
| 

The most difficult part to my thinking would be handling of the
database.  However if you just input the parameters as a -distort
than there should not be a problem.

However there will probably be two distort methods provided.

One using control points (usally with a least squares error fit).
EG: Move this point here.  this will then calculate the 'center' and
three other parameters needed.  The calculated paremeters should be
output, is -verbose is turned on.   This is more for general usage.

The other method is a 'Projection' version, where you give the
parameters directly.   This second will be more in line with what
'PTlens' does.

NOW questions...

  * Photos are not square,  how does this fit with PTlens?

  * PTlens values are normalized,  normal 'projection' parameters
    which IM uses directly are not.  Suggestions are welcome.
    Prehaps all the projections should use normalized values, and IM
    converts those to match the images involved.

  * How does a radial cubic distortion rate against a X,Y cubic
    distortion.  Couldn't a more normal
       x' = fx(x,y), y' = fy(x,y)
    be used instead of a
       r' = fr(r)
    type distortion?

  * How does PTlens determine the new color for pixels.  Does it use a
    area-resampling (filter) method, or just a simple interpolation
    method?


Basically I am plotting exactly what I should add to the -distort
function, during the next round of additions.


NOTE: at this time -distort does tend to produce a 'fuzzy' result due to
the use of a default gaussian-filter area-resampling method.  However by
setting "-filter point" you can turn off area-re-sampling, switch -distort
to using a simplier interpolation method.

I do plan to work on this aspect, to improve the current fuzziness,
which was I re-developed and fixed IM's resize -filter handling, near
the start of the year.  See IM resize, Filters for details.
   http://imagemagick.org/Usage/resize/#filter

However if you like a say in how IM is to proceed for Image Distortions,
NOW IS THE TIME.   Preferably in the IM Developers Forum.


  Anthony Thyssen ( System Programmer )    <[EMAIL PROTECTED]>
 -----------------------------------------------------------------------------
  Did you ever have the feeling that the world was an AC coffee pot
  and you were DC?                -- Dean Alan Foster, `` Glory Lane ''
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to