简体   繁体   中英

How to make skimage´s active contour get pushed into the corners

I am basically using skimage´s tutorial on morphological_geodesic_active_contour from their website . I am very happy with the results I already got, but I would prefer a result where the contour gets even pulled (or pushed) into the very edges of the circle.

In case you want to replicate the circle I created, here´s the code (the remaining code is from the above linked website):

im = np.zeros((100, 100))
for i in range(100):
    for j in range(100):
        if (i - 50) ** 2 + (j - 50) ** 2 <= 400:
            im[i, j] = 1.0
im[50:80, 50:80] = 0.0

I´d appreciated any help on that!

EDIT: As parameters for the morph GAC I used the following:

morphological_geodesic_active_contour(gimage, 50, init_ls,
                                      smoothing=1, balloon=-1,
                                      threshold=.9,
                                      iter_callback=callback)

Skiamge 的形态学 GAC 分割

It turns out, that the step gimage = inverse_gaussian_gradient(im) that is executed prior to running the actual algorithm has a parameter sigma that controls the smoothing being applied. By default, this is at sigma=5, but changing it to sigma=0.7 allows the GAC algorithm to get into the corners better.

See the image for details.

调整 sigma 后的 GAC 结果

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM