Hello,
I am struggling with this problem for several days now.
I want to read a .pgm Image from a TOF Camera with imread() but it just doesn’t.
There is no error or something. The cv::Mat just is empty when checked after with empty().
Every other kind of image and even other pgm from the internet work with my code.
The pgm Images from the camera are 16bit.
One could think that the images are just not compatible with opencv but the weird thing is that I have a Python Script that reads that same images with imread() without problems. For performance reasons I wanted to port the code to C++ but imread() doesn’t work anymore with these pgms.
The path is correct. I tried several versions of opencv. I reinstalled everything multiple times.
Nothing helped so far.
If you have any idea what I could try to get it to work, please tell me.
Thank you
OpenCV modules:
To be built: calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo stitching video videoio
Disabled: python_tests world
Disabled by dependency: -
Unavailable: java python2 python3 ts
Applications: -
Documentation: NO
Non-free algorithms: NO
Media I/O:
ZLib: ZLIB::ZLIB (ver 1.3.1)
JPEG: (ver 90)
WEBP: /home/conan/workspace/prod-v2/bsr/8120/bfffb/p/libwe0ab986b34fa07/p/lib/libwebp.a (ver encoder: 0x020f)
PNG: (ver …)
TIFF: (ver 42 / 4.6.0)
JPEG 2000: (ver 4.2.0)
OpenEXR: OpenEXR::OpenEXR (ver 3.2.3)
HDR: NO
SUNRASTER: NO
PXM: NO
PFM: NO
Video I/O:
FFMPEG: YES (find_package)
avcodec: YES (58.134.100)
avformat: YES (58.76.100)
avutil: YES (56.70.100)
swscale: YES (5.9.100)
avresample: NO
Parallel framework: pthreads
Trace: YES (built-in)
Other third-party libraries:
Eigen: YES (ver …)
Custom HAL: NO
Protobuf: protobuf::libprotobuf (3.21.12)
Python (for build): NO
Install to: /home/conan/workspace/prod-v2/bsr/8120/bfffb/p/b/openc30b1a5ee1be59/p
PXM : NO means it’s compiled without pgm support i guess?
Then I don’t understand why other pgm images i downloaded worked.
But this helped me already. Thanks