vcm
DeBarrel
19 oct 2021
The script call is:
vcm.DeBarrel(clip, float abc[]][, int pin =0][int method = 1][,int q = 1] [, int test = 0][,int dots = 2] [,float dim = 0.25])
clip: input clip of constant format RGB, GRAY or YUV having no subsampling are accepted.In test mode a single frame may be looped (10 to 100 times) or import functools and animate.
abc[a,b,c]: coefficients a,
b and c. Each of these coefficients positive, less than 0.5 and their sum less than 1.0
pin: distortion is pin cushion type if set 1 . If 0 Barrel type.
method: 1. Brown-Conrady model 2. Division model.
test: if set 0, regular process and if set 1 test mode.
dots: density of dots in test mode. 1 to 4
dim: 0 to 1.0. In test to make dots visible input is dimmed by this factor.
DeBarrel corrects for common distortions introduced by spherical lenses. A rectangular frame is seen slightly curved out (barrel type distortion) or curved in (pin cushion distortion).
DeBarrel attempts to correct these
distortions given the type and a, b and c values of the distortion. While it is easy to observe type (parameter pin) ( 0 barrel or 1 pin cushion)of distortion present, guessing constants
is a different matter. For this purpose a test mode is provided wherein a pattern of distorted dotted lines that will be straightened is overlain on input image. values of a,b anc may be different for the two methods. The input frame is assumed to be properly centered.