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

returning a Mat from a function

$
0
0
Hi. I am new to OpenCV. I have the following code that outputs garbage (some random numbers). Can you please help me understand the problem? #include #include #include #include using namespace std; cv::Mat transformToCVMatrix() { double matrix[2][2] = { { 1.0, 0.0 }, { 0.0, 1.0 } }; return cv::Mat(2, 2, CV_64FC1, matrix); } int main() { cv::Mat mat = transformToCVMatrix(); cout << mat << endl; cv::Mat imat = mat.inv(); cout << imat << endl; return 0; }

Viewing all articles
Browse latest Browse all 19555

Trending Articles



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