matlab的imregionalmax()和scipy.ndimage.filters.maximum_filter有什么区别 [英] What is the difference between imregionalmax() of matlab and scipy.ndimage.filters.maximum_filter

查看:555
本文介绍了matlab的imregionalmax()和scipy.ndimage.filters.maximum_filter有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要找到图像的区域最大值,以获得用于分水岭分割的前景标记.我在matlab中看到使用功能 imregionalmax() .由于我没有Matlab软件,因此我使用了

I need to find the regional maxima of an image to obtain foreground markers for watershed segmentation. I see in matlab use the function imregionalmax(). As I don't have the matlab software, I use the function scipy.ndimage.filters.maximum_filter() instead. However, the results from imregionalmax() and scipy.ndimage.filters.maximum_filter() are different.

请帮助我如何找出图像的区域最大值.非常感谢您的帮助.

Please help me how to find out the regional maxima of an image. Thanks very much for your help.

推荐答案

似乎scipy的maximum_filter返回实际的局部最大值,而Matlab的imregionalmax返回具有位置的蒙版局部最大值的
我希望

It appears as if scipy's maximum_filter returns the actual local max values, while Matlab's imregionalmax returns a mask with the locations of the local maxima.
I would expect

 lm = scipy.ndimage.filters.maximum_filter( img, ... )
 msk = (img == lm) #// convert local max values to binary mask

应该给您与Matlab相似的结果.

should give you similar results to Matlab's.

这篇关于matlab的imregionalmax()和scipy.ndimage.filters.maximum_filter有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