Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Color a pixel in python opencv

I need to color a pixel in an image. I use opencv and python.
I tried img[x,y]=[255 255 255] to color a pixel(x,y) but it wont work :(

Is there is any mistake in this?
Can you suggest any method?

Thanks in advance.

like image 255
Prasika Avatar asked Jul 17 '26 22:07

Prasika


1 Answers

img[x,y]=[255, 255, 255] is wrong because opencv img[a,b] is a matrics then you need to change x,y then you must use img[y,x]

actualy mistake in the order of x,y if you want to change color of point x,y use this >> img[y,x] = color

like image 81
dinuka saminda Avatar answered Jul 20 '26 11:07

dinuka saminda