Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

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
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.

None yet

1 participant