Wide angle lens distortion correction from lines
hh409.user.srcf.net
hh409.user.srcf.net
https://www.kandaovr.com/qoocam-ego
after reading Lenny Lipton's books about stereo cinematography I've been debugging my stereograms and one thing I know is that the lenses on that thing have a little bit of pincushion distortion which means stereo pairs that are supposed to be perfectly aligned vertically aren't quite.
I know DxO makes distortion correct filters for lens/camera pairs and I was sure I could make one by taking pictures of a grid but this gives a definite path to doing it.
As you've got the camera in hand, you've got an even simpler option available: You can print a special pattern called a 'ChArUco board' [1] take pictures of it from a few different angles, then you can calculate the camera "intrinsics" (field of view, lens distortion parameters) and "extrinsics" (relative positions of your two cameras) based on those images.
[1] https://docs.opencv.org/3.4/da/d13/tutorial_aruco_calibratio...
Adobe Lens Profile Creator
[1] With the exception maybe for a single plane in focus?
ie, Telephoto lenses bring a different perspective which includes distance compression. It's very apparent when photographing human faces.
What changing the focal length does do is (e.g.) make you stand further back, and that changes the perspective, causing distance compression, etc.
https://rmit.instructure.com/courses/87565/pages/perspective...
As a non-photographer with zero knowledge about photography, the fixed image, with straight lines, feels much more natural to me.
I'd say it reminds me of 3D games like, say, 3D game simulators?
Are 3D games not reproducing lens deformation more or less correct from a "physics" point of view? I happen to be on vacation atm in an apartment on the beach on the ninth floor with a clear view: what I see is much closer to the "corrected" (not my word but TFA's author's one) version than to the other one.
The iPhone's ultrawide lens is a good example of a rectilinear projection with lots of example photos available.
It can produce weird feeling images with stuff at the edges looking stretched out, and parallel lines being at significant angles to each other, but it does not make straight lines curved like the effect that the author is removing.
Example ultrawide photo with straight lines from reddit https://www.reddit.com/r/iPhoneography/comments/ena7s5/bosto...
Or, take an image of a soccer ball (the kind with pentagons and hexagons), you can see all of one hemisphere. But it’s a “fisheye” view. If you take the half soccer ball and cut up the shapes and rearrange them on a flat surface, you are adjusting the projection
Take the original curved image and put it on a super stretchy rubber sheet. Pull all four corners out diagonally until the curves look straight. You have to pull really hard and the corners will be stretched out into thin spikes.
But, no one wants to see an image that’s 80% long, thin spikes with lots of empty space between them. So, go to the center and crop down to the biggest rectangle you can that doesn’t have empty space around the edges.
This utility doesn't require the original non-cropped area nor any other information about the picture that was taken. You could scrape a bunch of pictures from Instagram or Facebook and batch process away.
Are there cameras that have a sensors laid out on a curve matching the expected surface on which the image is in focus ?
I wonder why there are no cameras (apart from astronomical telescopes) that use reflection only for imaging. Such a camera would be too bulky to be practical ?
One thing is that they are extremely sensitive to shocks causing mirror misalignment - so if your lens has ever been dropped, it’s probably lower performance than before due to the mirrors being out of wack.
Not a sensor, but some disposable film cameras have a curved film holder to compensate for low quality optics. Some panoramic film cameras do the same.
https://www.reddit.com/r/Optics/comments/oimvt0/curved_camer...
https://www.digitalcameraworld.com/news/sonys-new-curved-ima...
It appears that curved sensors maybe exist somewhere in a lab, and have been slightly commericialized, but I didn't see any 'buy now' buttons when I looked.
I didn't dive too deep into it because It's not like I'm going to be changing the sensor in my design at this stage of the game, but it was an idea that a friend suggested when I talked about the limitations of the mirror based system that we're using.
https://techxplore.com/news/2024-07-insect-autonomous-strate...
This link popped up on hackernews a few days ago and I noticed that they were using a mirror in their optical system as well. I haven't had a chance to read beyond that promotional article above so I don't know how they're overcoming the depth of field limitations with this kind of optical set up.
Today now that is no problem. A few years ago I saw this
https://owllabs.com/products/meeting-owl-3
at work, the fisheye lens on it is more compact than what I had in mind and it has enough pixels to pick out individuals speaking in a conference room.
[0]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_media_q...
Camera optics are generally designed not to exhibit this kind of distortion. As other commenters note, wide-angle lenses are ground to provide rectilinear projection where horizontal and vertical lines are straight. Further, if a particular lens does exhibit distortion, the usual solution is to measure the effect and construct a reverse mapping that can be applied in software.
There are relatively few situations where you have a distorted image taken with unknown lens, but where you have a regular grid of horizontal and vertical lines for the algorithm to rely on.
In visual effects distortion correction is required is required before effective camera tracking can take place. It is also required for a matte to fit the footage. In such situations, it is not unknown to be given 'mystery meat' footage which requires distortion correction. You would be surprised how many directors and DOPs take VFX voodoo for granted and would rather save five minutes on set at the cost of two days in post production.
Why does everybody doing as if I propose something outrageous or impossible?
That said people here are interested in the different ways of solving a problem, if not for anything else but to tickle one intellectually. So yes rectilinear lenses exist, but that does not mean that computational methods are uninteresting or useless. For one thing, one need not purchase different kinds of lenses.
It sounds like you are thinking only in the context of photography. In robotics and machine vision applications you often choose the fisheye lens because they are cheaper than the rectilinear lenses with the same FOV. (if a rectilinear lens is even available in the form factor and FOV you need.)
So what people do in those situations is that they get a crappier lens and they calibrate it so the algorithms know how much to correct for its crappyness. That is where this kind of calibration really shines.
It’s unreasonable to expect never to need any correction, and it’s actually a really interesting, non-trivial problem, to tinker with.
Sometimes you can't get a rectilinear lens, though: If I want to shoot wide angle on my phone, curvilinear will have to do.
Sometimes you don't even have a lens, you've just got a photo, and that photo is curvilinear.
Novel ways to adjust for distortion are always nice to have in the toolkit.
Sometimes, you want to have a system that's able to self-correct after you slap a random lens on it as it's working. Or, you're looking through a translucent material, which acts as an ad-hoc lens with unknown parameters, and you want to compensate on the go.
Point being, methods of on-line calibration without use of special calibration setup (like ArUco boards mentioned elsewhere) have a wide range of use cases and are always welcome.
The two I know of with the least distortion are actually primes from the 1980s. Nikon began allowing a small amount of distortion in their new prime designs circa 2010, choosing to correct it with an in-camera profile.
It's not as bad as it sounds. Getting rid of that last bit of distortion may require relatively major tradeoffs in other areas like brightness.
I do actually think the OEM design approach is better overall. It's a lot easier to near-perfectly correct high amounts of low order distortion than it is to make lines with a slight amount of 6th? 8th? order distortion actually straight. Even if the resulting raw image of the OEM lens looks more like a fisheye than a rectilinear lens.
Great lens - and a huge front element…
I used that in the 90’ies to make QTVR with a (really expensive) Kodak DCS 460 - 6MP on a DX sized CCD no display and the large 340MB PCMCIA disk ;-)
DSLR/mirrorless users still use lens correction (either in-camera or as part of the post-processing pipeline) because even a big, heavy, expensive pro-quality lens is still imperfect in ways that are relatively easy to compensate for in software.
https://www.canon-europe.com/pro/infobank/in-camera-lens-cor...
See https://m.youtube.com/watch?v=6toiNmZ_e4I for the difference.