在这段代码中,我试图对图像进行积分,每次运行此代码时,窗口都会闪烁并消失,然后在终端中出现此错误
import cv2
import numpy as np
image = cv2.imread("nancy.jpg")
rows,cols,dims=image.shape
sum = np.zeros((rows,cols),np.uint8)
imageIntegral = cv2.integral(image, sum,-1)
cv2.imshow("imageIntegral",imageIntegral)
cv2.waitKey()
Run Code Online (Sandbox Code Playgroud)
错误:
cv2.imshow("imageIntegral",imageIntegral)cv2.error: OpenCV(4.1.0) C:/projects/opencv-python/opencv/modules/highgui/src/precomp.hpp:131:
错误: (-215:Assertion failed) src_depth != CV_16F && src_depth != CV_32S in function 'convertToShow'