라벨이 opencv인 게시물 표시

[opencv-python] ModuleNotFoundError: No module named 'skimage'

해결방법 pip install scikit-image 참고문헌 [1]  https://scikit-image.org/docs/dev/install.html

[opencv-python] cv2.rectangle() TypeError: an integer is required (got type tuple)

이미지
cv2.rectangle() TypeError: an integer is required (got type tuple) 'tuple에 integer형이 필요 '하다는 에러입니다. cv2.rectangle() parameter를 보면 start_point와 end_point는 tuple type으로 두 개의 좌표 값을 가져야 한다고 나옵니다. 이때 start와 end_point는 모두 int형의 값을 취해야 합니다. Example 1 import cv2 img = cv2.imread( "image/cat.jpg" ) rect_img = cv2.rectangle(img , ( 0 , 0 ) , ( 100.1 , 100 ) , ( 0 , 0 , 255 ) , - 1 ) cv2.imshow( "rect" , rect_img) cv2.waitKey() # 출력 (에러) # Traceback (most recent call last): #   File "D:/python_projects/mine/blog/retacgle_error.py", line 5, in <module> #    rect_img = cv2.rectangle(img, (0, 0), ( 100.1 , 100), (0, 0, 255), -1) # TypeError: an integer is required (got type tuple) start_point에서 int를 취하지 않아 에러가 발생했습니다. Example 2 import cv2 img = cv2.imread( "image/cat.jpg" ) rect_img = cv2.rectangle(img , ( 0 , 0 ) , ( 100 , 100 ) , ( 0 , 0 , 255 ) , - 1 ) cv2.imshow( "rect" , r