| 137 | }; |
| 138 | |
| 139 | Tensor FindHomographyInto(Tensor &models, Tensor &srcPts, Tensor &dstPts, std::optional<Stream> pstream) |
| 140 | { |
| 141 | if (!pstream) |
| 142 | { |
| 143 | pstream = Stream::Current(); |
| 144 | } |
| 145 | |
| 146 | // Use CreateOperatorEx to use the extended create operator function passing the specialized PyOperator above |
| 147 | // as template type, instead of the regular cvcuda::OP class used in the CreateOperator function. |
| 148 | int32_t batchSize = srcPts.shape()[0]; |
| 149 | int32_t numPoints = srcPts.shape()[1]; |
| 150 | |
| 151 | auto findHomography = CreateOperatorEx<PyOpFindHomography>(batchSize, numPoints); |
| 152 | |
| 153 | ResourceGuard guard(*pstream); |
| 154 | guard.add(LockMode::LOCK_MODE_READ, {srcPts}); |
| 155 | guard.add(LockMode::LOCK_MODE_READ, {dstPts}); |
| 156 | guard.add(LockMode::LOCK_MODE_READWRITE, {models}); |
| 157 | guard.add(LockMode::LOCK_MODE_READWRITE, {*findHomography}); |
| 158 | |
| 159 | findHomography->submit(pstream->cudaHandle(), srcPts, dstPts, models); |
| 160 | |
| 161 | return models; |
| 162 | } |
| 163 | |
| 164 | Tensor FindHomography(Tensor &srcPts, Tensor dstPts, std::optional<Stream> pstream) |
| 165 | { |
no test coverage detected