hackaday.io Open Graph Preview


https://hackaday.io/project/12384-autofan-automated-control-of-air-flow/log/41862-correcting-for-lens-distortions

Google Snippet

Correcting for Lens Distortions | Details | Hackaday.io
https://hackaday.io
<p>Certain types of camera lenses (such as in the webcam used in this project) introduce <em><a href="https://en.wikipedia.org/wiki/Distortion_(optics)">d</a><a href="https://en.wik

Twitter Card

Correcting for Lens Distortions | Details | Hackaday.io <p>Certain types of camera lenses (such as in the webcam used in this project) introduce <em><a href="https://en.wikipedia.org/wiki/Distortion_(optics)">d</a><a href="https://en.wikipedia.org/wiki/Distortion_(optics)">istortion</a></em> characteristics to the images such that objects along the optical axis of the lens occupy disproportionately large areas of the image. Objects near the periphery occupy a smaller area of the image. The following figure illustrates this effect: </p><p><img style="width: 306px; height: 305px;" height="305" width="306" data-src="https://cdn.hackaday.io/images/6703811468324904457.jpg" class="lazy"> </p><p>This so-called <em>barrel distortion</em> results in the fact that the representation of distance relations in the real world is not the same as in the camera image -- i.e. distance relations in the camera image are <em>non-linear</em>. </p><p>However, in this project, <em>linear</em> distance relations are required to estimate the servo motor angles from the camera images. Hence, lens distortions have to be corrected by remapping the camera images to a <em> <a href="https://en.wikipedia.org/wiki/Rectilinear_lens">rectilinear representation</a></em>. This procedure is also called <em>unwarping</em>. To correct for lens distortions in the camera images I made use of <em></em><a href="http://opencv.org/">OpenCV&apos;s</a><em></em> camera calibration tool. </p><h1>Estimation of lens parameters using OpenCV</h1><p>For unwarping images OpenCV takes the <em><a href="https://en.wikipedia.org/wiki/Distortion_(optics)#Software_correction">radial </a></em><a href="https://en.wikipedia.org/wiki/Distortion_(optics)#Software_correction">and the</a><em><a href="https://en.wikipedia.org/wiki/Distortion_(optics)#Software_correction"> tangential distortion factors</a></em> into account. <em>Radial</em> distortion is pretty much what leads to the <em>barrel</em> or <em>fisheye</em> effect described above. Whereas, <em>tangential</em> distortion describes the hackaday.io

Facebook

hackaday.io
Correcting for Lens Distortions | Details | Hackaday.io
<p>Certain types of camera lenses (such as in the webcam used in this project) introduce <em><a href="https://en.wikipedia.org/wiki/Distortion_(optics)">d</a><a href="https://en.wikipedia.org/wiki/Distortion_(optics)">istortion</a></em> characteristics to the images such that objects along the optical axis of the lens occupy disproportionately large areas of the image. Objects near the periphery occupy a smaller area of the image. The following figure illustrates this effect: </p><p><img style="width: 306px; height: 305px;" height="305" width="306" data-src="https://cdn.hackaday.io/images/6703811468324904457.jpg" class="lazy"> </p><p>This so-called <em>barrel distortion</em> results in the fact that the representation of distance relations in the real world is not the same as in the camera image -- i.e. distance relations in the camera image are <em>non-linear</em>. </p><p>However, in this project, <em>linear</em> distance relations are required to estimate the servo motor angles from the camera images. Hence, lens distortions have to be corrected by remapping the camera images to a <em> <a href="https://en.wikipedia.org/wiki/Rectilinear_lens">rectilinear representation</a></em>. This procedure is also called <em>unwarping</em>. To correct for lens distortions in the camera images I made use of <em></em><a href="http://opencv.org/">OpenCV&apos;s</a><em></em> camera calibration tool. </p><h1>Estimation of lens parameters using OpenCV</h1><p>For unwarping images OpenCV takes the <em><a href="https://en.wikipedia.org/wiki/Distortion_(optics)#Software_correction">radial </a></em><a href="https://en.wikipedia.org/wiki/Distortion_(optics)#Software_correction">and the</a><em><a href="https://en.wikipedia.org/wiki/Distortion_(optics)#Software_correction"> tangential distortion factors</a></em> into account. <em>Radial</em> distortion is pretty much what leads to the <em>barrel</em> or <em>fisheye</em> effect described above. Whereas, <em>tangential</em> distortion describes the
TOP