9

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.

skaffman
  • 398,947
  • 96
  • 818
  • 769
Manoj
  • 5,707
  • 19
  • 56
  • 86
  • This is something i did in my artificial intelligence course. We did something similar like detecting the #7 in an image, distinguishing faces, etc. but we used Python. Or maybe use the Canny Edge Detection algorithm? – Matthew Apr 02 '11 at 11:16

2 Answers2

4

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.

Community
  • 1
  • 1
mpenkov
  • 21,621
  • 10
  • 84
  • 126
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)

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
code-gijoe
  • 6,949
  • 14
  • 67
  • 103