Python/OpenCV

gray = cv2.cvtColor(np.float32(image2), cv2.COLOR_BGR2GRAY) cv2.error: OpenCV(4.5.4) d:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\color.simd_helpers.hpp:92: error: (-2:Unspecified error) in function '__cdecl cv::impl::`anonymous-namespace..

3zzang 2022. 7. 7. 18:43
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.COLOR_BGR2GRAY)

에서 밑의 코드로 변경하니 해결 되었다.

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)