gocv icon indicating copy to clipboard operation
gocv copied to clipboard

core: allow to construct CvMat from native cv::Mat pointer.

Open solganik opened this issue 3 years ago • 0 comments

This patch solves the use-case when there is a mix of native code that uses opencv and gocv. In case that native code that utilizes opencv creates a CvMat and there is a need to pass it to the golang environment without creating a copy.

The solution is to pass a native pointer to gocv and eventually call cv::Mat copy constructor that performs shallow copy of the origin CvMat.

(See https://docs.opencv.org/4.5.2/d3/d63/classcv_1_1Mat.html#a294eaf8a95d2f9c7be19ff594d06278e) for more details.

solganik avatar Jun 27 '21 15:06 solganik