Jetson Inference
DNN Vision Library

Crop an image to the specified region of interest (ROI). More...

Functions

cudaError_t cudaCrop (uint8_t *input, uint8_t *output, const int4 &roi, size_t inputWidth, size_t inputHeight)
 Crop a uint8 grayscale image to the specified region of interest (ROI). More...
 
cudaError_t cudaCrop (float *input, float *output, const int4 &roi, size_t inputWidth, size_t inputHeight)
 Crop a floating-point grayscale image to the specified region of interest (ROI). More...
 
cudaError_t cudaCrop (uchar3 *input, uchar3 *output, const int4 &roi, size_t inputWidth, size_t inputHeight)
 Crop a uchar3 RGB/BGR image to the specified region of interest (ROI). More...
 
cudaError_t cudaCrop (uchar4 *input, uchar4 *output, const int4 &roi, size_t inputWidth, size_t inputHeight)
 Crop a uchar4 RGBA/BGRA image to the specified region of interest (ROI). More...
 
cudaError_t cudaCrop (float3 *input, float3 *output, const int4 &roi, size_t inputWidth, size_t inputHeight)
 Crop a float3 RGB/BGR image to the specified region of interest (ROI). More...
 
cudaError_t cudaCrop (float4 *input, float4 *output, const int4 &roi, size_t inputWidth, size_t inputHeight)
 Crop a float4 RGBA/BGRA image to the specified region of interest (ROI). More...
 
cudaError_t cudaCrop (void *input, void *output, const int4 &roi, size_t inputWidth, size_t inputHeight, imageFormat format)
 Crop a float4 RGBA/BGRA image to the specified region of interest (ROI). More...
 

Detailed Description

Crop an image to the specified region of interest (ROI).

Function Documentation

◆ cudaCrop() [1/7]

cudaError_t cudaCrop ( float *  input,
float *  output,
const int4 &  roi,
size_t  inputWidth,
size_t  inputHeight 
)

Crop a floating-point grayscale image to the specified region of interest (ROI).

Parameters
[in]inputPointer to the input image in CUDA memory.
[out]outputPointer to the output image in CUDA memory. The output image should have the same dimensions as the ROI.
roiThe region of interest from the input image that will be copied to the output image. This int4 vector forms a crop rectangle as follows:
  • roi.x -> left
  • roi.y -> top
  • roi.z -> right
  • roi.w -> bottom

The ROI coordinates must not be negative, otherwise an error will be returned.

Parameters
inputWidthwidth of the input image (in pixels)
inputWidthheight of the input image (in pixels)

◆ cudaCrop() [2/7]

cudaError_t cudaCrop ( float3 *  input,
float3 *  output,
const int4 &  roi,
size_t  inputWidth,
size_t  inputHeight 
)

Crop a float3 RGB/BGR image to the specified region of interest (ROI).

Parameters
[in]inputPointer to the input image in CUDA memory.
[out]outputPointer to the output image in CUDA memory. The output image should have the same dimensions as the ROI.
roiThe region of interest from the input image that will be copied to the output image. This int4 vector forms a crop rectangle as follows:
  • roi.x -> left
  • roi.y -> top
  • roi.z -> right
  • roi.w -> bottom

The ROI coordinates must not be negative, otherwise an error will be returned.

Parameters
inputWidthwidth of the input image (in pixels)
inputWidthheight of the input image (in pixels)

◆ cudaCrop() [3/7]

cudaError_t cudaCrop ( float4 *  input,
float4 *  output,
const int4 &  roi,
size_t  inputWidth,
size_t  inputHeight 
)

Crop a float4 RGBA/BGRA image to the specified region of interest (ROI).

Parameters
[in]inputPointer to the input image in CUDA memory.
[out]outputPointer to the output image in CUDA memory. The output image should have the same dimensions as the ROI.
roiThe region of interest from the input image that will be copied to the output image. This int4 vector forms a crop rectangle as follows:
  • roi.x -> left
  • roi.y -> top
  • roi.z -> right
  • roi.w -> bottom

The ROI coordinates must not be negative, otherwise an error will be returned.

Parameters
inputWidthwidth of the input image (in pixels)
inputWidthheight of the input image (in pixels)

◆ cudaCrop() [4/7]

cudaError_t cudaCrop ( uchar3 *  input,
uchar3 *  output,
const int4 &  roi,
size_t  inputWidth,
size_t  inputHeight 
)

Crop a uchar3 RGB/BGR image to the specified region of interest (ROI).

Parameters
[in]inputPointer to the input image in CUDA memory.
[out]outputPointer to the output image in CUDA memory. The output image should have the same dimensions as the ROI.
roiThe region of interest from the input image that will be copied to the output image. This int4 vector forms a crop rectangle as follows:
  • roi.x -> left
  • roi.y -> top
  • roi.z -> right
  • roi.w -> bottom

The ROI coordinates must not be negative, otherwise an error will be returned.

Parameters
inputWidthwidth of the input image (in pixels)
inputWidthheight of the input image (in pixels)

◆ cudaCrop() [5/7]

cudaError_t cudaCrop ( uchar4 *  input,
uchar4 *  output,
const int4 &  roi,
size_t  inputWidth,
size_t  inputHeight 
)

Crop a uchar4 RGBA/BGRA image to the specified region of interest (ROI).

Parameters
[in]inputPointer to the input image in CUDA memory.
[out]outputPointer to the output image in CUDA memory. The output image should have the same dimensions as the ROI.
roiThe region of interest from the input image that will be copied to the output image. This int4 vector forms a crop rectangle as follows:
  • roi.x -> left
  • roi.y -> top
  • roi.z -> right
  • roi.w -> bottom

The ROI coordinates must not be negative, otherwise an error will be returned.

Parameters
inputWidthwidth of the input image (in pixels)
inputWidthheight of the input image (in pixels)

◆ cudaCrop() [6/7]

cudaError_t cudaCrop ( uint8_t *  input,
uint8_t *  output,
const int4 &  roi,
size_t  inputWidth,
size_t  inputHeight 
)

Crop a uint8 grayscale image to the specified region of interest (ROI).

Parameters
[in]inputPointer to the input image in CUDA memory.
[out]outputPointer to the output image in CUDA memory. The output image should have the same dimensions as the ROI.
roiThe region of interest from the input image that will be copied to the output image. This int4 vector forms a crop rectangle as follows:
  • roi.x -> left
  • roi.y -> top
  • roi.z -> right
  • roi.w -> bottom

The ROI coordinates must not be negative, otherwise an error will be returned.

Parameters
inputWidthwidth of the input image (in pixels)
inputWidthheight of the input image (in pixels)

◆ cudaCrop() [7/7]

cudaError_t cudaCrop ( void *  input,
void *  output,
const int4 &  roi,
size_t  inputWidth,
size_t  inputHeight,
imageFormat  format 
)

Crop a float4 RGBA/BGRA image to the specified region of interest (ROI).

Parameters
[in]inputPointer to the input image in CUDA memory.
[out]outputPointer to the output image in CUDA memory. The output image should have the same dimensions as the ROI.
roiThe region of interest from the input image that will be copied to the output image. This int4 vector forms a crop rectangle as follows:
  • roi.x -> left
  • roi.y -> top
  • roi.z -> right
  • roi.w -> bottom

The ROI coordinates must not be negative, otherwise an error will be returned.

Parameters
inputWidthwidth of the input image (in pixels)
inputWidthheight of the input image (in pixels)
formatformat of the image - valid formats are gray8, gray32f, rgb8/bgr8, rgba8/bgra8, rgb32f/bgr32f, and rgba32f/bgra32f.