2

I'm trying to detect an object composed of other objects. Actualy, there are three circles in my binary image which shape up a triangle as shown here:

Points

These circles are correctly detected, but only as single objects as shown here:

Separate detection

What I need to have is an aggregation or composition of these objects, so they get detected as one big object as shown here:

Single object detection

The bigger goal is to get the image moments to get the rotation and scale of the shape. Please share your ideas or code if you have any, it would be well appreciated.

Roberto
  • 713
  • 8
  • 14

2 Answers2

0

I would suggest using the bounding box functions of opencv

Here is a link to an example of bounding box in C++ OpenCV, however if you are using something like Python, it might be worth your while looking at this link, which is a full set of tutorials for working with binary images and contours (including bounding box/elipse)

Again if you are using the Python port, look at this set of tutorials, they really are great and have a massive supply of information on most functions of OpenCV.

Hope this helps.

Good luck.

Aphire
  • 1,621
  • 25
  • 55
0

Your question is very similar to this question, which has answers with code examples. Alternatively check the documentation of OpenCV. If you are interested in the convex hull of your points, see cv::convexHull().

Community
  • 1
  • 1
nils
  • 2,424
  • 1
  • 17
  • 31