Attention! This forum will be made read-only by Dec-20. Please migrate to https://forum.opencv.org. Most of existing active users should've received invitation by e-mail.
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 };