-2

I want to find contours on the image below (white bubbles). The problem is that when I convert the image to gray with the standard way:

   gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)

I do not see them (second image). Is it possible to change the conversion some how? Thank you for any help

enter image description here

enter image description here

sgarizvi
  • 16,623
  • 9
  • 64
  • 98
Mariia
  • 21
  • 8

3 Answers3

1
import cv2
img = cv2.imread("WNrrP.png")
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
cv2.imshow("h",img)
cv2.waitKey()

This works correctly for me

Inyoung Kim 김인영
  • 1,434
  • 1
  • 17
  • 38
0

Works perfectly fine for me. Please insure that visualisation code is correct. Here is a screenshot of the my code which I ran to test your images. Screenshot of code.

0

the problem was in the different line before. The cvtColor works fine

Mariia
  • 21
  • 8