Skip to content

Conversation

@trixirt
Copy link

@trixirt trixirt commented Nov 23, 2022

On RHEL 9, opencv-4.6.0-7.el9.x86_64 there is this representative build error.

src/caffe/util/io.cpp:76:34: error: ‘CV_LOAD_IMAGE_COLOR’ was not declared in this scope
76 | int cv_read_flag = (is_color ? CV_LOAD_IMAGE_COLOR :

The header containing this enum has moved to
opencv4/opencv2/imgcodecs/legacy/constants_c.h
And is no longer in the include path.

The replacement mappings are
CV_LOAD_IMAGE_COLOR -> IMREAD_COLOR
CV_LOAD_IMAGE_GRAYSCALE -> IMREAD_GRAYSCALE

from
./opencv4/opencv2/imgcodecs/legacy/constants_c.h
CV_LOAD_IMAGE_GRAYSCALE =0,
CV_LOAD_IMAGE_COLOR =1,
to
./opencv2/imgcodecs.hpp
IMREAD_GRAYSCALE = 0, //!< If set, always convert image to the single channel grayscale image (codec internal conversion).
IMREAD_COLOR = 1, //!< If set, always convert image to the 3 channel BGR color image.

Signed-off-by: Tom Rix [email protected]

On RHEL 9, opencv-4.6.0-7.el9.x86_64 there is this
representative build error.

src/caffe/util/io.cpp:76:34: error: ‘CV_LOAD_IMAGE_COLOR’ was not declared in this scope
   76 |   int cv_read_flag = (is_color ? CV_LOAD_IMAGE_COLOR :

The header containing this enum has moved to
opencv4/opencv2/imgcodecs/legacy/constants_c.h
And is no longer in the include path.

The replacement mappings are
CV_LOAD_IMAGE_COLOR     -> IMREAD_COLOR
CV_LOAD_IMAGE_GRAYSCALE -> IMREAD_GRAYSCALE

from
./opencv4/opencv2/imgcodecs/legacy/constants_c.h
    CV_LOAD_IMAGE_GRAYSCALE  =0,
    CV_LOAD_IMAGE_COLOR      =1,
to
./opencv2/imgcodecs.hpp
       IMREAD_GRAYSCALE            = 0,  //!< If set, always convert image to the single channel grayscale image (codec internal conversion).
       IMREAD_COLOR                = 1,  //!< If set, always convert image to the 3 channel BGR color image.

Signed-off-by: Tom Rix <[email protected]>
@trixirt
Copy link
Author

trixirt commented Nov 23, 2022

A much earlier pr
#6919

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant