# How to fix black strokes for contour detection

**URL:** <https://forum.opencv.org/t/how-to-fix-black-strokes-for-contour-detection/16601>\
**Category:** Uncategorized\
**Created:** [February 25, 2024, 10:08pm UTC](https://forum.opencv.org/t/how-to-fix-black-strokes-for-contour-detection/16601 "2024-02-25T22:08:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gonzalo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/gonzalo/32/9799_2.png) [@Gonzalo](https://forum.opencv.org/u/Gonzalo)\
**Post date:** [February 25, 2024, 10:08pm UTC](https://forum.opencv.org/t/how-to-fix-black-strokes-for-contour-detection/16601/1 "2024-02-25T22:08:28Z")

</div>

Hello, I’m new with openCV and I don’t know how to approach this problem.  
I have some pictures for detect circles but the stroke seem to be so thin so I guess a dilate operation need to be performed.

I’ve tried HoughCircles but do not detect the circles, so I’m trying to detect it using findContours.  
The problem is that the contour of a circle is being detect as several contours because it stroke is not smooth.

There is a way/process to dilate a black stroke and then smooth it?

Here is a picture example of a circle part and its detected contour

![image](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/c/cfe1431e4f0f5d30d79e2054c580141b0f677ce5.png)
