2021-01-07 18:17:28 -0600 | received badge | ● Popular Question (source) |
2016-04-24 08:36:14 -0600 | commented question | Mat from width*height*4 bytes BGRA Buffer Well, that's what I started searching for one minute ago. I need to somehow remove the alpha channel anyway for template matching... I guess you brought me the solution right away! Again thanks a lot! |
2016-04-24 07:59:14 -0600 | commented question | Mat from width*height*4 bytes BGRA Buffer Turned a 3 to 4, problem solved. Thanks a lot! |
2016-04-24 07:51:42 -0600 | asked a question | Mat from width*height*4 bytes BGRA Buffer Hey guys. Instead of wasting more time I decided to ask those people who already know a nice answer to my question ; ) I'm using the Chromium Embedded Framework off-screen rendering which provides me an image-buffer which I want to convert to an cv::Mat. According to CEFs docs: "On Windows the buffer will be widthheight4 bytes in size and represents a BGRA image with an upper-left origin." The programming language used is C++. Unfortunately my basic OpenCV knowledge is not strong enough to convert the buffer properly. With the following code I just get some awkward results saving the Mat.
Fortunately I'm able to convert my cef_buffer to an hbitmat and save it as an reference. The following Image is what I get by saving the hbitmat and the second one is what I get saving the Mat. Hopefully someone knows how to fix this. Thanks in advance! |