How to convert cv::Mat* to cv::Mat?
Hi all,
How to convert cv::Mat*
to cv::Mat
by C++ in opencv-4.1.0?
I'm using some third party SDK that return the result as cv::Mat*
.
How do can I convert it to cv::Mat
to manipulate by opencv.
WHY is there a
cv::Mat*
in your code (it shouldn't be !) ?please show us, so we get a better idea, what to do.
also please look up "how to dereference c++ pointers", it's a very basic c++ topic, and you should have it covered before venturing into more complicated things, like computer-vision.
RED FLAG here. unless it's open src you wouldn't know, whether to delete it in the end or not.
again, please show us some code (function signatures, etc)
Thanks @berak,
Actually it is not in my code, Third party sdk is response their result as cv::Mat* .
According by their document, OpenCV can be used in case if OpenCV library is available.
I will check with third party vendor again. thanks again.
5 posts already, and we still don't know, which sdk you're talking about (link ?) what
result.image.mat();
might be, exactly, constraints of it's usage (null pointers ? pointer ownage ?), etc.https://www.vision-components.com/en/...
https://www.carrida-technologies.com/...
Well that's remarkably un-informative. I think it's just returning a pointer to the internal cv::Mat, so don't delete it. But it copies a cv::Mat you use to construct it, with an optional bool.
Oh dear, it actually stores a cv::Mat* as it's member variable. Eww.