Typical Fisheye Correction Scenario

Wall Mount

In wall mount mode, the 180° panoramic correction and normal correction modes are recommended. The following tables describe the demonstration effect and parameters.

Table 1 Parameters of 180° panoramic correction in wall mount mode

Parameter

Description

pan

Whether the FoV rotates leftward or rightward. If pan is greater than 180, the FoV rotates rightward. If pan is less than 180, the FoV rotates leftward.

Rotation range: [–width/2, +width/2]

Note: width indicates the width of the output image.

tilt

Whether the FoV rotates upward or downward. If tilt is greater than 180, the FoV rotates upward. If tilt is less than 180, the FoV rotates downward.

Rotation range: [–30°, +30°]

hor_zoom

Horizontal FoV. The maximum value is 4095 (180°).

ver_zoom

Vertical FoV. The maximum value is 4095 (90°).

Table 2 Effect demonstration of 180° panoramic correction in wall mount mode

Typical Parameter Setting

Description

Correction Effect Demonstration

Input image width and height

The content on the left is the typical settings of 180° panoramic correction in wall mount mode. (The output image width is the same as the input image width, and the output image height is half of the input image height.) The diagrams are the demonstration diagrams when the value of a specific parameter is changed under the typical settings. The images on the right show the corresponding correction effects.

in_width

3000

in_height

3000

180° correction parameters

Installation mode

Wall mount

out_width

3000

out_height

1500

hor_offset

0

ver_offset

0

out_radius

1500

pan

180

tilt

180

hor_zoom

4095

ver_zoom

4095

trapezoid_coef

0

fan_strength

0

trapezoid_coef = 32

The trapezoid strength coefficient trapezoid_coef is valid only for normal correction and 180° correction in wall mount mode.

fan_strength = 500

The fan strength coefficient fan_strength is valid only for 180° correction and is used to adjust the horizontal lines of the image.

fan_strength = -500

pan = 270

pan = 90

tilt = 270

tilt = 90

hor_zoom = 2048

ver_zoom = 2048

Table 3 Parameters of normal correction in wall mount mode

Parameter

Description

pan

Whether the FoV rotates leftward or rightward. If pan is greater than 180, the FoV rotates rightward. If pan is less than 180, the FoV rotates leftward.

Rotation range: [–90°, 90°]

tilt

Whether the FoV rotates upward or downward. If tilt is greater than 180, the FoV rotates downward. If tilt is less than 180, the FoV rotates upward.

Rotation range: [–90°, 90°]

hor_zoom

Horizontal and vertical FoV. The maximum value is 4095 (126°). In normal mode, the horizontal FoV is the same as the vertical FoV.

ver_zoom

Invalid parameter

Table 4 Effect demonstration of normal correction in wall mount mode

Typical Parameter Setting

Description

Correction Effect Demonstration

Input image width and height

The content on the left is the typical settings of normal correction in wall mount mode. (The output image width and height are equal to the input image width and height.) The diagrams are the demonstration diagrams when the value of a specific parameter is changed under the typical settings. The images on the right show the corresponding correction effects.

in_width

3000

in_height

3000

Normal correction parameters

Installation mode

Wall mount

out_width

3000

out_height

3000

hor_offset

0

ver_offset

0

out_radius

1500

pan

180

tilt

180

hor_zoom

4095

trapezoid_coef

0

fan_strength

0

trapezoid_coef = 32

The trapezoid strength coefficient trapezoid_coef is valid only for normal correction and 180° correction in wall mount mode.

pan = 270

pan = 90

tilt = 270

tilt = 90

hor_zoom = 2048

(The FoV is only half of the value when hor_zoom is set to 4095, that is, 63°.)

Ceiling Mount and Floor Mount

In ceiling and floor mount modes, the 360° panoramic correction and normal correction modes are recommended. The following tables describe the demonstration effect and parameters.

Table 5 Parameters of normal correction in ceiling/floor mount mode

Parameter

Description

pan

The pan direction of the original image is used as the upward direction of the corrected image.

Rotation range: [0, 360°]

tilt

The absolute value of the difference between tilt and 180 indicates the amplitude of the FoV rotates to the direction determined by pan.

Rotation range: [0, 90°]

hor_zoom

Horizontal and vertical FoV. The maximum value is 4095 (126°). In normal mode, the horizontal FoV is the same as the vertical FoV.

ver_zoom

Invalid parameters

Table 6 Effect demonstration of normal correction in ceiling/floor mount mode

Typical Parameter Setting

Description

Correction Effect Demonstration

Input image width and height

The content on the left is the typical settings of normal correction in ceiling mount mode. (The output image width and height are equal to the input image width and height.) The diagrams are the demonstration diagrams when the value of a specific parameter is changed under the typical settings. The images on the right show the corresponding correction effects.

in_width

3000

in_height

3000

Normal correction parameters

Installation mode

Ceiling mount

out_width

3000

out_height

3000

hor_offset

0

ver_offset

0

out_radius

1500

pan

180

tilt

180

hor_zoom

4095

pan is used as the upward direction of the normal correction region in the corrected image.

