1

I have a simple colorful image taken by camera, and I need to detect some 'Red' circles inside of it very accurate.Circles have different radius and they should be distinguishable. There are some black circles in the photo also. Here is the procedure I followed: 1 - Convert from RGB to HSV 2 - Determining "red" upper and lower band:

lower_red = np.array([100, 50, 50])
upper_red = np.array([179, 255, 255])

3 - Create a mask. 4 - Applying cv2.GaussianBlur to smoothing the mask and noise reduction. 5 - Detecting remaining circles by using 'cv2.HoughCircles' on 'Mask' functions with different radius. (I have radius range)

Problem: When I create mask, the quality is not good enough, therefore Circles are detected wrong according to their radius. Attachments include main photo, mask, and detected circles. Anybody can help to set all pixels to black appart red pixels. Or in the other words, creating a high quality mask. Detedcted wrong circles

Blured Mask

Danial
  • 703
  • 1
  • 11
  • 26
  • 3
    You need also the other red interval, with H in [0, 10]. See [here](http://stackoverflow.com/questions/32522989/opencv-better-detection-of-red-color/32523532#32523532) – Miki Sep 18 '15 at 16:50
  • Perfect Miki . Perfect. – Danial Sep 18 '15 at 17:02
  • Possible duplicate of [OpenCV better detection of red color?](https://stackoverflow.com/questions/32522989/opencv-better-detection-of-red-color) – Paul Roub Oct 05 '17 at 19:14

0 Answers0