Auxiliary function to get tensor access for input tensor in
| 128 | |
| 129 | // Auxiliary function to get tensor access for input tensor in |
| 130 | auto tensorAccess(Tensor &in) |
| 131 | { |
| 132 | auto inData = in.exportData<nvcv::TensorDataStridedCuda>(); |
| 133 | if (!inData) |
| 134 | { |
| 135 | throw nvcv::Exception(nvcv::Status::ERROR_INVALID_ARGUMENT, "Input must be a valid CUDA strided tensor"); |
| 136 | } |
| 137 | auto inAccess = nvcv::TensorDataAccessStridedImagePlanar::Create(*inData); |
| 138 | if (!inAccess) |
| 139 | { |
| 140 | throw nvcv::Exception(nvcv::Status::ERROR_INVALID_ARGUMENT, "Input must be a valid image-based tensor"); |
| 141 | } |
| 142 | return inAccess; |
| 143 | } |
| 144 | |
| 145 | TupleTensor4 SIFTInto(Tensor &featCoords, Tensor &featMetadata, Tensor &featDescriptors, Tensor &numFeatures, |
| 146 | Tensor &in, int numOctaveLayers, float contrastThreshold, float edgeThreshold, float initSigma, |