在python opencv中为像素着色 [英] Color a pixel in python opencv

查看:111
本文介绍了在python opencv中为像素着色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要为图像中的像素着色.我使用opencv和python.
我试过img[x,y]=[255 255 255]pixel(x,y)着色,但它不起作用:(

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?

提前谢谢.

推荐答案

img[x,y]=[255, 255, 255]是错误的,因为opencv img [a,b]是一个矩阵,则需要更改x,y,然后必须使用img [y,x ]

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]

按照x,y的顺序进行错误计算 如果要更改点x的颜色,请使用>> >> img[y,x] = color

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

这篇关于在python opencv中为像素着色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