• gdkessler's avatar
    Merge pull request #10093 from gdkessler/gdal_image_read_fix_10089 · 2674c6b5
    gdkessler authored
    Fix GDAL image decoding color problems identified by issue #10089, by: (#10093)
    
    * Fix GDAL image decoding color problems identified by issue #10089, by:
    
    Fixing CV_8UC1 symbol, which should be CV_8UC3 for RGB GDAL color table images.
    
    Fixing image.ptr<VecX>(row,col)[] to be (*image.ptr<VecX>(row,col))[] to correctly access VecX array elements, as ptr<VecX>() returns a pointer to the VecX, not the first element of VecX. This fixes the color problem with color table gif images, and avoids out-of-bounds memory access.
    
    Respecting the color identification of raster bands provided by the GDAL image driver, and produce BGR or BGRA images. Note that color bands of images using the HSL, CMY, CMYK, or YCbCr color space are ignored, rather than converting them to BGR.
    
    * When reading image files using the GDAL decoder, exit with an error if a color band is encountered that isn't used (eg. from CMYK or YCbCbr), rather than silently ignoring the band's data.
    2674c6b5
Name
Last commit
Last update
..
include/opencv2 Loading commit data...
misc/java/test Loading commit data...
perf Loading commit data...
src Loading commit data...
test Loading commit data...
CMakeLists.txt Loading commit data...