Correcting for a curved film plane?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
User avatar
anthony
Posts: 8884
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Correcting for a curved film plane?

Post by anthony »

whugemann wrote:As with other options in ImageMagick, I think that the distortion operations could need some grouping, either by naming them more consequently or by introducing another "name layer".
I came to a similar conclusion, but it is more complicated than that.

I don't want to be able to just map to and from a plane surface, but would also like to map between the various types of projections. For example between a stereographic sphere representation, and a orthographic sphere, plane, cylinder, mercator cylinder, etc etc etc.

As such the latest distortion was named cylinder2plane and plane2cylinder.

However to make this work I don't want to work out all the formulas between each projection.
As such I want to be smarter about this, and generate a mapping to/from each 'projection' to a common vector.

This may as you mentioned require a special 'distort' operator, that defines the two projections as separate entities.

For example
-distort-projection cylinder 'args' plane 'args'

the cylinder args may include the image width FOV, and center of distortion. The Plane args however may include center of distortion, and a distance from center, or more FOV angles. This is actually more like distorting the image coordinates twice.

ASIDE: derivatives in this style is NOT really needed as I would simply map other points in the neighbourhood to figure out the scaling vectors needed.

However this type of change I am loathed to even start, as it means a major re-organization of distort function into a more functional form. It is also something that is needed to allow 'any-quad to any-quad bilinear distortions' and then to the use of sub-area distortions such as triangular or grid mesh distortions. As such It needs to be done any way, just to allow distortions to become more useful. (the next level of abstraction)

This is a large task and is in someways a complete re-organization of the distortion module, the more I think about it, the more I am loathed to start. I am thinking this type of change may need to be part of IMv7 beta development. :-(


Note this does not mean I am unwilling to implement specific distortions like cylinder2plane, when I have complete details for the implementation. However I would like Wolfgang's input on what extra arguments should be added to the current cylinder2plane distortion (as it stands without further Y distortions), so I can finish this addition.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

User avatar
fmw42
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Correcting for a curved film plane?

Post by fmw42 »

For example
-distort-projection cylinder 'args' plane 'args'
This is kind of how I implemented the fisheye and defisheye in my scripts. I had fisheye distortion arguments and equations and perspective projection equations and arguments. Though the composite equations are worked out in the end.

User avatar
whugemann
Posts: 313
Joined: 2011-03-28T07:11:31-07:00
Authentication code: 8675308
Location: Münster, Germany 52°N,7.6°E

Re: Correcting for a curved film plane?

Post by whugemann »

anthony wrote: I don't want to be able to just map to and from a plane surface, but would also like to map between the various types of projections. For example between a stereographic sphere representation, and a orthographic sphere, plane, cylinder, mercator cylinder, etc etc etc.
It could be helpful having things thouroughly thought through and sorted by a mathematican beforehand, such that this functionality could be implemeted in a straightforward way, instead of creating -- possibly inconsistent -- single solutions to various problems.

I could try to make connections to mathematicans in my hometown Münster, which has big university offering mathematics / informatics as studies. (I have done so on other matters before.) We could try to delegate this to a diploma work. (This would be a common way to get things done for free here in Germany.) There is also a very positive attitude towards open source software on German universities, I guess. So I would expect such a project to succeed.
Wolfgang Hugemann

Locked