Perspective transforms are used to align the image data of two different cameras viewing the same scene from different positions. It can also be used in the case of stereo image rectification to align the epipolar lines of the left/right image pair with their scan lines.
The following steps need to be performed by the application to initialize and run LDC to perform perspective transform.
- Check and wait for LDC_CORE_CTRL[2] BUSY to
become IDLE (0).
- Set LDC_CORE_CTRL[4-3] IP_DATAMODE and
LDC_CORE_CTRL[6-5] IP_DFMT to required data mode
and format.
- If lens distortion correction is performed at the
same time as the perspective transform, set
LDC_CORE_CTRL[1] LDMAPEN = 1. Otherwise, set
LDMAPEN = 0.
- Set the input frame base address in
LDC_CORE_RD_BASE_H / LDC_CORE_RD_BASE_I. Note that
the frame base address must be aligned on a
16-byte boundary.
- Set the input frame line offset in
LDC_CORE_RD_OFST[15-0] OFST.
- Set the tile size in LDC_CORE_OUT_BLKSZ[15-8] OBH
and LDC_CORE_OUT_BLKSZ[7-0] OBW. Note the
constraints on OBW in Table 7-110.
- Set the pixel pad in LDC_CORE_OUT_BLKSZ[19-16]
PIXPAD.
- Set the input frame size in
LDC_CORE_INPUT_FRSZ[29-16] H and
LDC_CORE_INPUT_FRSZ[13-0] W.
- Set the output frame size in
LDC_CORE_MESH_FRSZ[29-16] H and
LDC_CORE_MESH_FRSZ[13-0] W. Mesh data has to be
present for entire frame after transform.
- Set the output compute frame size in
LDC_CORE_COMPUTE_FRSZ[29-16] H and
LDC_CORE_COMPUTE_FRSZ[13-0] W.
- Set the starting output point in
LDC_CORE_INITXY[12-0] INITX and
LDC_CORE_INITXY[28-16] INITY.
- Configure SL2 Interface programming registers. Details of LSE configuration is captured in Section 7.7.4.3.4.
- If the data format is NV12, set the 420 UV input
plane base address in LDC_CORE_RD_420C_BASE_H /
LDC_CORE_RD_420C_BASE_l. This address must be
16-byte aligned.
- Set the mesh offset table pointer to the correct
address (LDC_CORE_MESH_BASE_H /
LDC_CORE_MESH_BASE_l and LDC_CORE_MESH_OFST. Set
the table down sampling factor for MxM down
sampling in MESHTABLE_CFG.M.
- Set the Y plane interpolation type to bilinear or
bicubic in LDC_CORE_CFG[6] YINT_TYP.
- Set the eight perspective transform parameters in
LDC_CORE_AFF_AB.A, LDC_CORE_AFF_AB.B,
LDC_CORE_AFF_CD.C, LDC_CORE_AFF_CD.D,
LDC_CORE_AFF_EF.E, and LDC_CORE_AFF_EF.F. If
affine transform is not used, then these need to
be set to the following values: A = 4096, B = 0, C
= 0, D = 0, E = 4096, F = 0,G = 0 and H = 0.
Enable LDC_CORE_CTRL[7] PWARPEN = 1.
- Set LDC_CORE_CTRL[0] LDC_EN = 1 to start the LDC
operation.
- Start the HTS init sequencing. LDC fetch/processing is gated with hts_init.
- Wait for LDC_CORE_CTRL[2] BUSY to become IDLE (0)
or wait for the end of frame completion
interrupt.