0
点赞
收藏
分享

微信扫一扫

opencv(c++)灰度变换和直方图修正模块------灰度变换(线性变换,非线性变换)和直方图修正

看山远兮 2022-04-26 阅读 60
c++

1.灰度变换

通常有3种方法对彩色图灰度化。
<1>加权平均值
D=0.299xR+0.587xG+0.114xB;
<2>取最大值法
D=max(R,G,B);
<3>平均值法
D=(R+G+B)/3

1.1平均值法

//平均值法
void rgb2gray(Mat& input, Mat& out) {
   
	for (int i = 0; i < input
举报

相关推荐

0 条评论