The radial distortion transformation can be used to correct or create a kind of distortion created by optical lenses. This kind of distortion is normally visible as barrel distortion, pincushion distortion or a blend between those types.
This transformation uses the formula of the Brown-Conrady model:
p_dst = p_center + (p_src - p_center) * (Coefficient1 * sqr(r) + Coefficient2 * sqr(sqr(r)))
r = abs(p_src - p_center)
Where:
This transformation implements the forward and backward transform. The forward transform is given by the formula above. The backward transform requires to invert a 4th degree polynomial, which is a nonlinear function. Because of that a discrete map is used. The number of elements of this map can be set using MapElements.
Only the float transform level is implemented. Speedups could still be gained by implementing fixed and integer transforms.
Methods | Properties |
---|---|
In TRadialDistortionTransformation: | |
Coefficient1 | |
Coefficient2 | |
MapElements | |
In TTransformation: | |
GetTransformedBounds | SrcRect |
HasTransformedBounds | |
ReverseTransform | |
Transform |
Copyright ©2000-2024 Alex Denisov and the Graphics32 Team - Graphics32 2.0 - Help file built on 18 Feb 2024