从点的ArrayList的Java识别圈 [英] java circle recognition from an arraylist of points

查看:131
本文介绍了从点的ArrayList的Java识别圈的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在有个从画布上徒手画一个ArrayList。我在想,如果有一个简单的算法,如果形状重新presents一个circle.I检测已经研究了这一点,我指着主要项目要么Hough变换或有位图图像,但是这两种似乎有点过顶什么,我需要它。任何指针算法或实现将是非常有益的。

I currently have an arraylist of points from a freehand drawing on a canvas. I was wondering if there is a simple algorithm to detect if that shape represents a circle.I have already researched this a little and the main items I am pointed at are either the Hough transform or having bitmap images but both of these seem a little over the top for what I need it for. Any pointers to algorithms or implementation would be very helpful.

在此先感谢sansoms,

thanks in advance sansoms,

推荐答案

如果您不知道用户想画(例如,圆形,椭圆形,线或矩形),你可以使用一些基本的东西优化算法来找到最佳的形状相匹配的手绘分。

If you do not know what the user wanted to draw (e.g., a circle, an ellipse, a line, or a rectangle), you could use some basic optimization algorithm to find the shape best matching the hand-drawn points.


  • 对于每个基本的形状(椭圆形,矩形,三角形,线等),创建形状的随机实例和测量误差w.r.t.给定的点

  • 优化每个形状(单独),直到你有最好的匹配给定的点,矩形的最佳匹配点,最好三角形等。
  • 椭圆形
  • 挑选具有最低错误的形状和绘制

这篇关于从点的ArrayList的Java识别圈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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