Skip to content

Fix for Issue:3 Assert failed in cv_binary_op#5

Open
resdev01 wants to merge 1 commit into
zaheenrahman:mainfrom
resdev01:Issue_3_assert_fail_in_cvbinary_op
Open

Fix for Issue:3 Assert failed in cv_binary_op#5
resdev01 wants to merge 1 commit into
zaheenrahman:mainfrom
resdev01:Issue_3_assert_fail_in_cvbinary_op

Conversation

@resdev01

@resdev01 resdev01 commented Aug 8, 2025

Copy link
Copy Markdown

Fix for Issue 3:

ComfyUI-ColorCorrection\color_correction_node.py", line 79, in correct_colors
    orig_masked = cv2.bitwise_and(orig_img_uint8, orig_img_uint8, mask=orig_mask_bin)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cv2.error: OpenCV(4.11.0) D:\a\opencv-python\opencv-python\opencv\modules\core\src\arithm.cpp:230: error: (-215:Assertion failed) (mtype == CV_8U || mtype == CV_8S) && _mask.sameSize(*psrc1) in function 'cv::binary_op'
============================================================
!!! Exception during processing !!! OpenCV(4.11.0) /io/opencv/modules/core/src/arithm.cpp:230: error: (-215:Assertion failed) (mtype == CV_8U || mtype == CV_8S) && _mask.sameSize(*psrc1) in function 'binary_op'

Problem:

Did not handle case when mask has shape [C=1, H, W]

Handles case when mask has shape [C=1, H, W]
@resdev01 resdev01 mentioned this pull request Aug 8, 2025
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