[HN Gopher] Converting a fisheye image into a panoramic, spheric...
       ___________________________________________________________________
        
       Converting a fisheye image into a panoramic, spherical or
       perspective projection
        
       Author : lnyan
       Score  : 136 points
       Date   : 2022-08-30 15:21 UTC (7 hours ago)
        
 (HTM) web link (paulbourke.net)
 (TXT) w3m dump (paulbourke.net)
        
       | abdullahkhalids wrote:
       | A few years ago, I was working for a startup in Pakistan which
       | was making small (5-10 person) portable planetariums. The idea
       | was to make astronomy education accessible to people from every
       | socio-economic background. Paul's work on this [1] was amazingly
       | helpful to get our projection done well, and put on successful
       | shows.
       | 
       | Also, shout out to the European Space Agency for releasing high
       | quality Planetarium documentaries under the CC license [2].
       | 
       | [1] http://paulbourke.net/dome/ [2]
       | https://www.eso.org/public/videos/archive/category/fulldome/...
        
       | JoeAltmaier wrote:
       | Transformations like these have wide applicability. Performing
       | optics in software so to speak, is more flexible and cheaper than
       | grinding lenses and building special cameras.
       | 
       | I was charged once, with transforming images for projection onto
       | a sphere through special lenses. I didn't know the lens
       | transform, the manufacturer kept that secret. I did know that the
       | intensity across the spherical surface was of uniform brightness
       | - the manufacturer boasted about this. With that bound I could
       | guess the transform, as each pixel of the source image would have
       | to illuminate an equal surface area of sphere once projected.
       | 
       | The manufacturer advertised a service to do this transform on
       | your image, but they wanted $10K for each run! Once I presented
       | my insights and a little math, they capitulated and did it at
       | cost. I never got to write my projection software in the end.
        
         | daniel_reetz wrote:
         | Sounds like a classic f-theta lens design. I'm sure you were
         | right about your transform, but it's also possible to equalize
         | illumination by other means, like apodizing filters.
        
         | myth2018 wrote:
         | Hey, that's a nice case study!
         | 
         | Could you give me some pointers on where I could start studying
         | about the math involved? Are those topics usually covered by
         | good books on computer graphics?
        
           | jeffreygoesto wrote:
           | I loved "Multiple View Geometry" by Hartley & Zisserman, but
           | also "Computer Vision" by Rick Szelisky is pretty
           | comprehensible and covers a lot of (pre-ML) stuff.
        
       | eldaisfish wrote:
       | The applications of this are interesting to say the least.
       | 
       | Something i am currently working on is using fisheye images of
       | the sky to predict cloud motion and to then estimate solar PV
       | power output in the short term i.e. one to five minutes out.
       | 
       | It sounds simple but it isn't yet even a child can observe cloud
       | motion and predict to some degree when the disc of the sun will
       | be obscured. Part of the inaccuracy is in the distortion caused
       | by the fisheye lens.
       | 
       | I would be interested in seeing how well this works for subjects
       | at infinity i.e. a fisheye lens pointed at the sky.
        
       | bwigfield wrote:
       | I just got stable-diffusion running and thought the title of this
       | would make an amusing prompt.
       | 
       | https://imgur.com/a/9TgW7qy
        
       | m463 wrote:
       | I bought some interesting photos from an artist who has done some
       | things like this, sort of in reverse:
       | 
       | https://kovasi.photo/
       | 
       | no connection to him other than as a customer.
       | 
       | By the way, printing on aluminum seems like a really nice way to
       | mount art on the wall
        
         | rk2 wrote:
         | Thanks for sharing ... his photography is surreal.
        
       | gus_massa wrote:
       | > _If "straight" lines are not straight that normally means the
       | fisheye center or radius are not specified correctly or the angle
       | is not defined correctly._
       | 
       | Is it possible to make the computer guess the correct value with
       | AI? I guess a method is to identify the artificial objects like
       | walls and doors, and assume they have straight lines. The nice
       | curved tops of the windows may be a problem. And probably there
       | must be a special case for circles like the clock.
        
         | hardnose wrote:
         | Calibrating using known objects should be possible. Most road
         | sign dimensions are specified in national laws, motor vehicle
         | headlights must be a specific distance apart, etc.
        
         | bramblerose wrote:
         | For a single image, you'd need some heuristics to distinguish
         | curved objects from camera distortions. If you have multiple
         | frames, you can SLAM your way out of the problem (essentially,
         | match features and solve a big fit which optimized feature
         | positions, camera positions and camera distortions). But by far
         | the easiest option is to just calibrate it, through
         | https://docs.opencv.org/4.x/dc/dbb/tutorial_py_calibration.h...
         | or one of the many alternative methods.
        
       | kazinator wrote:
       | What would be good to see on this page: an example of the
       | correction of unwanted fish-eye from a portrait photo of a face.
       | 
       | You could fix bad profile photos and such without the need to
       | upgrade to more expensive optics.
        
       | naillo wrote:
       | Just throw it into im2im stable diffusion (joking but it also
       | would likely literally work).
        
       | unterbahn wrote:
       | Wow, some of the distortions at the end of the article are really
       | mind bending...
       | 
       | For simpler fisheye and defisheye effects, I wrote this web based
       | tool a few years ago which some may find useful!
       | 
       | https://jywarren.github.io/fisheyegl/example/
        
       | maxshm wrote:
       | I have seen these pages few years ago. But I could not find
       | source code for these examples
        
         | makeworld wrote:
         | > The source code implementing the projections below is only
         | available on request for a small fee.
        
       | dcanelhas wrote:
       | Paul Bourke's webpage is a true internet gem for 3D reference
       | information. I don't know how many times I must've landed on his
       | page on 3D file format specifications.
        
         | mdswanson wrote:
         | Me too. An amazing resource.
        
       | atonalfreerider wrote:
       | Not sure if this was shared already, but here's an example of the
       | reflection of Buzz Aldrin's visor unwrapped into a 360 image:
       | https://www.reddit.com/r/space/comments/ooexmd/i_unwrapped_b...
        
       ___________________________________________________________________
       (page generated 2022-08-30 23:00 UTC)