On Thu, 30 Apr 2009 19:49:37 -0400
Cristy <[email protected]> wrote:

| | Subject: bug in depolar options?
| | From: Jan Martin <[email protected]>
| | Reply-To: Jan Martin <[email protected]>
| | X-Mailer: PHP/5.1.6
| | Origin: 92.226.137.165
| | Status: R
| |
| | Hi all,
| |
| | I am trying to put
| | convert +distort depolar options to work:
| | Radius_Max Radius_Min Center_X,Center_Y Start_Angle,End_Angle
| |
| | However it seems that
| | Radius_Max Radius_Min
| | do not do what they should.
| |
| | Example Image:
| | 
http://www.fmwconcepts.com/imagemagick/fisheye2pano/images/testimage2_diagram.jpg
| | In this special case the center is exactly half the width, because this
| | particular image is made to be this way.
| |
| | So with
| | width=425 and hight=425
| | Radius_Max is the radius of the whole doughnut: 212.5
| | Radius_Min is the radius of the "hole in the doughnut": (measured using
| | GIMP) 35
| |
| | Center_X 212.5
| | Center_Y 212.5
| |
| | Start_Angle -180
| | End_Angle +180
| |
| | I would expect this to be the right options:
| |
| | '212.5,35 212.5,212.5 -180+180'
| |
| | convert +distort depolar '212.5,35 212.5,212.5 -180,+180' -flip -roll +80+0
| | /home/me/testimage2_diagram.jpg  /home/me/testimage2_diagram_options.jpg
| |
| Hmmm yes that does not look right.  and I'll look into the problem.
|
| however I would suggect you read the image BEFORE applying operators to it!
| otherwise Im may not order the image operations correctly.
|
|    convert testimage2_diagram.jpg \
|        +distort depolar '212.5,35 212.5,212.5 -180,+180' -flip -roll +80+0 \
|        testimage2_diagram_options.jpg
|
| In this case it looks as if the 'legacy' handler did order the
| arguments correctly.
|
| It looks as if the 'minimum radius' is being treated as a negative.
| for some reason.
|
| I'll look into the problem.
|

Okay.  I have updated the source (and the ChangeLog)

The Rmin is now working correcty.

  convert testimage2_diagram.jpg +distort depolar '212.5,35' -rotate 180 show:

PS: the -rotate 180 replaces the flip.


Also I have allowed you to specify just an Angle_from with Angle_to
defaulting to 360 degress more than the from angle.

This could for example have been used to replace the 'roll' in the above
command.

Angles are however currently going from 0 degrees straight down, and
circling the circle in an anti-clockwise, direction.  The default
starting angle is -180 degrees (straight up), making the defult finish
angle +180 degrees.

QUESTION:   Are prople happy with 0 angle being straight down,
and the default 'cut point' for the ring being straight up?

Or would they prefer a different set of angles?

Now is the time to speak.


I have verified that slicing just an small angular portion from the ring
works.

And that using the same options for a second polar distort will result
in the original image for the section that was extracted.  Though with a
lot of 'blank' space for the parts of the ring that was not present
(Unlike Arc)  In the future I may look at minimising this size.

For example..

  convert testimage2_diagram.jpg  -virtual-pixel black \
          -write show: \
          +distort depolar '212,35 212.5,212.5 135,225' \
          -write show: \
          +distort  polar  '212,35 212.5,212.5 135,225' \
          show:

Will display the original image, then the depolar extraction on just the
top uppermost 90 degree arc, and finally that 90 degree arc polar
distorted back to its original position.




WARNING:  this test image is NOT perfectly centered!

It is also NOT a polar distortion, but a spherical image.

The depolar image would need some serious cylindrical de-distorting to
remove the vertical compression at the top and bottom of the image, so as 
to have it look reasonally 'normal'.



  Anthony Thyssen ( System Programmer )    <[email protected]>
 -----------------------------------------------------------------------------
     Life (n).      A sexually transmitted disease which afflicts some
                people more severly than others.
 -----------------------------------------------------------------------------
     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