Using NvSIPLPipelineConfiguration to crop on ISP level

Please provide the following info (check/uncheck the boxes after creating this topic):
Software Version
DRIVE OS Linux 5.2.6
DRIVE OS Linux 5.2.6 and DriveWorks 4.0
DRIVE OS Linux 5.2.0
DRIVE OS Linux 5.2.0 and DriveWorks 3.5
NVIDIA DRIVE™ Software 10.0 (Linux)
NVIDIA DRIVE™ Software 9.0 (Linux)
other DRIVE OS version
other

Target Operating System
Linux
QNX
other

Hardware Platform
NVIDIA DRIVE™ AGX Xavier DevKit (E3550)
NVIDIA DRIVE™ AGX Pegasus DevKit (E3550)
other

SDK Manager Version
1.7.1.8928
other

Host Machine Version
native Ubuntu 18.04
other

Dear Support!
We are using IMX490 and IMX390 cameras. The camera images shall be croped for performance optimalization at the image processing pipeline.(ISP)
We have tried to configuring the camera via nvsipl::NvSIPLPipelineConfiguration (NVIDIA DRIVE OS Linux SDK API Reference: nvsipl::NvSIPLPipelineConfiguration Struct Reference | NVIDIA Docs) but it seems it only allows to crop vertically (y0 and y1), for horizontal crop we are getting the following error:
MAX96712: Revision 4 detected
MAX96712: SetCMU2Default
MAX9295: Revision 8 detected!
Sensor IMX390 Rev 0 RGGB detected!
Module_id 22 Severity 6 : NvMediaICPCreateEx 76
Module_id 22 Severity 6 : T19x VI version 0x000019
[CamCheckInputImageInfo:136] [CamCheckInputImageInfo:136] Bad input parameter : horizontal crop not expected
[CamCheckImageInfo:172] [CamCheckImageInfo:172] Bad input parameter
[CamInitRangeCheck:1424] [CamInitRangeCheck:1424] Bad input parameter
[NvMediaCamInit:90] [NvMediaCamInit:90] Bad init parameter

Is it possible to configure the cameras to able to crop the image around? What are the restrictions actually?

Dear @mark.baranyi,
We are checking internally and update you on this issue. May I know is it critical requirement in your use case?

1 Like

Dear Siva,
This is crucial for performance optimization.

Additional info: We want to use ispInputCrop to avoid unnecessary use of resources.

Dear @mark.baranyi,
Unfortunately, horizontal crop is not supported.

Dear Siva,
Thank you for the feedback. Some things are left open from our side. What are the exact limitations of the cropping for:
-input cropping
-output0 cropping
-output1 cropping?
Could you provide me a detailed description?
(I’m also curious why the horizontal crop is not supported at input crop.)

Dear @mark.baranyi,
Thank you for bringing to our attention. We are fixing the documentation to have these information.

The limitations for cropping is below

Input crop:

  • Coordinates of image top-left & bottom-right points are (0, 0) & (width, height) respectively. Either memset the rectangle to 0 or set it to include the full image for no cropping.
  • Input crop only supports cropping in the vertical direction, meaning left & right coordinates must be 0 & input width, respectively.
  • Vertical and horizontal cropped sizes should be even numbers.
  • Supported vertical cropped height: [128, 4096]

Output Crops:

  • Coordinates of image top-left & bottom-right points are (0, 0) (width, height) respectively. Either memset the rectangle to 0 or set it to include the full image for no cropping.
  • Rectangle must be within input image or downscaled image if downscaling is enabled. Cropped width & height must be the same as output width & height respectively and cropped width and height must be even

Dear Siva,
Thank you again. We couldn’t interpret this statement:

Is this mean the vertical top maximum is 128 and the vertical bottom minimum is 4096?

Dear @mark.baranyi.
The height value has to be between 128 and 4096,

Dear Siva,
One more question came up regarding dependency. Is it varying with camera type or DRIVE OS version?

Dear @mark.baranyi,

Is it varying with camera type or DRIVE OS version?

it is not camera-dependent. But might change with the DRIVE OS version.

Dear Siva,
We have tried some crops and it is still not working as expected. For example:
Setting up ispInputCrop.y0 (OR ispInputCrop.y1 to maxheight-256), the driver gives back the following error:
Module_id 30 Severity 2 : src/control/common/camrangecheck.cpp 33
Module_id 30 Severity 2 : parameter is too large 1702 1620
Module_id 30 Severity 2 : src/control/common/camrangecheck.cpp 681
Module_id 30 Severity 2 : Bad input parameter : Rectangular Mask y1
Module_id 30 Severity 2 : src/control/isp/settings/camstats.cpp 54
Module_id 30 Severity 2 : Bad parameter : rect Mask
Module_id 30 Severity 2 : src/control/isp/settings/camstats.cpp 72
Module_id 30 Severity 2 : Bad parameter: Rect Mask
Module_id 30 Severity 2 : src/control/isp/settings/camstats.cpp 154
Module_id 30 Severity 2 : Bad parameter: set LAC window

In this case the region of the cropped image should be: [0, 0, 2896, 1620] (or [0, 256, 2896, 1876])
The other crop values are set as described:
x0 = 0
x1 = maxwidth
y0 = 256 (or 0)
y1 = maxheight (or maxheight - 256)

Maybe it is an interpretation issue.

Dear @mark.baranyi,
Could you please file another topic to avoid cluttering of issues.

1 Like