使用OpenCV调整对比度和亮度 [英] Adjusting contrast and brightness with OpenCV

查看:1223
本文介绍了使用OpenCV调整对比度和亮度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我试图增加对比度和亮度与OpenCV有点。这是我在做什么:

So I am trying to increase both contrast and brightness with OpenCV a bit. This is what I am doing:

Mat image_copy;
cvtColor(image, image_copy, CV_BGRA2BGR);
image_copy.convertTo(image, -1, 1.3, 0.15);

图片我觉得很奇怪。它有蓝色色调。红色和蓝色被反转。因此,我的红色跳线是蓝色的,桌面上的蓝色可以是红色的。

Image I get though looks very strange. It has blue tint. Red and blue colours are inverted. So my red jumper is blue and a blue can on the table is red.

为什么?

基本上试图实现与当您将对比度设置为30和亮度为15这里相同的效果:

I am basically trying to achieve the same effect as when you set contrast to 30 and brightness to 15 here:

http://camanjs.com/examples/

推荐答案

OpenCV有一个完整的页面:更改图片的对比度和亮度!

OpenCV has an entire page on the subject: Changing the contrast and brightness of an image!

这篇关于使用OpenCV调整对比度和亮度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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