如何检测线/曲线中的位图? ( C# ) [英] How to detect a line/curve in a bitmap? ( C# )

查看:286
本文介绍了如何检测线/曲线中的位图? ( C# )的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我已经从激光扫描等位图从它的激光一条红线,这将是正确的方式找到该行的中心?无论是存储它的坐标在一个数组或只是画一想行权。

Suppose I have such bitmap from laser scanning with a red line from the laser on it, what would be the right way to find the center of that line? Either to store its coordinates in an array or to just draw a think line over it.

有什么办法? pferebly $ P $的选项,以便能够顺利出该行。

What approach would you suggest? Preferebly with an option to be able to smooth out that line.

感谢

推荐答案

我会处理这一个蠕虫病毒。有你的蠕虫开始的一个像素,并允许其沿着线移动。您检测方向的改变在任何尺寸每次放置点。然后通过你的观点适合样条曲线。添加的开始和结束的位置作为点太。

I would approach this with a worm. Have your worm start on one pixel and allow it to move along the line. Every time you detect a change in direction in any dimension you place a point. Then fit a spline through your points. Add the start and end locations as points too.

重要的问题:

  • 您需要保持它的像素已被访问,这样,当蠕虫完成后,你可以发现,如果你需要开始对什么是留下了一个新的。
  • 您需要维持在此基础上在蠕虫和重量更多钞票着选择的速度矢量会更紧密地继续行需要的资料目前。这是因为...
  • 您需要处理拓扑结构的变化,那就是你有两条或多条线相交的相同点。或在分割线一分为二。

有关装修花键本身对的NuGet

For fitting the spline itself have a look at Numerics on NuGet

这篇关于如何检测线/曲线中的位图? ( C# )的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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