I'm finding a way to convert RGBA bitmap to Mat
in OpenCV. I tried this, but the output image had wrong color and was upside-down.
I use a struct array to store the bitmap.
typedef struct {
unsigned char r,g,b,a;
} BITMAP;
BITMAP* input = (BITMAP*)malloc(width*height*sizeof(BITMAP));
...
Mat image(height, width, CV_8UC4, input);
Does anyone know any convenient method to convert Bitmap to Mat in OpenCV?