Updated by Andrey Pavlenko over 12 years ago
Since the last updates of the PNG modul, the imencde/decode to a buffer does not work anymore.
<pre>
vector<uchar> buff;
{
Mat im = Mat::zeros(1000,1000, CV_8U);
vector<int> param = vector<int>(2);
param[0] = CV_IMWRITE_PNG_COMPRESSION;
param[1] = 3; //default(3) 0-9.
cv::imencode(".png" ,im ,buff, param);
}
// hangs
Mat im2 = imdecode(buff,CV_LOAD_IMAGE_ANYDEPTH);
</pre>
<pre>
vector<uchar> buff;
{
Mat im = Mat::zeros(1000,1000, CV_8U);
vector<int> param = vector<int>(2);
param[0] = CV_IMWRITE_PNG_COMPRESSION;
param[1] = 3; //default(3) 0-9.
cv::imencode(".png" ,im ,buff, param);
}
// hangs
Mat im2 = imdecode(buff,CV_LOAD_IMAGE_ANYDEPTH);
</pre>