如何使用代表点对复杂形状进行建模? [英] how to model complex shapes using representative points?

查看:198
本文介绍了如何使用代表点对复杂形状进行建模?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将此图像中的白色像素数量减少到输出图像中的某些候选点或代表点(目标是模拟不同类型的形状)







如果您只是将输出图像中的灰点连接在一起,则路径相同但白色像素较少。此路径应该只有一个起点和一个终点,并涵盖从开始到结束的所有路径。



我可以使用CCA(连通分量分析)解决它然后规则!但它似乎很慢。



我需要这个算法来减少描述形状所需的像素数量。



这里最快,最准确的算法是什么?



我也欢迎那些可以通过增加候选点来提高形状建模精度的方法。

解决方案


  • 对形状进行骨架化以获得单像素宽的路径(参见< a href =https://en.wikipedia.org/wiki/Topological_skeleton =nofollow noreferrer> https://en.wikipedia.org/wiki/Topological_skeleton )


  • 将路径表示为像素链。


  • 沿路径选择多个像素,有规律地间隔。


  • 通过这些点生成一个红衣主教样条(参见




通过调整偏差阈值,您可以交换曲线平滑度以获得匹配精度。



可以避免重新计算没有发生点插入的曲线,但这需要一些小心。


I want to reduce the amount of white pixels in this image to just some candidate or representative points in the output image (goal is to model different types of shapes)

if you just connect the gray points in the output image together you have the same path but with less white pixels. this path should have only one starting point and one ending point and covers all path from starting to ending.

I can solve it using CCA(connected component analysis) and some if then else rules ! but it seems slow.

I need this Algorithm to reduce the amount of pixels needed to describe shapes.

what is the fastest and accurate algorithm here ?

I also welcome those methods that can increase the accuracy of shape modeling by increasing the candidate points.

解决方案

  • skeletonize the shape to get a single-pixel-wide path (see https://en.wikipedia.org/wiki/Topological_skeleton)

  • represent the path as a chain of pixels.

  • select a number of pixels along the path, regularly spaced.

  • generate a Cardinal spline through these points (see https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline). A cubic spline is also possible.

  • for every section of the spline, estimate the deviation between the path in the image and the curve. This can be done by sampling a few points along the curve and finding the closest point on the section of the path (by trying all pixels).

  • when the deviation is too large, add one or more pixels in that section.

  • recompute the whole spline and repeat, until you don't need to insert points anymore.

By adjusting the deviation threshold, you can trade curve smoothness for matching accuracy.

It is possible to avoid recomputing the curve where no point insertion occurred, but this requires some care.

这篇关于如何使用代表点对复杂形状进行建模?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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