Image 2D Processing (nvmimg_weave2d)

The Weave2D sample application, nvmimg_weave2d, demonstrates the operation of the Image 2D Processing API.
The sample application calls the Image 2D Processing API to merge odd lines from one Camera Serial Interface (CSI) port with even lines from another. The API utilizes the Video Image Compositor (VIC) to perform the merge through hardware.
For some projects, the CSI frame has a resolution of up to 2640×2704 and type RGBA. The bandwidth needed to send or receive RGBA data of this resolution exceeds the CSI bandwidth. Thus, the deserializer splits a full frame into odd and even lines, which are sent over different CSI ports. The Image 2D Processing API reconstitutes the full frame from the partial frames received over two CSI ports.
The API uses the VIC hardware engine to combine odd and even lines. Thus, the feature imposes no extra CPU load.

Assumptions, Constraints, and Dependencies

The application’s input formats are RAW8 and RGBA. Both input frames must have the same format.
The application’s input resolution is W×H/2 and its output resolution is W×H, where W and H are the width and height of a full frame.
The application’s output frame format is RGBA.
The application does no scaling or color conversion.

Architecture

This diagram illustrates the operation of the Image 2D Processing API.
A close up of a sign Description generated with very high confidence
This diagram shows the data flow within the application.
A close up of a sign Description generated with very high confidence

Error Handling

The API returns an error in the following cases:
1. Invalid input or output surfaces passed as arguments.
2. Input format of odd and even frames are not the same.
3. Input frame format is not RAW8 or RGBA.
4. Input frame resolutions are not the same.
5. Output surface passed is not RGBA.
6. Output surface height is not twice input surface height.

Running the Sample Application

The application command syntax is:
$ nvmimg_weave2d [-h] [-v] -evenfieldfile -oddfieldfile -ir -it -outfile
This table describes the command line options:
Option
Required
Description
-evenfieldfile <file>
Y
Specifies the pathname of the input file containing even lines.
-oddfieldfile <file>
Y
Specifies the pathname of the input file containing odd lines.
-ir <W>x<H>
Y
Specifies the input resolution, for example: 640x480.
-it
Y
Specifies the input type.
-outfile <file>
Y
Specifies the pathname of the output file.
-h
N
Displays help text for the application.
-v <level>
N
Logging level. Value may be:
0: Errors
1: Warnings
2: Info
3: Debug
To run the sample
1. Get the input files.
2. Launch the application, for example:
$ nvmimg_weave2d -evenfieldfile /path/to/evenfile -oddfieldfile /path/to/oddfile -ir <input resolution> -it <input type> -outfile
/path/to/outfile -v 3
Examples
The following examples demonstrate how to call nvimg_weave2d on various file types.
Weave operation on RGBA inputs:
$ nvmimg_weave2d -evenfieldfile evenlines_1280x360.rgba -oddfieldfile oddlines_1280x360.rgba -ir 1280x360 -it rgba -outfile weaved_720p.rgba
Weave operation on RAW8 inputs:
$ nvmimg_weave2d -evenfieldfile evenlines_1280x360.raw -oddfieldfile oddlines_1280x360.raw -ir 1280x360 -it raw -outfile weaved_720p.rgba