我如何在iPhone上实现Matlab镂空/细化算法? [英] How would I implement the Matlab skeletonizing/thinning algorithm on the iPhone?

查看:146
本文介绍了我如何在iPhone上实现Matlab镂空/细化算法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何实现Matlab算法,该算法将在iPhone应用程序中对Objective-C中的二进制(黑色
和白色)图像进行骨架化/细化?

How can I implement the Matlab algorithm that will skeletonize / thin binary (black and white) images in Objective-C within an iPhone app?

推荐答案

基本上你可以使用morpholocial运算符...

Well basically you could use morpholocial operators for this...

构建八个命中或未命中运算符:

Build eight hit-or-miss operators like this:

      0 0 0
St1 = x 1 x  (for deleting upper pixels)
      1 1 1

旋转4次以获得4面。然后再建造4个这样的角落:

rotate this 4 times to get it for the 4 sides. Then also build 4 more ofr the corners like this:

      0 0 x
St5 = 0 1 1   (rotate this again 4 times for the 4 corners)
      x 1 1

然后你侵蚀你的形象(与循环)直到没有任何操作符可以再使用了...剩下的是该图像的骨架...

Then you erode your image (with loops) until none of the operators can be used anymore... what is left is the skeleton of that image...

这应该不会太难实现在目标CI猜测...(不熟悉它)......这是一般策略...

This shouldn't be too hard to implement in Objective C I guess... (not familiar with it) ... this is a general strategy...

希望有帮助......如果没有,请继续询问......; - )

Hope that helps... if not, keep asking... ;-)

这篇关于我如何在iPhone上实现Matlab镂空/细化算法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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