Common Lisp Package: CL-PHOTO

README:

FUNCTION

Public

AOV (FOCAL-LENGTH FRAME-WIDTH FRAME-HEIGHT &KEY (PROJECTION RECTILINEAR) (MAGNIFICATION 0))

Returns the angle of field of view for a focal length and frame size. Default is infinity (magnification 0)

AOV-FORMAT (FOCAL-LENGTH FORMAT &KEY (PROJECTION RECTILINEAR))

Returns the angle of field of view for a focal length and frame size at infinity

BELLOWS-FACTOR (FOCAL-LENGTH OBJECT-DISTANCE)

Returns the bellows factor, the ratio of effective aperature to actual aperture.

CLOSE-UP (&KEY FOCAL-LENGTH OBJECT-DISTANCE IMAGE-DISTANCE MAGNIFICATION (UNITS FEET))

Computes the parameters for focusing closer than infinity. Requires two, and only two, of the input parameters. Returns: focal-length object-distance image-distance magnification bellows-factor.

COC (IMAGER-SIZE &KEY (LPM 5) (MINIMUM-DISTANCE 250) (VIEWING-DISTANCE 250) (PRINT-SIZE (OUTPUT-DIMENSIONS 8X10IN)))

Returns circle of confusion in mm and print magnification for a format. Default resolving power is 5 lpm at 25cm.

COC-AIRY (F-STOP &OPTIONAL (WAVELENGTH 5.12e-4))

Return the circle of confusion based on the airy disk.

COC-FORMAT (FORMAT &KEY (LPM 5) (MINIMUM-DISTANCE 250) (VIEWING-DISTANCE 250) (PRINT-SIZE (OUTPUT-DIMENSIONS 8X10IN)))

Returns circle of confusion in mm and print magnification for a format. Default resolving power is 5 lpm at 25cm.

COC-PIXELS (IMAGER PIXELS)

Returns lpm and circle of confusion based on pixel size.

COC-PIXELS-FORMAT (FORMAT)

Returns circle of confusion based on pixel size.

DOF (FOCAL-LENGTH F-STOP DISTANCE COC &KEY (UNITS MM) (PUPIL-FACTOR 1))

Returns the Depth of Field. Input: FOCAL-LENGTH, F-STOP, DISTANCE, CIRCLE-OF-CONFUSION. Output: NEAR-POINT, FAR-POINT, TOTAL-DOF, MAGNIFICATION, BLUR-SIZE-OF-INFINITY-POINT-IN-MM.

EXTENSION-TUBE (FOCAL-LENGTH &KEY ORIGINAL-OBJECT-DISTANCE ORIGINAL-IMAGE-DISTANCE ORIGINAL-MAGNIFICATION NEW-OBJECT-DISTANCE NEW-IMAGE-DISTANCE NEW-MAGNIFICATION EXTENSION-LENGTH (UNITS FEET))

Computes the parameters for using extension tubes. Requires: 1. original-object-distance, original-image-distance, or original-magnification 2. new-object-distance, new-image-distance, new-magnification, or extension-length Returns: original-object-distance, original-image-distance, original-magnification, original-bellows-factor new-object-distance, new-image-distance, new-magnification, extension-length.

GAUSSIAN-LENS (&KEY OBJECT-DISTANCE IMAGE-DISTANCE FOCAL-LENGTH (UNITS MM))

object-distance is in units. image-distance and focal-length are in mm.

IMAGER-DIMENSIONS (FORMAT-SPEC)

Returns the imager dimensions in mm of a FORMAT.

MAGNIFICATION (&KEY FOCAL-LENGTH OBJECT-DISTANCE IMAGE-DISTANCE (UNITS FEET))

Returns the image magnification: the ratio of image size to object size. focal-length and image-distance are in mm, object-distance is in units

OUTPUT-DIMENSIONS (FORMAT-SPEC)

Returns the output dimensions in mm of a FORMAT.

PIXEL-DIMENSIONS (SENSOR-SPEC &KEY (FORMAT 35MM))

Returns the number of pixels for a format. CAMERA-SPEC is either a keyword designating the camera or the number of megapixels of the sensor. FORMAT should be defined if the CAMERA-SPEC is the number of megapixels so the proper aspect ratio is used.

PIXEL-SIZE (FORMAT-SPEC)

Return pixel size in micrometers.

