running imdecode on a buffer containing jpeg image

asked 2016-10-14 00:57:14 -0600

mika S gravatar image

i am running imdecode on a buffer (string called str) containing a 4 channel jpeg. I do this:

    vector<uchar> vectordata(str.begin(), str.end());
    Mat mat = imdecode(vectordata, IMREAD_UNCHANGED);

the mat object has the correct size in terms of rows and cols for the image but it is only full of white pixels (255 for all r,g,b and a values. Any help would be great here :)

edit retag flag offensive close merge delete