一、报错问题: # res = cv2.seamlessClone(src, dst, mask, (250, 250), cv2.NORMAL_CLONE)# mask 只有1行或者1列 为大于0的值时 报错: cv2.error: vectortoo long# mask 只有2行或者2列 为大于0的值时 报错:cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\core\src\matrix_wrap.cpp:1667: error: (-215:Assertion failed) !fixedSize() in function 'cv::_OutputArray::release' #OpenCV(4.5.5)
import cv2 import numpy as npdst = np.ones((501, 501, 3), np.uint8) * 255cv2.imshow("dst", dst) key = cv2.waitKey(0) src = np.ones((501, 501, 3), np.uint8) * 255 cv2.imshow("src", src) key = cv2.waitKey(0) cv2.circle(dst, center=(250, 250), radius=5, color=(0, 0, 255), thickness=-1) cv2.circle(dst, center=(250, 0), radius=5, color=(0, 0, 255), thickness=-1)mask = np.zeros((501, 501, 1), np.uint8) mask[100:101,:] = 255 cv2.imshow("mask", mask) key = cv2.waitKey(0)res = cv