MCPcopy Create free account
hub / github.com/JimmyHHua/opencv_tutorials / threshold_demo

Function threshold_demo

python/code_048/opencv_048.py:5–11  ·  view source on GitHub ↗
(image)

Source from the content-addressed store, hash-verified

3
4
5def threshold_demo(image):
6 # 去噪声+二值化
7 dst = cv.GaussianBlur(image,(3, 3), 0)
8 gray = cv.cvtColor(dst, cv.COLOR_BGR2GRAY)
9 ret, binary = cv.threshold(gray, 0, 255, cv.THRESH_OTSU | cv.THRESH_BINARY)
10 cv.imshow("binary", binary)
11 return binary
12
13
14def canny_demo(image):

Callers 1

opencv_048.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected