3. LDC Debugging Guide

3.1. Basic Concept

3.1.1. Field of View

_images/LDCDeb002.jpg

Fig. 3.1 horizontal field of view, vertical field of view, diagonal field of view

3.2. Debugging Guide for Each Application Scenario Parameter

3.2.1. LDC

Table 3.1 LDC Parameter Configuration Table

Configuration Parameter

Configuration Range

Parameter Meaning

CenterXOffset

-511~+511

Horizontal offset of the image center point from the physical center point

CenterYOffset

-511~+511

Vertical offset of the image center point from the physical center point

DistortionRatio

[-300,500]

Correction strength, negative numbers for pincushion type, positive numbers for barrel type

bAspect

bool

Whether the aspect ratio is maintained during the field of view adjustment

XYRatio

0~100

Parameter for field of view size, valid when bAspect=1

XRatio

0~100

X-directional field of view size parameter, valid when bAspect=0

YRatio

0~100

Y-directional field of view size parameter, valid when bAspect=0

stGridInfoAttr

/

GridInfo parameter

Table 3.2 GridInfoAttr’s configure parameters

Configure Parameters

Configuration Range

Parameter Significance

bEnable

bool

Whether to enable GridInfo.

gridFileName

/

GridInfo file name.

gridBindName

/

GridInfo binding name.

isBlending

bool

Not used at the moment.

bEISEnable

bool

Not used at the moment.

homoRgnNum

/

Not used at the moment.

3.2.2. LDC Correction Model

LDC supports two correction modes, barrel distortion and pincushion distortion, as shown in Fig. 3.2 and Fig. 3.4 .

_images/LDCDeb003.png

Fig. 3.2 Barrel Distortion

_images/LDCDeb004.png

Fig. 3.3 Without Distortion

_images/LDCDeb005.png

Fig. 3.4 Pincushion Distortion

3.2.2.1. Example of Correction of Barrel Distortion

Table 3.3 Instructions for correction of barrel distortion

Parameter Description

Parameter Configuration

Image Examples

Typical Configuration

Distortion center overlaps with image center

Maintain the aspect ratio

Maintain the maximum field of view

Width=1920

Height=1080

OutWidth=1920

OutHeight=1080

CenterXOffset/CenterYOffset=0

DistortionRatio=-165

bAspect=1

XYRatio=100

XRatio=100

YRatio=100

Before correction

_images/image3-1.png

After correction

_images/image3-2.png

Ratio: Correction strength

A higher value indicates a lower correction strength

DistortionRatio=-205

_images/image3-3.png

bAspect: Whether to maintain the aspect ratio

1: Maintain the aspect ratio

0: Do not maintain the aspect ratio and retain the maximum field of view

bAspect=0

DistortionRatio=-165

_images/image3-4.png

bAspect=0, XRatio, YRatio

XRatio: Horizontal field of view reservation magnitude

YRatio: Vertical field of view reservation magnitude

bAspect=1: Enable XYRatio

XYRatio: The field of view reservation magnitude in scene where the aspect ratio is maintained

Note: 100 is the maximum field of view retained, 0 is 2/3 of the maximum field of view retained

bAspect=0,XRatio=20

bAspect=1,XRatio=20

_images/image3-5.png

_images/image3-6.png

3.2.2.2. Example of Correction of Pincushion Distortion

Table 3.4 Instructions for correction of pincushion distortion

Parameter Description

Parameter Configuration

Image Examples

Typical Configuration

Distortion center overlaps with image center

Maintain the aspect ratio

Maintain the maximum field of view

Width=1920

Height=1080

OutWidth=1920

OutHeight=1080

CenterXOffset/CenterYOffset=0

DistortionRatio=500

bAspect=1

XYRatio=100

XRatio=100

YRatio=100

Before correction

_images/image3-7.png

After correction

_images/image3-8.png

3.2.3. Free Angle Rotation

Table 3.5 Configuration of Free Angle Rotation

Configuration Parameter

Configuration Range

Parameter Meaning

CenterXOffset

-511~+511

Horizontal offset of the center of rotation from the center of the image

CenterYOffset

-511~+511

Vertical offset of the center of rotation from the center of the image

OutWidth

480~8192

Width of the output image

OutHeight

360~8192

Height of the output image

3.2.4. Data Flow Chart

_images/image4.png

Fig. 3.5 LDC (Lens Distortion Correction flowchart)