[英]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 .我基本上是在他们的网站上使用 skimage 关于 morphological_geodesic_active_contour 的教程。 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:编辑:作为变形 GAC 的参数,我使用了以下内容:
morphological_geodesic_active_contour(gimage, 50, init_ls,
smoothing=1, balloon=-1,
threshold=.9,
iter_callback=callback)
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.事实证明,在运行实际算法之前执行的步骤gimage = inverse_gaussian_gradient(im)
有一个参数sigma
来控制所应用的平滑。 By default, this is at sigma=5, but changing it to sigma=0.7 allows the GAC algorithm to get into the corners better.默认情况下,这是 sigma=5,但将其更改为 sigma=0.7 可以让 GAC 算法更好地进入角落。
See the image for details.有关详细信息,请参阅图像。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.