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

[BUG] BGRA_to_GRAY and RGBA_to_GRAY Color Conversion Error #136

Open
hunterwn opened this issue Jan 3, 2024 · 0 comments
Open

[BUG] BGRA_to_GRAY and RGBA_to_GRAY Color Conversion Error #136

hunterwn opened this issue Jan 3, 2024 · 0 comments
Labels
? - needs triage bug Something isn't working as expected (software, install, documentation)

Comments

@hunterwn
Copy link

hunterwn commented Jan 3, 2024

Describe the bug
Attempting RGBA/BGRA to Gray color conversion results in an error.
ERROR: Invalid convert color code: 10

Steps/Code to reproduce bug
Call cvcudaCvtColorSubmit with either NVCV_COLOR_BGRA2GRAY or NVCV_COLOR_RGBA2GRAY as the last parameter.

Expected behavior
The color conversion works as expected.

Additional context
in the file cvt_color.cu there exists a color conversion function table. It appears that the functions for BGRA_to_GRAY and RGBA_to_GRAY are disabled even though there is code to handle them in the BGR_to_GRAY function.

inline ErrorCode BGR_to_GRAY(const TensorDataStridedCuda &inData, const TensorDataStridedCuda &outData,
                             NVCVColorConversionCode code, cudaStream_t stream)
{
    int bidx = (code == NVCV_COLOR_RGBA2GRAY || code == NVCV_COLOR_RGB2GRAY) ? 2 : 0;
    int sch  = (code == NVCV_COLOR_RGBA2GRAY || code == NVCV_COLOR_BGRA2GRAY) ? 4 : 3;
    // ...
    static const func_t funcs[] = {

        BGR_to_RGB, // CV_BGR2BGRA    =0
        BGR_to_RGB, // CV_BGRA2BGR    =1
        BGR_to_RGB, // CV_BGR2RGBA    =2
        BGR_to_RGB, // CV_RGBA2BGR    =3
        BGR_to_RGB, // CV_BGR2RGB     =4
        BGR_to_RGB, // CV_BGRA2RGBA   =5

        BGR_to_GRAY, // CV_BGR2GRAY    =6
        BGR_to_GRAY, // CV_RGB2GRAY    =7
        GRAY_to_BGR, // CV_GRAY2BGR    =8
        0,           //GRAY_to_BGRA,           // CV_GRAY2BGRA   =9
        0,           //BGRA_to_GRAY,           // CV_BGRA2GRAY   =10
        0,           //RGBA_to_GRAY,           // CV_RGBA2GRAY   =11
        // ...

There are no comments or error messages to suggest that these have been intentionally disabled.

@hunterwn hunterwn added ? - needs triage bug Something isn't working as expected (software, install, documentation) labels Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
? - needs triage bug Something isn't working as expected (software, install, documentation)
Projects
None yet
Development

No branches or pull requests

1 participant