RAYLEIGH-LIMIT (F-STOP &OPTIONAL (WAVELENGTH 5.e-4))

Returns the rayleigh limit in line pairs per mm (MTF 9%) as well as the MTF50

Undocumented

AOV-TABLE (IMAGER &KEY (OUTPUT *STANDARD-OUTPUT*) (PROJECTION RECTILINEAR))

DOF-TABLE (FOCAL-LENGTH COC &KEY (OUTPUT *STANDARD-OUTPUT*) (UNITS FEET))

EFFECTIVE-APERTURE (FOCAL-LENGTH DISTANCE APERTURE)

FOV (FOCAL-LENGTH FRAME-WIDTH FRAME-HEIGHT &KEY OBJECT-DISTANCE IMAGE-DISTANCE MAGNIFICATION (UNITS FEET) (PROJECTION RECTILINEAR))

FOV-TABLE (IMAGER FOCAL-LENGTH &KEY (OUTPUT *STANDARD-OUTPUT*) (PROJECTION RECTILINEAR) (UNITS FEET))

HYPERFOCAL (FOCAL-LENGTH F-STOP COC &KEY (UNITS MM))

HYPERFOCAL-TABLE (FOCAL-LENGTH COC &KEY (UNITS FEET) (OUTPUT *STANDARD-OUTPUT*))

MAXIMUM-SHARPNESS-APERTURE (FORMAT &OPTIONAL (WAVELENGTH 5.e-4))

Private

%FOV (FOCAL-LENGTH FRAME-WIDTH FRAME-HEIGHT OBJECT-DISTANCE IMAGE-DISTANCE UNITS &OPTIONAL (PROJECTION RECTILINEAR))

Returns the field of view (units), magnification ratio, object-distance (units), and image distance (mm) for a given image (mm) and object distance (mm).

AOV-ONE-DIM (FOCAL-LENGTH FRAME-SIZE &KEY (PROJECTION RECTILINEAR) (MAGNIFICATION 0))

Returns the angle of view in one dimension. Default is infinity which has an magnification of 0.

DOF-MM (FOCAL-LENGTH F-STOP DISTANCE COC &KEY (PUPIL-FACTOR 1))

Returns depth of field based on focal-length, f-stop, distance, and coc. Six values are returned: near point, far point, total dof, magnification, blur size at infinity (mm). Circle of confusion can either be a number or keyword designating format. Reference: http://www.vanwalree.com/optics/dofderivation.html

DOF-SYMMETRIC-MM (FOCAL-LENGTH F-STOP DISTANCE COC)

Returns depth of field based on focal-length, f-stop, distance, and coc. Six values are returned: near point, far point, total dof, near point, far point, magnification, blur size at infinity (mm). Circle of confusion can either be a number or keyword designating format.

IMAGE-DISTANCE-MAGNIFICATION (FOCAL-LENGTH MAGNIFICATION)

Returns the image distance for a focused object at distance using the Gaussian Lens Equation.

LENGTH->MM (D UNITS)

Convert a length in units to mm.

MM->LENGTH (D UNITS)

Convert a number of mm to units.

N-ARGS-NOT-NIL (N &REST ARGS)

Returns T when count N of input args are not nil.

SORT-SIZE (SIZE)

Returns a cons pair with the smaller size first.

Undocumented

DEGREES->RADIANS (R)

DIAGONAL (X Y)

FEET->MM (D)

FIND-FORMAT (FORMAT-SPEC)

FORMAT-MATCH-P (FORMAT-SPEC FORMAT)

INCHES->MM (D)

MAKE-OUTPUT-FORMAT (W H &KEY (UNITS INCHES))

MM->FEET (D)

MM->INCHES (D)

MTF-SCANNER (FREQ DSCAN-FREQ &OPTIONAL (ORDER 3))

RADIANS->DEGREES (R)

SENSOR-DIMENSIONS-MEGAPIXELS (FORMAT MEGAPIXELS)

SORT-FORMATS (FORMATS)

VARIABLE

Public

Undocumented

*CAMERAS*

*DIGITAL-CAMERAS*

Private

Undocumented

+DISTANCES-FEET+

+F-STOPS+

+FOCAL-LENGTHS+

+FORMAT-DB+

CONSTANT

Private

Undocumented

+INCHES->MM+

+RADIAN->DEGREES+