(image)
| 3 | |
| 4 | |
| 5 | def 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 | |
| 14 | def canny_demo(image): |