Merge pull request #20107 from sivanov-work:gapi_transpose_op

G-API: Add transpose operation

* Add kernels decl & def

* Add draft for UT

* Fix UT for Transpose

* Add perf test

* Fix docs

* Apply comments
This commit is contained in:
Sergey Ivanov
2021-05-25 20:36:01 +03:00
committed by GitHub
parent 5f637e5a02
commit 2b06208bbd
13 changed files with 140 additions and 0 deletions
@@ -575,6 +575,12 @@ namespace core {
return std::make_tuple(empty_gopaque_desc(), empty_array_desc(), empty_array_desc());
}
};
G_TYPED_KERNEL(GTranspose, <GMat(GMat)>, "org.opencv.core.transpose") {
static GMatDesc outMeta(GMatDesc in) {
return in.withSize({in.size.height, in.size.width});
}
};
} // namespace core
namespace streaming {
@@ -1927,6 +1933,21 @@ GAPI_EXPORTS std::tuple<GOpaque<double>,GArray<int>,GArray<Point3f>>
kmeans(const GArray<Point3f>& data, const int K, const GArray<int>& bestLabels,
const TermCriteria& criteria, const int attempts, const KmeansFlags flags);
/** @brief Transposes a matrix.
The function transposes the matrix:
\f[\texttt{dst} (i,j) = \texttt{src} (j,i)\f]
@note
- Function textual ID is "org.opencv.core.transpose"
- No complex conjugation is done in case of a complex matrix. It should be done separately if needed.
@param src input array.
*/
GAPI_EXPORTS GMat transpose(const GMat& src);
namespace streaming {
/** @brief Gets dimensions from Mat.