Ask Your Question

Revision history [back]

Mat_<char> and CV_8UC4 it is strange. try like this :

cv::Mat samples(1, 5, CV_8UC4);

samples.at<cv::Vec4b>(0, 0) = { 1,  2 , 3 , 4 };
samples.at<cv::Vec4b>(0, 1) = Vec4b(1, 2, 3, 4);
samples.at<cv::Vec4b>(0, 2) = Vec4b(1, 2, 3, 4);
samples.at<cv::Vec4b>(0, 3) = Vec4b(1, 2, 3, 4);
samples.at<cv::Vec4b>(0, 4) = { 1,  2 , 3 , 4 };