简体   繁体   中英

how to detect shapes in an image?

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.

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.

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 )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM