I've been searching on an answer but all I can find is the inverse of what I need (Mat to FIBITMAP). I have a short code that loads images as FIBITMAP objects. I need FreeImage because OpenCV doesn't allow me to load pfm and some other extension files. What I'm trying to do is convert the FIBTMAP image into an OpenCV Mat so that I can use this in a much longer code I already have. How do I do?
相关问题
- Sorting 3 numbers without branching [closed]
- How to get the background from multiple images by
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
相关文章
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
- Converting glm::lookat matrix to quaternion and ba
- What is the correct way to declare and use a FILE
The funtion
FI2MAT
will perform the conversion from FreeImage to OpenCV Mat.I cannot thoroughly test each type of FreeImage format right now, but it should work as expected. Let me know if there are some issues with some formats.
Remember that not all types may be rendered correctly by
imshow
, so you may need to convert the image before.Here the code with an example: