繁体   English   中英

cv.bitwise_and,错误:(-209:大小不匹配)操作既不是“数组操作数组”(其中 arrays 具有相同的大小和类型)

[英]cv.bitwise_and, error: (-209:Sizes do not match) The operation is neither 'array op array' (where arrays have the same size and type)

错误:OpenCV(4.6.0)/io/opencv/modules/core/src/arithm.cpp:212:

error: (-209:Sizes of input arguments do not match) The operation is neither 'array op array' (where arrays have the same size and type), nor 'array op scalar', nor 'scalar op array' in function '二进制操作'

在此处输入图像描述

img1 = cv2.resize(smooth2, (960, 540))
img2 = cv2.resize(edges, (960, 540))

cartoonImage = cv2.bitwise_and(img1, img2)
ReSized6 = cv2.resize(cartoonImage, (960, 540))

也许错误信息有点误导。 这两个图像必须具有相同的shape 您必须至少转换其中一个。 如果我使用bgrgrayscale图像,我可以重现错误消息。 所以请检查smooth2edges的形状!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM