Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Check below code, It works fine for me. I didn’t felt any distortion between encode and decode.

Mat src=imread("src.jpg",1);
vector<uchar> buf;
imencode(".jpg",src,buf);

Mat dst=imdecode(buf,1);
imshow("src",src);
imshow("dst",dst);
waitKey();