資源簡介
Chan-Vese分割,python,代碼,
代碼片段和文件信息
import?numpy?as?np
import?matplotlib.pyplot?as?plt
import?cv2?as?cv
from?skimage.segmentation?import?chan_vese
image?=?cv.imread(‘H:/MRI1/12.jpg‘0)
image?=?np.float32(image)
#?Feel?free?to?play?around?with?the?parameters?to?see?how?they?impact?the?result
cv?=?chan_vese(image?mu=0.25?lambda1=1?lambda2=1?tol=1e-3?max_iter=100
???????????????dt=0.5?init_level_set=“checkerboard“?extended_output=True)
fig?axes?=?plt.subplots(2?2?figsize=(8?8))
ax?=?axes.flatten()
a
評論
共有 條評論