0
$\begingroup$

I have an image like this - I would like to smoothen the lines in this (as you can see they lines are a little jaggy.) How can I do this?

enter image description here

I obtained the lines by isolating them from another image using a mask to threshold a colour.

img_hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
sens = 20

lower_green = np.array([60 - sens, 100, 100])
upper_green = np.array([60 + sens, 255, 255])
mask = cv2.inRange(img_hsv, lower_green, upper_green)

output_img = img.copy()
output_img[np.where(mask == 0)] = 0
output_hsv = img_hsv.copy()
output_hsv[np.where(mask == 0)] = 0
bit_not = cv2.bitwise_not(output_hsv)
```
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.