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
careful, you're already out of bounds, it must be:
(numpy will silently "wrap over" so you don't even get an error !)
and if you want to use a 3x3 neihbourhood, it must be:
There are 2 syntax errors. You left out semi_colon in both range. This doesn't work for OpenCV4. I need to see to completed code. As I do not have blueline.jpg. As you can post image.\