如何检测图像中的形状?
我想在图像中检测一个圆形,矩形形状的对象,并从该对象中读取信息。 Java中是否有任何API对我有帮助?
例如:在白色背景中检测到圆形硬币,并获取有关硬币喜欢的信息(硬币的价值等),
谢谢。
I want to detect a circle, rectangle shaped object in an image and read the information from that object. Is there any api in java which will be helpful to me?
Ex: Detect a round shaped coin in a white background and obtain information about that that coin like ( value of a coin, etc.)
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下是类似问题的答案 C++ 的问题。
对于 Java,您可以使用 OpenCV 包装器。但是,一旦您了解了该方法的本质,您应该能够使用任何可用的框架来解决您的问题。
Here's an answer to a similar question for C++.
For Java, you can use the OpenCV wrappers. However, once you understand the essence of the approach you should be able to solve your problem using whichever framework is available.
圆圈是霍夫变换的完美目标。看看检测圆圈HT 和 OpenCV
矩形有点难,因为霍夫变换不是旋转不变的。您可以进入边缘检测和快速拟合(通过聚类和分组进行快速直线和矩形检测 )
Circles are perfect targets for the Hough transform. Check this out Detect circles with HT and OpenCV
Rectangles are a bit harder since the Hough Transform is not rotation invariant. You can go into edge detection and fast fitting (Fast line and rectangle detection by clustering and grouping)