When pan is 180, the left part of the correction region is in the upward direction of the corrected image, as shown by the blue arrow in the right image.

Floor mount

(The effect of normal correction in floor mount mode is similar to that in ceiling mount mode except that the image is up/down flipped.)

When pan is 0 or 360, the right part of the correction region is in the upward direction of the corrected image, as shown by the red arrow in the right image.

For normal correction in ceiling mount mode, the absolute value of the difference between tilt and 180 indicates the rotation angle of the FoV determined by hor_zoom. The rotation direction is determined by pan.

pan = 270

tilt = 270 or 90

The green arrow in the original image points to the upward direction in the corrected image. The effect is the same when tilt is 270 and 90.

pan = 90

tilt = 360 or 0

The yellow arrow in the original image points to the upward direction in the corrected image.

Table 7 Parameters of 360° panoramic correction in ceiling/floor mount mode

Parameter

Description

pan

Radius start position for the leftmost part of the corrected image relative to the original image, that is, start position of the correction region in the original image.

tilt

Whether the correction region moves inward or outward relative to the original image. If tilt is greater than 180, the correction region moves outward. If tilt is less than 180, the correction region moves inward.

hor_zoom

Range (amplitude) of the correction region. The value 4095 indicates one circle, and 2048 indicates half a circle.

ver_zoom

Height of the correction region within the range determined by the inner radius and outer radius.

in_radius

Radius of the visible inner ring.

out_radius

Radius of the visible outer ring. This parameter is generally set to the radius of the original image for the fisheye.

Table 8 Effect demonstration of 360° panoramic correction in ceiling/floor mount mode

Typical Parameter Setting

Description

Correction Effect Demonstration

Input image width and height

The content on the left is the typical settings of 360° panoramic correction in ceiling mount mode. (The output image width is the same as the input image width, and the output image height is 1/3 of the input image height.) The diagrams are the demonstration diagrams when the value of a specific parameter is changed under the typical settings. The images on the right show the corresponding correction effects.

in_width

3000

in_height

3000

360° correction parameters

Installation mode

Ceiling mount

out_width

3000

out_height

1000

hor_offset

0

ver_offset

0

in_radius

0

out_radius

1500

pan

180

tilt

180

hor_zoom

4095

ver_zoom

4095

Floor mount

(The effect of 360° panoramic correction in floor mount mode is similar to that in ceiling mount mode except that the image is up/down flipped.)

ver_zoom = 2048

out_radius = 1500

in_radius = 100

ver_zoom is used to adjust the height of the correction region within the range determined by the inner radius and outer radius. The height of the correction region can be calculated as follows:

h = (out_radius – in_radius) × ver_zoom/4095. The shadow region in the following figure is the selected correction region.

ver_zoom = 4095

out_radius = 1300 (out_radius is set to 1300 to demonstrate the effect. It should be set to the actual radius of the original image, which is 1500. The correction region should be selected based on ver_zoom within the range determined by the inner radius and outer radius.)

in_radius = 200

(Compared with the corrected image under the typical settings, some regions in the upper and lower parts are cropped.)

pan = 270

(This parameter is used to select the start position of the correction region.)

pan = 360

ver_zoom = 4095

out_radius = 1500

in_radius = 100

tilt = 90

tilt is used to move the correction region inward or outward. When tilt is less than 180, the correction region is moved inward. When tilt is greater than 180, the correction region is moved outward. The inside and outside boundaries of the correction region are determined by out_radius' and in_radius'.

out_radius' = out_radius + offset

in_radius' = in_radius + offset

where:

offset = out_radius × (tilt –180) / 360

out_radius' = in_radius' + (out_radius – in_radius) × ver_zoom/4095

ver_zoom = 4095

out_radius = 1500

in_radius = 100

tilt = 270

For the fisheye hardware, out_radius specifies the boundary of the image content. The parts that exceed out_radius are considered to be invalid. To be specific:

When out_radius' is greater than out_radius, black parts (shadow region in the following figure) appear in the corrected image. When in_radius' is less than 0, black parts also appear.

hor_zoom = 2048

(The correction region is only half of the original image. To obtain a better effect, you are advised to zoom out the width of the output image based on a specific ratio.)

hor_zoom = 2048

out_width = 1500

  • For 360° panoramic correction and normal correction in floor mount mode, if the image after fisheye correction is reversed leftwards and rightwards, you are advised to process the image in the VPC.
  • The calculation amount and bandwidth of fisheye processing differ greatly under different settings. The performance may be poor under non-typical settings.
  • The LMF parameters must be converted based on the parameters recommended by the lens vendor before being configured (the correct LMF parameters comply with the rule of lmf_coef[i + 1] ≥ lmf_coef[i] + 5 && lmf_coef[i + 1] <= lmf_coef[i] + 31 && lmf_coef[57] < 1024 < lmf_coef[85] && lmf_coef[0] = 0). If the configured parameters do not comply with the rule, an error is reported. If the configured parameters are incorrect, exceptions such as bus errors may occur. If there is no parameter provided by the lens vendor, you are advised to disable the LMF function.