如何在opencv python中更改图像照度 [英] how to change image illumination in opencv python

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

问题描述

我正在python opencv中读取图像,现在我需要将此图像上的照明更改为更暗或更亮,我应该使用哪种方法启用此功能?

I am reading a image in python opencv, now I need to change the illumination on this image to be darker or lighter, what kind of method I should use to enable this?

推荐答案

我认为您可以使用opencv完成此操作.这是我的建议

I think you can done this with opencv. Here is my suggestion

import cv2
import numpy as np

img1 = cv2.imread('abc.jpg')
a = np.double(img1)
b = a + 15
img2 = np.uint8(b)
cv2.imshow("frame",img1)
cv2.imshow("frame2",img2)
cv2.waitKey(0)
cv2.destroyAllWindows()

在这里,我增加了图像的亮度.如果使用减法将使颜色变深.

Here i increased the brightness of image. If you use subtraction that will makes darker.

这篇关于如何在opencv python中更改图像照度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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