几个 matlab 图像处理函数的等效 python 函数
以下每个函数是否都有等效的 python 函数(可能在 PIL 中? ):
边缘(图像, '精明')
strel('线',..)
strel('钻石',1)
imdilate(...)
imfil(...)
imerode(...)
medfilt2(... )
我所有的模拟代码都在python,但不是IC一代!我想将我的 IC 生成转换为 python,这样我就不必每次运行 sim 时都运行 matlab。
谢谢,
泰勒米勒
Is there an equivalent python function for each of the following (maybe in the PIL??):
edge(image, 'canny')
strel('line',..)
strel('diamond',1)
imdilate(...)
imfil(...)
imerode(...)
medfilt2(...)
All of my simulation code is in python, but not the IC generation! I wanna get my IC generation into python so I don't have to run matlab every time I run a sim.
Thanks,
tylerthemiler
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Python 有很多图像处理库,尽管它们分布在多个包中:
只需浏览文档页面并查找与您列出的每个函数等效的函数即可。我想你会发现 OpenCV 中提供了边缘检测、形态学操作、洪水填充和过滤功能(这是迄今为止最全面的)。
注意:它们并不全部彼此兼容(有些使用 NumPy 来存储图像,有些使用 NumPy 来存储图像)不)。
There are lots of image processing libraries for Python, though they are spread across a number of packages:
Just go through the documentation pages and look for an equivalent to each of the functions you listed. I think you will find edge detection, morphological operations, flood filling, and filtering functions all available in OpenCV (which is by far the most comprehensive)
Note: they are not all compatible with each other (some use NumPy to store the images, others don't).
阅读 PIL,看起来它有一些对于实现精明过滤器很有用的函数。形态侵蚀/扩张功能显然不可用。
这应该可以帮助您开始实现自己的精明过滤器。它在垂直和水平方向上执行索贝尔滤波器。这样你就完成了算法的大约一半。从那里,您将需要在(宽度,高度)上迭代(x,y)并抑制非最大边缘。维基百科有一个很好的解释 http://en.wikipedia.org/wiki/Canny_edge_detector
PIL 是python 的首选图像处理工具包?看起来它需要一些贡献
Reading PIL, it looks like it has a few functions that will be useful for implementing a canny filter. The morphological erode/dilate functions are apparently not available.
This should get you started on implementing your own canny filter. It performs a sobel filter in the vertical and horizontal directions. That gets you about halfway through the algorithm. From there, you will need to iterate (x,y) over (width,height) and suppress non-maximum edges. Wikipedia has a good explanation http://en.wikipedia.org/wiki/Canny_edge_detector
Is PIL the preferred image processing toolkit for python? it looks like it could use some contributions