calc_diameter {rcaiman} | R Documentation |
Calculate diameter
Description
Calculate the diameter in pixels of a 180º fisheye image.
Usage
calc_diameter(lens_coef, radius, angle)
Arguments
lens_coef |
Numeric vector. Polynomial coefficients of the lens
projection function. See |
radius |
Numeric vector. Distance in pixels from the zenith. |
angle |
Numeric vector. Zenith angle in degrees. |
Details
This function helps handle devices with a field of view different than 180º.
Given a lens projection function and data points consisting of radii
(pixels) and their correspondent zenith angle (\theta
), it returns the
horizon radius (i.e., the radius for \theta
equal to 90º).
When working with non-circular hemispherical photography, this function will help to find the diameter that a circular image would have if the equipment would record the whole hemisphere.
The required data (radius-angle data pairs) can be obtained following the instructions given in the user manual of Hemisfer software. The following is a slightly simpler alternative:
Find a vertical wall and a leveled floor, both well-constructed.
Draw a triangle of
5 \times 4 \times 3
meters on the floor, with the 4-meter side over the wall.Locate the camera over the vertex that is 3 meters away from the wall. Place it at a given height above the floor, 1.3 meters for instance.
Make a mark on the wall at the chosen height over the wall-vertex nearest to the camera-vertex. Make four more marks with one meter of spacing and following a horizontal line. This will create marks for 0º, 18º, 34º, 45º, and 54º
\theta
.Before taking the photograph, do not forget to align the zenith coordinates with the 0º
\theta
mark and check if the optical axis is leveled.
The line selection tool of ImageJ can be used to measure the distance in pixels between points on the image. Draw a line, and use the dropdown menu Analyze>Measure to obtain its length.
For obtaining the projection of a new lens, refer to
calibrate_lens()
.
Value
Numeric vector of length one. Diameter adjusted to a whole number
(see zenith_image()
for details about that constrain).
See Also
Other Lens Functions:
azimuth_image()
,
calc_relative_radius()
,
calc_zenith_colrow()
,
calibrate_lens()
,
crosscalibrate_lens()
,
expand_noncircular()
,
extract_radiometry()
,
fisheye_to_equidistant()
,
fisheye_to_pano()
,
lens()
,
test_lens_coef()
,
zenith_image()
Examples
# Nikon D50 and Fisheye Nikkor 10.5mm lens
calc_diameter(lens("Nikkor_10.5mm"), 1202, 54)