Unwinding an image on a spiral to make it long and flat Here's an odd intellectual puzzle.  Something I was daydreaming about on a train - but the maths are somewhat beyond me.  How would someone go about un-winding a spiral to produce a long flat image?  Like a rope on a spool, I'd want to uncoil the rope so that it lay long and flat.  The function would have to take in the image data (imageData) and the imageHeight (the height of the output strip - and hence also the thickness of the 'rope' on the spool).  Assumptions that could be made are that the input image is square, containing a circle whose top and bottom touch the top and bottom of the square - and left and right similarly.  The hub of circle would be in the absolute centre of the image.

(char*) unwindImage (char* imageData, int imageHeight)


Has anyone else puzzled over this?  And, if so, what solution did your come up with?
A quickly formulated method, read first one that popped in my brain (not best), could be. Find the closest points on a parametric spiral for each sample (read A Pixel Is Not A Little Square3). Then place the samples on a line by placing the pints in one axis by how far they are from your spiral line and the other by what the closest point is.



You can then use something like poisson disk sampling to reconstruct the image (maybe the didsk should be longer ovals the further away they are form the center line and less long as you progress further into the spiral).

Now that I think of the problem a bit more. A simpler approach could be to map the image on mesh, using UV mapping, then unwrap the mesh. A triangular mesh might exhibit some artifacts so using a B-spline interpolation could be better. Several image mesh algorithms exist and you even have these in Photoshop.



Image 2: A proof of concept of unwound spiral with the mesh method. Note i scaled the unwound spirals length to make it fit the site requirements better.

From initial test in my 3D app of choice seems that a dense enough triangular mesh works fine.