Skip to content

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

Open
solganik wants to merge 1 commit intohybridgroup:devfrom
solganik:cvmat-ctor-from-native
Open

core: allow to construct CvMat from native cv::Mat pointer.#864
solganik wants to merge 1 commit intohybridgroup:devfrom
solganik:cvmat-ctor-from-native

Conversation

@solganik
Copy link
Contributor

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 solganik changed the base branch from release to dev June 27, 2021 20:00
@solganik solganik force-pushed the cvmat-ctor-from-native branch from 2df2bce to d145f80 Compare June 27, 2021 20:14
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant