Back to Jetson Inference

Jetson Inference: Cropping

docs/html/group__crop.html

latest9.5 KB
Original Source

| | Jetson Inference

DNN Vision Library |

Functions

Cropping Utilities Library (jetson-utils) » CUDA

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] | input | Pointer to the input image in CUDA memory. | | [out] | output | Pointer to the output image in CUDA memory. The output image should have the same dimensions as the ROI. | | | roi | The 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

| inputWidth | width of the input image (in pixels) | | inputWidth | height 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] | input | Pointer to the input image in CUDA memory. | | [out] | output | Pointer to the output image in CUDA memory. The output image should have the same dimensions as the ROI. | | | roi | The 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

| inputWidth | width of the input image (in pixels) | | inputWidth | height 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] | input | Pointer to the input image in CUDA memory. | | [out] | output | Pointer to the output image in CUDA memory. The output image should have the same dimensions as the ROI. | | | roi | The 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

| inputWidth | width of the input image (in pixels) | | inputWidth | height 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] | input | Pointer to the input image in CUDA memory. | | [out] | output | Pointer to the output image in CUDA memory. The output image should have the same dimensions as the ROI. | | | roi | The 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

| inputWidth | width of the input image (in pixels) | | inputWidth | height 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] | input | Pointer to the input image in CUDA memory. | | [out] | output | Pointer to the output image in CUDA memory. The output image should have the same dimensions as the ROI. | | | roi | The 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

| inputWidth | width of the input image (in pixels) | | inputWidth | height 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] | input | Pointer to the input image in CUDA memory. | | [out] | output | Pointer to the output image in CUDA memory. The output image should have the same dimensions as the ROI. | | | roi | The 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

| inputWidth | width of the input image (in pixels) | | inputWidth | height 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] | input | Pointer to the input image in CUDA memory. | | [out] | output | Pointer to the output image in CUDA memory. The output image should have the same dimensions as the ROI. | | | roi | The 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

| inputWidth | width of the input image (in pixels) | | inputWidth | height of the input image (in pixels) | | format | format of the image - valid formats are gray8, gray32f, rgb8/bgr8, rgba8/bgra8, rgb32f/bgr32f, and rgba32f/bgra32f. |

  • Generated on Tue Mar 28 2023 14:27:58 for Jetson Inference by 1.8.17