Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

Convert void buffer pointer to Mat

$
0
0
I have a module which receives a void pointer to a buffer. The original data type is uint16. When I try putting the variable into a Mat, I get weird errors from Mat imBuff = cv::Mat(628, 314, frame, CV_16U); like missing '}' which isn't missing. When I try various conversions using reinterpret_cast, I get cast from 'void*' to 'xxx' loses precision. For example, Mat imBuff = cv::Mat(628, 314, reinterpret_cast(frame), CV_16U); fives 'uint126_t' {aka short unsigned int}' loses precision Any ideas on how to solve this? Or, do I have to go back to the source file and change it there? thanks Ralph

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>