Ask Your Question
0

Covert Mat to Bitmap in c++

asked 2018-03-08 03:38:51 -0500

Is there a function or anything else in OpenCV c++ which converts a Mat to a Bitmap?

edit retag flag offensive close merge delete

Comments

what kind of bitmap are you talking about ? (context ?)

berak gravatar imageberak ( 2018-03-08 03:43:37 -0500 )edit

I'm in need of a binary Image. For better understanding I would like to see the thresholded picture displayed in Avihex, but to view the picture in avihex I need the Windows .bmp format. Is there any way in OpenCV c++ to safe a mat to a .bmp file? P.S. I'm a bloody rookie in c++ and OpenCV

yellowbanana15 gravatar imageyellowbanana15 ( 2018-03-08 04:03:28 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-03-08 04:08:21 -0500

berak gravatar image

sure, you can just save your image as a .bmp, using a simple:

Mat img = ...
imwrite("my.bmp", img);

please also bookmark the tutorials ;)

edit flag offensive delete link more

Comments

Thank you very much!

yellowbanana15 gravatar imageyellowbanana15 ( 2018-03-09 00:38:46 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-03-08 03:38:51 -0500

Seen: 904 times

Last updated: Mar 08 '18