Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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/
Expand Down
4 changes: 2 additions & 2 deletions part_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
draw_rectangle_aroud_cards(cards_location, main_image)
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
opencv-python>=4.0