Ask Your Question

Revision history [back]

how to follow a pix value by checking the neighbors 3x3 in x,y imread()

i have a black image with blue lines i did this this to turn each blue pix into red pix

img=cv2.imread("bluelines.jpg")
for x in range (0, width+1)
      cv2.imshow("title",img) 
      for y in range (0,height+1)
             if img[x,y,0]>45:
                img[x,y,0]=0
                img[x,y,2]=255
                cv2.waitKey(1)
cv2.destroyAllWindows()

This worked very well u can see the pixels changing every thing is fine but i want to turn every blue line into red by following the line i mean by checking each neighbor