CN102395035A - 一种智能摄像机白平衡处理方法 - Google Patents

一种智能摄像机白平衡处理方法 Download PDF

Info

Publication number
CN102395035A
CN102395035A CN2011103732050A CN201110373205A CN102395035A CN 102395035 A CN102395035 A CN 102395035A CN 2011103732050 A CN2011103732050 A CN 2011103732050A CN 201110373205 A CN201110373205 A CN 201110373205A CN 102395035 A CN102395035 A CN 102395035A
Authority
CN
China
Prior art keywords
gain
raw
ave
data
max
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2011103732050A
Other languages
English (en)
Other versions
CN102395035B (zh
Inventor
杨云飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Itarge Technology Co ltd
Original Assignee
BEIJING ITARGE SOFTWARE TECHNOLOGIES DEVELOPMENT Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BEIJING ITARGE SOFTWARE TECHNOLOGIES DEVELOPMENT Co Ltd filed Critical BEIJING ITARGE SOFTWARE TECHNOLOGIES DEVELOPMENT Co Ltd
Priority to CN 201110373205 priority Critical patent/CN102395035B/zh
Publication of CN102395035A publication Critical patent/CN102395035A/zh
Application granted granted Critical
Publication of CN102395035B publication Critical patent/CN102395035B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Processing Of Color Television Signals (AREA)
  • Color Television Image Signal Generators (AREA)

Abstract

本发明公开了一种智能摄像机白平衡处理方法,其步骤包括采集摄像机图像传感器所采集的12位RAW数据并将其划分为R、G、B三原色通道下的RAW数据后对其进行两次校正处理。本发明所提出的方法准确检测拍摄现场数据并对数据进行精确处理,降低了相机芯片的运算量,准确的反映了外界环境的实际情况,提高了拍摄质量。

Description

一种智能摄像机白平衡处理方法
技术领域
本发明涉及交通监控拍摄技术领域,尤其是涉及一种调节交通摄像机白平衡的智能摄像机白平衡处理方法。
背景技术
白平衡技术在摄影摄像领域有十分重要的意义,对于所拍摄的物体的色彩还原以及保真度巨大的影响。目前应用到智能交通上面的相机采用的白平衡算法存在以下缺点:1、在强光和逆光的环境下摄像机中的白平衡算法失去效果,相机采集的图像出现过爆和颜色偏移现象;2、在阴天和傍晚的时候相机中的白平衡算法出现色温偏移,出现杂色等。从相机白平衡技术和相机中的数据运算过程分析产生以上效果的原因主要包括如下几点:1、目前应用到智能交通系统中的相机采用的白平衡算法不是专业针对智能交通系统做的白平衡算法;2、目前应用到智能交通系统中的相机中的白平衡算法采取的数据是8位二进制数据做采样数据进行运算,运算数据量长度不够精确,环境采样数据不够准确;3、目前应用到智能交通上的相机很多不能对每一帧图像上的每个像素点进行运算,采样数据不能够准确地反应实时的外界环境情况。 
发明内容
为了弥补上述智能交通摄像机上所采用的白平衡算法针对性不强、不专业,运算数据量长度不够精确,环境采样数据不够准确,不能对每一帧图像上的每个像素点进行运算的缺陷,本发明提出了一种智能摄像机白平衡处理方法。
其技术方案包括以下步骤:
(1)摄像机的CMOS或CCD图像传感器对一帧图像进行采集,每个像素点分别采集到12位RAW数据;
(2)将步骤(1)中采集到的RAW数据进行双线性差值运算,使RAW数据转换为R、G、B通道下的RAW图像数据RAW_R、RAW_G、RAW_B;
(3)对步骤(2)中得到的RAW_R数据进行分块处理,将原来R通道中高H像素、宽L像素的RAW_R数据划分为n个高H1像素、宽L1像素的数据块(n>2,H1>2,L1>2);
(4)对步骤(3)中每个数据块左上角的2X2个像素的不饱和度求取平均值G,累加各个数据块的平均值G1-Gn,得S=G1+G2+……+Gn,计算出RAW_R的不饱和度平均值R_ave=S/n;
(5)分别采用步骤(3)和步骤(4)的方法对RAW_G和RAW_B进行计算,得到RAW_G和RAW_B的不饱和度平均值G_ave和B_ave,然后按照公式Max_ave=max[R_ave  G_ave  B_ave]求取三个通道中的不饱和度最大平均值Max_ave;
(6)利用步骤(5)所得到的Max_ave再与R_ave、G_ave和B_ave相结合分别运算RAW_R、RAW_G和RAW_B得一级校正参数gain_R_1、gain_G_1、gain_B_1;
(7)根据已设定的摄像机白平衡参数确定R、G、B各通道的修正参数gain_R_min、gain_G_min和gain_B_min,利用上述各修正参数再次对步骤(6)的一级校正参数做二级校正运算,得到二级校正参数gain_R_2、gain_G_2、gain_B_2;
(8)利用步骤(7)中得到的二级校正参数对RAW_R、RAW_G和RAW_B进行二级校正,得到二级校正后三通道下的RAW数据RAW_R2、RAW_G2和RAW_B2;
(9)将步骤(8)中得到的RAW_R2、RAW_G2和RAW_B2进行移位运算,使其变成可以显示的图像输出。
在上述步骤(6)中确定一级校正参数gain_R_1、gain_G_1、gain_B_1的运算规则为:gain_R_1=R_ave/Max_ave;gain_G_1=G_ave/Max_ave;gain_B_1=B_ave/Max_ave。
在上述步骤(7)中确定二级校正参数gain_R_2、gain_G_2、gain_B_2,的运算规则为:当gain_R_1<gain_R_min时,gain_R_2=gain_R_min;当gain_R_1>gain_R_min时,gain_R_2=gain_R_1;当gain_G_1<gain_G_min时,gain_G_2=gain_G_min;当gain_G_1>gain_G_min时,gain_G_2=gain_G_1;当gain_B_1<gain_B_min时,gain_R_2=gain_B_min;当gain_B_1<gain_B_min时,gain_R_2=gain_B_1。
在上述步骤(8)中进行二级校正后得到三通道下RAW数据RAW_R2、RAW_G2和RAW_B2的校正规则为:RAW_R2= RAW_R*gain_R_2;RAW_G2= RAW_G*gain_G_2;RAW_B2= RAW_B*gain_B_2。
摄像机的白平衡参数有手动和自动两种设定方式,可以按照实际环境需要由摄像机自行设定或人为设定。
本发明是在摄像机中的CCD或者CMOS传感器输出的raw数据的基础上进行处理的,因此数据更加准确,更能准确的检测实时场景数据。对检测到的raw数据进行分块统计处理,大大降低了相机芯片的运算量,而且能够准确的检测出当时实际的环境。在运算过程中对RAW数据进行白平衡采用一级软校正和二级硬校正两种方式同时对采集到的数据进行处理,这样大大的增加了校正后的数据的可靠性。因为本发明是直接处理的是raw数据,所以能够直接通过配置硬件寄存器的方式硬件实现,这样大大的提高了数据的运算速度。
附图说明
图1为本发明的一种实施方式的流程示意图。
具体实施方式
下面结合附图对本发明做进一步说明。
参照图1,本发明的一种实施方式的一个流程。在本次实施方式中,
(1)由摄相机采集现场一帧RAW数据。开启摄像机,由摄像机的CCD或CMOS图像传感器对一帧图像RAW数据进行采集,分别采集图像传感器上每个像素点所接收到的12位RAW数据。
(2)对采集到的数据进行运算和转换。将步骤(1)中采集到的RAW数据进行双线性差值运算,把RAW数据转换为R、G、B通道下的RAW图像数据RAW_R、RAW_G、RAW_B;将原始的RAW数据划分为三原色通道下的RAW数据,为后期处理做准备。
(3)将RAW_R、RAW_G和RAW_B进行分块处理。以RAW_R为例,对步骤(2)中得到的RAW_R数据进行分块处理,将原来R通道中高H像素、宽L像素的RAW_R数据划分为n个高H1像素、宽L1像素的数据块(n>2,H1>2,L1>2)。
(4)分别求取RAW_R、RAW_G和RAW_B的不饱和度平均值。以RAW_R为例,依次对步骤(3)中R通道下每个数据块左上角的2X2个像素的不饱和度求取平均值,得到该数据块内该4个像素的平均值G,累加各个数据块的平均值G1-Gn,得S=G1+G2+……+Gn,然后计算RAW_R的不饱和度平均值R_ave=S/n;
(5)求取R、G、B三通道RAW数据的不饱和度最大平均值。采用步骤(3)和步骤(4)的方法依次对RAW_R、RAW_G和RAW_B进行计算,得到不饱和度均值R_ave、G_ave和B_ave,然后按照公式Max_ave=max[R_ave  G_ave  B_ave],求取三个通道中的不饱和度最大平均值Max_ave;
(6)利用步骤(5)所得到的Max_ave再与R_ave、G_ave和B_ave相结合分别运算RAW_R、RAW_G和RAW_B得一级校正参数gain_R_1、gain_G_1、gain_B_1;
(7)根据已设定的摄像机白平衡参数确定R、G、B各通道的修正参数gain_R_min、gain_G_min和gain_B_min,利用上述各修正参数再次对步骤(6)的一级校正参数做二级校正运算,得到二级校正参数gain_R_2、gain_G_2、gain_B_2;
(8)利用步骤(7)中得到的二级校正参数对RAW_R、RAW_G和RAW_B进行二级校正,得到二级校正后三通道下的RAW数据RAW_R2、RAW_G2和RAW_B2;
(9)将校正后数据转换为可视图像输出。将步骤(8)中得到的RAW_R2、RAW_G2和RAW_B2进行移位运算,使其由12为RAW数据变成可以显示的8位RGB图像输出。
在上述步骤(6)中确定一级校正参数gain_R_1、gain_G_1、gain_B_1的运算规则为:gain_R_1=R_ave/Max_ave;gain_G_1=G_ave/Max_ave;gain_B_1=B_ave/Max_ave。
在上述步骤(7)中确定二级校正参数gain_R_2、gain_G_2、gain_B_2,的运算规则为:当gain_R_1<gain_R_min时,gain_R_2=gain_R_min;当gain_R_1>gain_R_min时,gain_R_2=gain_R_1;当gain_G_1<gain_G_min时,gain_G_2=gain_G_min;当gain_G_1>gain_G_min时,gain_G_2=gain_G_1;当gain_B_1<gain_B_min时,gain_R_2=gain_B_min;当gain_B_1<gain_B_min时,gain_R_2=gain_B_1。
在上述步骤(8)中进行二级校正后得到三通道下RAW数据RAW_R2、RAW_G2和RAW_B2的校正规则为:RAW_R2= RAW_R*gain_R_2;RAW_G2= RAW_G*gain_G_2;RAW_B2= RAW_B*gain_B_2。
在摄像机的白平衡参数设定中,有手动和自动两种,可以按照实际环境需要由摄像机自行设定或人为设定。
以上所述,为发明的较佳实施案例,并非对本发明作任何限制,凡是根据本发明技术实质对以上实施例所作的任何简单修改、变更以及等效结构变化,均仍属于本发明技术方案的保护范围内。

Claims (5)

1.一种智能摄像机白平衡处理方法,其特征在于,该方法包括以下步骤:
(1)摄像机的CMOS或CCD图像传感器对一帧图像进行采集,每个像素点分别采集到12位RAW数据;
(2)将步骤(1)中采集到的RAW数据进行双线性差值运算,使RAW数据转换为R、G、B通道下的RAW图像数据RAW_R、RAW_G、RAW_B;
(3)对步骤(2)中得到的RAW_R数据进行分块处理,将原来R通道中高H像素、宽L像素的RAW_R数据划分为n个高H1像素、宽L1像素的数据块(n>2,H1>2,L1>2);
(4)对步骤(3)中每个数据块左上角的2X2个像素的不饱和度求取平均值G,累加各个数据块的平均值G1-Gn,得S=G1+G2+……+Gn,计算出RAW_R的不饱和度平均值R_ave=S/n;
(5)分别采用步骤(3)和步骤(4)的方法对RAW_G和RAW_B进行计算,得到RAW_G和RAW_B的不饱和度平均值G_ave和B_ave,然后按照公式Max_ave=max[R_ave  G_ave  B_ave]求取三个通道中的不饱和度最大平均值Max_ave;
(6)利用步骤(5)所得到的Max_ave再与R_ave、G_ave和B_ave相结合分别运算RAW_R、RAW_G和RAW_B得一级校正参数gain_R_1、gain_G_1、gain_B_1;
(7)根据已设定的摄像机白平衡参数确定R、G、B各通道的修正参数gain_R_min、gain_G_min和gain_B_min,利用上述各修正参数再次对步骤(6)的一级校正参数做二级校正运算,得到二级校正参数gain_R_2、gain_G_2、gain_B_2;
(8)利用步骤(7)中得到的二级校正参数对RAW_R、RAW_G和RAW_B进行二级校正,得到二级校正后三通道下的RAW数据RAW_R2、RAW_G2和RAW_B2;
(9)将步骤(8)中得到的RAW_R2、RAW_G2和RAW_B2进行移位运算,使其变成可以显示的图像输出。
2.根据权利要求1所述的智能摄像机白平衡处理方法,其特征在于,步骤(6)中确定一级校正参数gain_R_1、gain_G_1、gain_B_1的运算规则为:gain_R_1=R_ave/Max_ave;gain_G_1=G_ave/Max_ave;gain_B_1=B_ave/Max_ave。
3.根据权利要求1所述的智能摄像机白平衡处理方法,其特征在于,步骤(7)中确定二级校正参数gain_R_2、gain_G_2、gain_B_2,的运算规则为:当gain_R_1<gain_R_min时,gain_R_2=gain_R_min;当gain_R_1>gain_R_min时,gain_R_2=gain_R_1;当gain_G_1<gain_G_min时,gain_G_2=gain_G_min;当gain_G_1>gain_G_min时,gain_G_2=gain_G_1;当gain_B_1<gain_B_min时,gain_R_2=gain_B_min;当gain_B_1<gain_B_min时,gain_R_2=gain_B_1。
4.根据权利要求1所述的智能摄像机白平衡处理方法,其特征在于,步骤(8)中进行二级校正后得到三通道下RAW数据RAW_R2、RAW_G2和RAW_B2的校正规则为:RAW_R2= RAW_R*gain_R_2;RAW_G2= RAW_G*gain_G_2;RAW_B2= RAW_B*gain_B_2。
5.根据1至4任一权利要求所述的智能摄像机白平衡处理方法,其特征在于,步骤(7)中摄像机的白平衡参数设定方式有手动和自动两种。
CN 201110373205 2011-11-22 2011-11-22 一种智能摄像机白平衡处理方法 Active CN102395035B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201110373205 CN102395035B (zh) 2011-11-22 2011-11-22 一种智能摄像机白平衡处理方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201110373205 CN102395035B (zh) 2011-11-22 2011-11-22 一种智能摄像机白平衡处理方法

Publications (2)

Publication Number Publication Date
CN102395035A true CN102395035A (zh) 2012-03-28
CN102395035B CN102395035B (zh) 2013-08-21

Family

ID=45862231

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201110373205 Active CN102395035B (zh) 2011-11-22 2011-11-22 一种智能摄像机白平衡处理方法

Country Status (1)

Country Link
CN (1) CN102395035B (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102867295A (zh) * 2012-08-06 2013-01-09 电子科技大学 一种彩色图像颜色校正方法
CN111587573A (zh) * 2018-05-30 2020-08-25 华为技术有限公司 一种图像处理方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11266370A (ja) * 1998-03-17 1999-09-28 Fuji Photo Film Co Ltd ホワイトバランス調整方法および装置
US7190394B2 (en) * 2002-06-04 2007-03-13 Micron Technology, Inc. Method for statistical analysis of images for automatic white balance of color channel gains for image sensors
JP3976945B2 (ja) * 1999-06-04 2007-09-19 キヤノン株式会社 ホワイトバランス装置及びホワイトバランスの補正方法及び記憶媒体
CN101193316A (zh) * 2006-11-21 2008-06-04 安凯(广州)软件技术有限公司 一种自适应白平衡校正方法
US7499083B2 (en) * 2004-01-08 2009-03-03 Canon Kabushiki Kaisha Image sensing apparatus with white balance control and image sensing method therefor

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11266370A (ja) * 1998-03-17 1999-09-28 Fuji Photo Film Co Ltd ホワイトバランス調整方法および装置
JP3976945B2 (ja) * 1999-06-04 2007-09-19 キヤノン株式会社 ホワイトバランス装置及びホワイトバランスの補正方法及び記憶媒体
US7190394B2 (en) * 2002-06-04 2007-03-13 Micron Technology, Inc. Method for statistical analysis of images for automatic white balance of color channel gains for image sensors
US7499083B2 (en) * 2004-01-08 2009-03-03 Canon Kabushiki Kaisha Image sensing apparatus with white balance control and image sensing method therefor
CN101193316A (zh) * 2006-11-21 2008-06-04 安凯(广州)软件技术有限公司 一种自适应白平衡校正方法

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
金黄斌,等: "基于灰度世界和白点检测的自动白平衡算法", 《电子器件》, 20 April 2011 (2011-04-20) *
韩强,等: "图像信号处理器中自动白平衡的算法研究", 《信息技术》, 25 November 2009 (2009-11-25) *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102867295A (zh) * 2012-08-06 2013-01-09 电子科技大学 一种彩色图像颜色校正方法
CN102867295B (zh) * 2012-08-06 2015-10-21 电子科技大学 一种彩色图像颜色校正方法
CN111587573A (zh) * 2018-05-30 2020-08-25 华为技术有限公司 一种图像处理方法及装置

Also Published As

Publication number Publication date
CN102395035B (zh) 2013-08-21

Similar Documents

Publication Publication Date Title
CN108600725B (zh) 一种基于rgb-ir图像数据的白平衡校正装置及方法
CN101897192B (zh) 白平衡调整装置以及白平衡调整方法
CN101193314B (zh) 图像传感器的图像处理装置和方法
CN107590840B (zh) 基于网格划分的颜色阴影校正方法及其校正系统
JP4695552B2 (ja) 画像処理装置及び方法
US20080043117A1 (en) Method and Apparatus for Compensating Image Sensor Lens Shading
EP2278788A1 (en) Method and apparatus for correcting lens shading
CN105282529B (zh) 一种基于raw空间的数字宽动态方法及装置
US20050270402A1 (en) Method, apparatus, imaging module and program for improving image quality in a digital imaging device
US20100277625A1 (en) Image processing apparatus, imaging apparatus, method of correction coefficient calculation, and storage medium storing image processing program
CN101849405B (zh) 信号处理装置及信号处理方法
WO2015186605A1 (ja) 画像処理装置、画像処理システム、撮像装置、および画像処理方法
CN104581105B (zh) 基于色温距离变换权重图和块可靠性修正的自动白平衡方法
CN103037224A (zh) 图像白平衡处理方法及装置
CN105578166A (zh) 一种色温确定方法及装置
CN104113744A (zh) 全天候彩色摄像机白平衡处理方法及装置
CN107613229A (zh) 一种图像传感器坏点检测校正装置及方法
CN104113743A (zh) 低照度下彩色摄像机自动白平衡处理方法及装置
CN104036467A (zh) 一种基于通道增益系数加权的图像色偏校正方法
CN103327220A (zh) 低照度Bayer图像上以绿色通道为导向的去噪方法
CN105898252A (zh) 一种电视色彩的调整方法和装置
CN104079909A (zh) 一种图像自动白平衡方法及装置
CN208353496U (zh) 一种基于rgb-ir图像数据的白平衡校正装置
CN103079077B (zh) 一种图像处理方法
CN102395035B (zh) 一种智能摄像机白平衡处理方法

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C56 Change in the name or address of the patentee
CP01 Change in the name or title of a patent holder

Address after: 100086, No. 21 Haidian South Road, Beijing, Haidian District sea building, 7 floor

Patentee after: BEIJING ITARGE TECHNOLOGY CO.,LTD.

Address before: 100086, No. 21 Haidian South Road, Beijing, Haidian District sea building, 7 floor

Patentee before: BEIJING ITARGE SOFTWARE TECHNOLOGIES DEVELOPMENT Co.,Ltd.

PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Processing method for white balance of intelligent camera

Effective date of registration: 20170810

Granted publication date: 20130821

Pledgee: China Co. truction Bank Corp Beijing Zhongguancun branch

Pledgor: BEIJING ITARGE TECHNOLOGY CO.,LTD.|BEIJING MINGTAIZHI SOFTWARE TECHNOLOGY DEVELOPMENT Co.,Ltd.

Registration number: 2017990000732

PE01 Entry into force of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20181116

Granted publication date: 20130821

Pledgee: China Co. truction Bank Corp Beijing Zhongguancun branch

Pledgor: BEIJING ITARGE TECHNOLOGY CO.,LTD.|BEIJING MINGTAIZHI SOFTWARE TECHNOLOGY DEVELOPMENT Co.,Ltd.

Registration number: 2017990000732

PC01 Cancellation of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A white balance processing method for intelligent camera

Effective date of registration: 20210826

Granted publication date: 20130821

Pledgee: Haidian Beijing science and technology enterprise financing Company limited by guarantee

Pledgor: BEIJING ITARGE TECHNOLOGY Co.,Ltd.

Registration number: Y2021990000771

PE01 Entry into force of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20230627

Granted publication date: 20130821

Pledgee: Haidian Beijing science and technology enterprise financing Company limited by guarantee

Pledgor: BEIJING ITARGE TECHNOLOGY CO.,LTD.

Registration number: Y2021990000771

PC01 Cancellation of the registration of the contract for pledge of patent right