-
Notifications
You must be signed in to change notification settings - Fork 4
Lenses
Lens choice depends on camera. Check with camera manufacturer for the best lenses for your cameras.
Here are links to some frequently used lenses:
Fujinon c-mount high definition
Fujinon fixed focal length
Vignetting occurs when the lens size is smaller than the chip on the camera. See the example of vignetting below.
The photogrammetric relationships used to convert between image and world coordinates or into other image configurations like rectifications are based on the perfect pin-hole camera model. However, all camera-lens combinations have some amount of lens distortion that must be compensated for. This is done through lens calibration. Figure 1 shows an example of an image with extreme barrel distortion collected using a DJI Phantom 2 (Vision Plus), typical also of many GoPro images.
Figure 1. Example snap from a Phantom 2 with a great deal of barrel distortion. Note how curved the horizon is. Distortion scales with distance from the image center so the pier looks straighter than the horizon because it is mostly closer to the image center.
An advanced and free software package for dealing with lens distortion has been created by Jean-Yves Bouguet of Caltech and can be found by googling ‘Caltech lens distortion’ or using the link https://www.vision.caltech.edu/bouguetj/calib_doc/index.html.
The package has extensive documentation. However we will repeat the basis of the algorithm here.
The Caltech toolbox performs the calibration of a camera/lens system based on viewing a checkerboard target from a suite of viewing angles (for example, Figure 2). Corners across the entire target are automatically detected based on user-clicked locations of four outside corners, always in the same order from the top-left determined in the first image. Chose these enclosing corners such that full squares lie on the outside, not just small fractional parts of squares.
Figure 2. Checkerboard target for camera calibration. Roughly 20 images should be collected from a wide range of viewing angles. The bolts in the center helped keep the target flat and did not interfere with the analysis.
The algorithm solves for both the distortion coefficients of the lens and the intrinsic parameters of the lens/camera combination. The latter includes: the focal length of the lens, fc in their terms, expressed in pixel units and having components in the x and y direction of the image; the image skewness, alpha_c, which characterizes the degree to which the image x and y axes are not quite orthogonal; and the coordinates of the principal point of the sensor, the effective location of the pinhole in the pinhole camera model.
While we normally measure image coordinates in pixels from the top left image corner, [U, V], distortion is based on normalized measures equivalent to tangent of the angle away from the focal point, i.e. x = (U-U0)/fU and y = (V-V0)/fV, where [U0,V0] are the pixel coordinates of the image center and [fU, fV] are the two components of the focal length, in pixels. If we denote undistorted (pinhole) coordinates as Xu = [xu; yu] and the distorted coordinates as Xd = [xd; yd], and we measure the radial distance of any point from the principal point as r, where r2 = xu^2+yu^2, then the distorted coordinates could be found as
(1)
where
(2)
Equation (2) represents the tangential correction, usually a negligible correction. Equation (1) adds this to the radial correction, the main part of lens distortion.
The five coefficients in the kc vector are listed as returned by the Caltech toolbox. Note that the three radial coefficients are the first, second and fifth components of the distortion vector. Often the tangential and the sixth order radial term (kc(5)) are neglected.
Once the Caltech toolbox has been downloaded it is run in matlab by typing calib_gui. The steps generally follow the flow in the calibration toolbox window and are well described in the toolbox documentation. We have loaded a demo set of 30 images here (https://github.com/Coastal-Imaging-Research-Network/Forum-Wiki/blob/master/lensDistortionTestImages) that you can use for testing the method. These are for the 4000 x 2250 (9 MPixels) snapshot mode for a Phantom 3 Professional quadcopter. The target checkerboard has 6 cm squares (from the toolbox, printed locally and mounted on stiff cardboard). The center squares have a pattern of three circles that allow you to identify target orientation in snapshots. For comparison, I found the following answers:
Fc = [2309.1, 2306.8]; % U and V focal length, in pixels
Cc = [2006.0, 1156.7]; % principal point, in pixels
Alpha_c = 0; % skewness of axes – set to 0 by inputs
Kc = [-0.0204, 0.0124, 0.0075, 0.0012, 0] % last element forced to zero
CIRN
Wiki Home
CIRN Website
CIRN Research and Workshops
CIRN Monthly Webinars Existing Monitoring Stations
Sampling Goals
Pixel Resolution
Fixed Mounting Platforms
Temporary Towers
FOV and Lenses
Installation Design
Cookbook
Data Processing
Understanding Image Geometries
Photogrammetry
Intrinsic Calibration
GCPs
Extrinsic Calibration
File Naming
Directory Naming
Time Conventions
Common Variable Names
Parallel Processing Issues
Etc
GitHub Help
GitHub Cheat Sheet
CIRN repository help
GitHub Best Practices and GuidelinesGitHub Repository Structure
GitHub Workflow Overview
Using Teams & Roles
Issues
Testing & Review
Code Requirements
General Guidance
Admin
Software Development Life Cycle