Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename CV_LOAD_IMAGE_* enums #7065

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

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 trix@redhat.com

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 <trix@redhat.com>
@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