13 ms·
Wide angle lens distortion correction from lines
- jiveturkey 2y agoin-car racing cameras have very wide FOV. it's not uncommon to have such corrections applied to the video stream. i believe even the ubiquitous go-pro has such a filter.
- amelius 2y agoSeems to me that there is _more_ than one solution to this problem of generating a straight-line image out of a curvy-line image.
- doe_eyes 2y agoIt should be noted that this article talks about a pretty niche use case without really spelling it out. 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.
- Daub 2y ago> 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.
- deleted 2y ago[deleted]
- Anotheroneagain 2y agoYou can get a rectilinear lens instead, you know.
- xeonmc 2y agoand a spherical cow while you're at it.
- Anotheroneagain 2y agoThey're commonly available, not something exotic.
- TeMPOraL 2y agoAre they? How do you store spherical cows? Do you need to roll them out to pasture and then back into the barn, or do they roll on their own?
- Anotheroneagain 2y agoI mean you have to pick between fisheye and rectilinear lenses when you buy a wide angle lens. This is completely unnecessary, you only need to pick the lens that you actually want. Why does everybody doing as if I propose something outrageous or impossible?
- srean 2y agoI think the down-voting was harsh, it usually gets corrected in no time. 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.
- krisoft 2y ago> This is completely unnecessary, you only need to pick the lens that you actually want. 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.
- lionkor 2y agoThis site could really use a mobile version[0] [0]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_media_queries/Using_media_queries https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_media_q...
- dwighttk 2y agoReader mode works alright
- srean 2y agoA question for those who know optics: If the angle of incidence is past the critical angle of red do all of the visible spectrum get reflected without any chromatic effects ? 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 ?
- zokier 2y agoMirror objectives do exist for dslrs: https://advancedphototech.wordpress.com/lenses/mirror-mirror-a-guide-to-choosing-and-using-mirror-lenses/ https://advancedphototech.wordpress.com/lenses/mirror-mirror...
- srean 2y agoThanks for the link. Learned something new.
- wdfx 2y agoI have an old Nikon 500/8 ; gotta be honest, it's not very good.
- buildbot 2y agoSome are not very good, but others are. I currently have 4 different mirror lenses, two are not great but the other two are very good. One of which is an AF mirror lens! 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.
- wdfx 2y agoMine's from 1974 according to a serial number lookup, so who knows what it's been through in the last 50 years.
- 2y ago
- srean 2y agoHis dissertation looks very interesting https://hh409.user.srcf.net/index.html#PhDThesis https://hh409.user.srcf.net/index.html#PhDThesis
- PaulHoule 2y agoI have been wanting to do this for my https://www.kandaovr.com/qoocam-ego 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.
- michaelt 2y agoThe ideas listed in the document are about correcting distortion when the image has already been taken and you can't control the scene. 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_calibration.html https://docs.opencv.org/3.4/da/d13/tutorial_aruco_calibratio...
- qingcharles 2y agoYou can also use the patterns to generate DNG/RAW lens profiles which allow automatic lens correction in popular apps like Lightroom etc: Adobe Lens Profile Creator https://helpx.adobe.com/camera-raw/digital-negative.html https://helpx.adobe.com/camera-raw/digital-negative.html
- syntaxing 2y agoI swear I read something similar along the lines (pun intended) of this a couple years back but energy was not the Radon transformation, I forget what exactly it was. The hardest part of using this in production is that there is a lot of hand-tuned values, particularly during the edge detect portion which makes it difficult to scale. It's usually cheaper and easier to calibrate the camera at a mass scale in the factory using "old school methods.
- brcmthrowaway 2y agoyou mean checkerboards?
- dekhn 2y agohttps://docs.opencv.org/4.x/dc/dbb/tutorial_py_calibration.html https://docs.opencv.org/4.x/dc/dbb/tutorial_py_calibration.h... https://docs.opencv.org/4.x/d4/d94/tutorial_camera_calibration.html https://docs.opencv.org/4.x/d4/d94/tutorial_camera_calibrati...
- philsnow 2y agoThe last picture reminds me of what photos from my iPhone look like around the edges
- danilor 2y agoI have difficulty understanding what the transformed image is equivalent to. This makes it feel like the picture was taken at a difference distance and focal length, but[1] it would look different if that were the case because the perspective would be different. Does this have any "physical" interpretation that would make it easier for me to understand? Like, cropping an image is equivalent to changing the focal length; what would this be equivalent to? A type of rectilinear lens? [1] With the exception maybe for a single plane in focus?
- antman 2y agoThat is how the brain wants to see. When I got a new pair of glasses everything looked very curvy. After a week every line was straight again because the brain learned the new transformation
- hammock 2y agoI would draw an analogy to map projections. 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
- corysama 2y agoI’ve done some work on implementing this as a coder, not a mathematician. So, the following description is just how the process looks while you are implementing it :P 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.
- oasisbob 2y agoIt sounds like you know this already, but as any portrait photographer would note, changing the focal length is not equivalent to cropping. It's roughly equivalent, at best. ie, Telephoto lenses bring a different perspective which includes distance compression. It's very apparent when photographing human faces.
- brcmthrowaway 2y agoWhat is the dofference between this and camera calibration?
- emtel 2y agoThis is cool, but couldn't you generate the correction transformation simply from knowing the lens geometry? I assume this is what my phone is doing when I take wide-angle pictures (which don't have any visible distortion)
- harywilke 2y agoDepends on the reason why you are doing this transform. If it's just a visual correction filter, then that will work well enough. If you are trying to track camera movement on a series of images and match a 3D model to the footage, then it's not. You want to analyze the actual images the lens is producing and generate the distortion from that. Every lens is different. Different setups with the same lens may produce different distortions. A warm lens behaves different than a cool lens. Change the focus, and the distortion may change (lens breathing). Some lenses exhibit different distortions at different zoom levels.
- tadbit 2y agoYes. Most professional photo editing and management software has built-in functionality or an add-on for lens distortion correction. However it either requires having the original photo, or at least a non-cropped version with the exif data, or some knowledge of what body and lens and focal length was used. 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.