1 | initial version |
you can use imdecode for this:
vector<uchar> bytes(data, data+size); // unfortunately, this needs a copy.
Mat m = imdecode(bytes, IMREAD_ANYCOLOR);
imshow("M",m);
waitKey();
2 | No.2 Revision |
you can use imdecode for this:
vector<uchar> bytes(data, data+size); // unfortunately, this needs a copy.
Mat bytes(1, length, CV_8S, data);
Mat m = imdecode(bytes, IMREAD_ANYCOLOR);
imshow("M",m);
waitKey();
3 | No.3 Revision |
you can use imdecode for this:
Mat bytes(1, length, CV_8S, data);
data); // wrap a Mat header around it (no copy)
Mat m = imdecode(bytes, IMREAD_ANYCOLOR);
imshow("M",m);
waitKey();
4 | No.4 Revision |
you can use imdecode for this:
Mat bytes(1, length, CV_8S, data); // wrap a Mat header around it (no copy)
Mat m = imdecode(bytes, IMREAD_ANYCOLOR);
if (! m.empty()) { // did it work ?
imshow("M",m);
waitKey();
}