using imread of OpenCV failed when the image is Ok -
When I want to read an image using the OpenCV function imread ()
Had to face a problem. The image is fine and I can show it in the image display software. But when I use the imdecode ()
to get the image data, the data gets zero. I will upload the image and code and hope someone can help me
Mat img = imread (image_name); If (! Img.data) return -1;
The link for the image is here:
PS: image_name
OK I think OpenCV can not decode this image. Is there a way to decode this image using OpenCV ?, like adding a new decode library, by the way, I can read this image using free image like another image library.
Your image is in .gif
and is not yet supported by OpenCV .
Note OpenCV image formats support Windows Bitmap (BMP), Portable Image Format (PBM, PGM, PPM) and Sun raster (SR, RUS). With the help of plugins (if you create your own library, we present them in the package by default, then you need to specify them) You can use JPEG (JPEG, JPG, JP), JPEG 2000 (JP2 - CMK) In the form of Jasper), TIFF files (TIF, TIF) and portable network graphics (PNG). Apart from this, OpenXR also has a possibility.
Source - click
You can use something like a conversion.
I was able to load your image to use it by using imread
. In addition, you can check out.
Comments
Post a Comment