___해결못하고 코드 자체를 다른 걸 사용했다 ___
image1 =scan_img(image ,width=200,ksize=(3,3), min_threshold=20,max_threshold=210)
image2 = img_roi(image1)
gray = cv2.cvtColor(np.float32(image2), cv2.IMREAD_GRAYSCALE)
gray = cv2.normalize(gray, None, 0, 255, cv2.NORM_MINMAX)
chahe = cv2.createCLAHE(clipLimit=1.0, tileGridSize=(5, 5))
gray = chahe.apply(gray)
아마 이 코드에서 float32로 변환해서 에러가 난것같다.
다른 프로젝트를 하다가 이런 에러를 또다시 발견하게 된다면,
error: (-215) _src.type() == CV_8UC1 in function equalizeHist when trying to equalize a float64 image
I'm trying to equalize a 1 one channel image like so: img = cv2.equalizeHist(img) But since it's a float64 img, I get the following error: error: (-215) _src.type() == CV_8UC1 in function
stackoverflow.com
여길 참조하거나,
error: OpenCV(4.1.2) /io/opencv/modules/imgproc/src/clahe.cpp:351: error: (-215:Assertion failed) _src.type() == CV_8UC1 || _src
new_img = cv2.fillPoly(blank_img,[cnt],color =(255,255,255)) I was facing error in this line. so The solution is make sure "cnt" must be int not float. CHANGES: cnt = np.array([[50,50], [50,150], [150,150], [150,50]],dtype=np.int32)
www.codegrepper.com
이 광활한 정보를 참조 ...해야겠다..