MCPcopy Create free account
hub / github.com/KingFuRong/pythonSpider / cut_slide

Function cut_slide

AutoSign/laowang.py:32–42  ·  view source on GitHub ↗
(image_path)

Source from the content-addressed store, hash-verified

30
31
32def cut_slide(image_path):
33 image = cv2.imread(image_path)
34 gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
35 _, thresh = cv2.threshold(gray, 50, 255, cv2.THRESH_BINARY)
36 contours, _ = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
37
38 for cnt in contours:
39 x, y, w, h = cv2.boundingRect(cnt)
40 image = image[y:y + h, x:x + w]
41
42 cv2.imwrite('./slide.png', image)
43
44
45def pass_captcha():

Callers 1

pass_captchaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected