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

Access channels of CV_8UC Image

$
0
0
I want to convert a *float* matrix to an *unsigned char* matrix with the same number of channels. cv::Mat imgA(3, 3, CV_32FC(5)); // image is filled with something cv::Mat imgB; imgA.convertTo(imgB, CV_8UC(imgA.channels())); How can the additional channels of a CV_8UC image be accessed? The following gives a segmentation fault. std::cout << (int) imgB.at(0,0,1) << "\n";

Viewing all articles
Browse latest Browse all 19555

Trending Articles



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