opencv Bitmap to cv::Mat?

Hey all, I am streaming video from an ethernet camera into an opencv c++ application, and need to use the camera's SDK to get the image.

The example code calls each frame, then rasterizes it to a Bitmap withn a command: frame->Rasterize->framebuffer.

All my other code though, uses a Mat image. (Mat InputImage)

What would be the best and/or fastest way to convert the incoming bitmaps to Mat with opencv?  (in c++)

Thanks for your help!
chemicalx001Asked:
Who is Participating?
 
chemicalx001Author Commented:
I ended up using the camera SDK header file, there was a function in it to convert.

As here:

https://forums.naturalpoint.com/viewtopic.php?f=65&t=9107&p=48812&hilit=Mat#p48812

thanks!
0
 
jkrCommented:
Can you show your sample code? The 'Mat' ctor 'Mat::Mat(int rows, int cols, int type, void* data, size_t step=AUTO_STEP);' (http://docs.opencv.org/modules/core/doc/basic_structures.html#mat-mat) should handle that for you, e.g,

    cv::Mat mat(image_hight, image_width, frame->Rasterize->framebuffer, CV_8UC3);

Open in new window

0
 
chemicalx001Author Commented:
a custom third party SDK function was the answer.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.