实验五第二题

This commit is contained in:
2024-11-16 19:22:43 +08:00
parent 8dc570f602
commit 7d922845cf
2 changed files with 38 additions and 2 deletions
+2 -2
View File
@@ -6,8 +6,8 @@
# 5、生成二值图像:根据阈值的应用结果,将低于阈值的像素设置为一个固定的值(例如0),将高于阈值的像素设置为另一个固定的值(例如255),从而生成二值图像。
# 6、后处理(可选):根据实际需求,可以对生成的二值图像进行后处理操作,例如去除噪声、填充空洞等。
import numpy as np;
import cv2 as cv;
import numpy as np
import cv2 as cv
img=cv.imread('test1.png',cv.IMREAD_GRAYSCALE)
cv.imshow('img',img)