diff --git a/README.md b/README.md index 4a1b700..83bf90d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ # Opencv Tutorial +## Install + +`pip install opencv-python` + +## Articles + I highly recommend to see my articles for better understanding: Part_1: https://habr.com/ru/post/519454/ diff --git a/part_4.py b/part_4.py index 7116bbb..011f025 100644 --- a/part_4.py +++ b/part_4.py @@ -25,7 +25,7 @@ def find_features(img1): def find_contours_of_cards(image): blurred = cv2.GaussianBlur(image, (3, 3), 0) T, thresh_img = cv2.threshold(blurred, 215, 255, cv2.THRESH_BINARY) - (_, cnts, _) = cv2.findContours(thresh_img, cv2.RETR_EXTERNAL, + (cnts, _) = cv2.findContours(thresh_img, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) return cnts @@ -54,4 +54,4 @@ def draw_rectangle_aroud_cards(cards_coordinates, image): gray_main_image = cv2.cvtColor(main_image, cv2.COLOR_BGR2GRAY) contours = find_contours_of_cards(gray_main_image) cards_location = find_coordinates_of_cards(contours, gray_main_image) - draw_rectangle_aroud_cards(cards_location, main_image) \ No newline at end of file + draw_rectangle_aroud_cards(cards_location, main_image) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..0e118d4 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +opencv-python>=4.0 \ No newline at end of file