how to detect shapes in an image?

允我心安 提交于 2019-11-30 03:41:22

问题


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.


回答1:


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.




回答2:


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)



来源:https://stackoverflow.com/questions/5522771/how-to-detect-shapes-in-an-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!