mat from buffer
I try to capture video from frame grabber. What I did is I point raw data from buffer into Mat as follow:
myMat = Mat(Size (x, y), CV_8UC1, ImaqBuffer); Image below (picture 1) show what I got from myMat (image after change to Mat), compare to what I'd supposed to get (the image save direct from buffer) (picture 2).
How can I solve this?
I suppose it is CV_8UC3
Take a look documentation
also look for an example usage https://github.com/Itseez/opencv/pull...
But why CV_8UC3? Since it is a grayscale image, not color image.
Check the image dimensions, step and data type (really 8 bit unsigned?), or maybe it is a color image with all the same values for r,g,b.
It is a color image that has just gray values. Did you save it on 1 channel?
@sturkmen: I do not understand the
& -4
from the step part. Can you explain it please? :)also i don't know :) there is a problem when saving some images by CTRL + S. i tried to solve taking reference