I'm working with c# and OpenCV. I have a Bitmap that I want to write as a frame of video using the VideoWriter provided by OpenCV. I've done this in Python so know it will work. I just need the conversion step from Bitmap to Mat.
My (partial) code looks roughly like this...
VideoWriter video = new VideoWriter(filename, fps, frameSize, false);
Bitmap image = SomethingReturningABitmap();
// NEED CONVERT FROM Bitmap to Mat
Mat frame = new Mat();
video.Write(frame);