我运行了以下代码,但出现错误
OpenCV(3.4.1)C:\ projects \ opencv-python \ opencv \ modules \ imgproc \ src \ thresh.cpp:1406:错误:(-215)src.type()==((((0)&(( 1 << 3)-1))+((((1)-1)<< 3))在函数cv :: threshold中
我不清楚这意味着什么以及如何解决它
import numpy as numpy
from matplotlib import pyplot as matplot
import pandas as pandas
import math
from sklearn import preprocessing
from sklearn import svm
import cv2
blur = cv2.GaussianBlur(img,(5,5),0)
ret3,th3 = cv2.threshold(blur,0,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)
image = numpy.invert(th3)
matplot.imshow(image,'gray')
matplot.show()
Run Code Online (Sandbox Code Playgroud)