Find-Homography

group Find-Homography

Unnamed Group

NVCVStatus cvcudaFindHomographySubmit(NVCVOperatorHandle handle, cudaStream_t stream, NVCVTensorHandle srcPts, NVCVTensorHandle dstPts, NVCVTensorHandle models)

Executes the Find-Homography operation on the given cuda stream.

Limitations:

Planar image layouts: Not applicable Reason: Inputs are point-coordinate tensors and outputs are transformation matrices, not images.

Input (srcPts, dstPts): Data Layout: [NW] with dtype 2F32, or [NWC] with dtype F32 and C=2 Channels: [2] (packed as 2F32 or explicit dimension)

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes (F32 or 2F32)

64bit Float

No

Output (models): Data Layout: [NHW] Shape: [N, 3, 3]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

16bit Float

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | No
 Data Type     | Yes (base type F32)
 Batches (N)   | Yes
 Channels      | No

Parameters:
  • handle[in] Handle to the operator.

    • Must not be NULL.

  • stream[in] Handle to a valid CUDA stream.

  • srcPts[in] Input tensor, srcPts[i, j] is the set of coordinates for the source image where i ranges from 0 to batch-1, j ranges from 4 to number of coordinates per image, and the data type being float2 for (x=x, y=y)

    • Number of coordinates must be >= 4

    • Must have data type 2F32 or F32

    • Must have rank 2 or 3

  • dstPts[in] Input tensor, dstPts[i, j] is the set of coordinates for the destination image where i ranges from 0 to batch-1, j ranges from 4 to number of coordinates per image, and the data type being float2 for (x=x, y=y)

    • Number of coordinates must be >= 4

    • Must have data type 2F32 or F32

    • Must have rank 2 or 3

  • models[out] Output tensor, models[i, j, k] is the output model tensor which maps the src points to dst points in image i, where i ranges from 0 to batch-1, j ranges from 0 to 2 and k ranges from 0 to 2, and the data type being F32.

    • Must have data type F32

    • Must have rank 3

Return values:
  • NVCV_ERROR_INVALID_ARGUMENT – Some parameter is outside valid range.

  • NVCV_ERROR_INTERNAL – Internal error in the operator, invalid types passed in.

  • NVCV_SUCCESS – Operation executed successfully.

NVCVStatus cvcudaFindHomographyVarShapeSubmit(NVCVOperatorHandle handle, cudaStream_t stream, NVCVTensorBatchHandle srcPts, NVCVTensorBatchHandle dstPts, NVCVTensorBatchHandle models)

Executes the FindHomography operation on tensor batches.

Apart from using tensor batches, all parameters are the same as cvcudaFindHomographySubmit.

Parameters:
  • srcPts[in] Input tensor batch of coordinates in the source image.

  • dstPts[in] Input tensor batch of coordinates in the destination image.

  • models[out] Output model tensor batch.

Functions

NVCVStatus cvcudaFindHomographyCreate(NVCVOperatorHandle *handle, int batchSize, int maxNumPoints)

Constructs an instance of the Find-Homography operator.

Parameters:
  • handle[out] Where the image instance handle will be written to.

    • Must not be NULL.

  • batchSize[in] number of samples in the batch

  • numPoints[in] maximum number of coordinates that in the batch

Return values:
  • NVCV_ERROR_INVALID_ARGUMENT – Handle is null.

  • NVCV_ERROR_OUT_OF_MEMORY – Not enough memory to create the operator.

  • NVCV_SUCCESS – Operation executed successfully.