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

Function method_3

python/code_045/opencv_045.py:18–22  ·  view source on GitHub ↗
(image)

Source from the content-addressed store, hash-verified

16
17
18def method_3(image):
19 blurred = cv.pyrMeanShiftFiltering(image, 10, 100) # 先均值迁移去噪声
20 gray = cv.cvtColor(blurred, cv.COLOR_BGR2GRAY)
21 t, binary = cv.threshold(gray, 0, 255, cv.THRESH_BINARY | cv.THRESH_OTSU)
22 return binary
23
24
25src = cv.imread("coins.jpg")

Callers 1

opencv_045.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected