MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / FindHomographyInto

Function FindHomographyInto

python/mod_cvcuda/operators/OpFindHomography.cpp:139–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137};
138
139Tensor 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
164Tensor FindHomography(Tensor &srcPts, Tensor dstPts, std::optional<Stream> pstream)
165{

Callers 1

FindHomographyFunction · 0.85

Calls 4

cudaHandleMethod · 0.80
shapeMethod · 0.45
addMethod · 0.45
submitMethod · 0.45

Tested by

no test coverage detected