首页 > 编程语言 >isp 图像算法(四)之white balance gain control 就是对 r,gr,gb,b 进行加权

isp 图像算法(四)之white balance gain control 就是对 r,gr,gb,b 进行加权

时间:2023-01-25 21:03:28浏览次数:108  
标签:control gr img self isp gb awb gain


​代码在git​

[r_gain, gr_gain, gb_gain, b_gain]
Out[5]: [1.5, 1.0, 1.0, 1.1]

rgb 矩阵

gb

b

r

gr

权重矩阵

gb_gain

b_gain

r_gain

gr_gain

for y in range(0, raw_h-1, 2):
for x in range(0, raw_w-1, 2):
if self.bayer_pattern == 'rggb':
r = self.img[y,x] * r_gain
gr = self.img[y,x+1] * gr_gain
gb = self.img[y+1,x] * gb_gain
b = self.img[y+1,x+1] * b_gain
awb_img[y,x] = r
awb_img[y,x+1] = gr
awb_img[y+1,x] = gb
awb_img[y+1,x+1] = b


标签:control,gr,img,self,isp,gb,awb,gain
From: https://blog.51cto.com/u_15202985/6022899

相关文章