CN104333707B - Camera parameter method of adjustment and system - Google Patents
Camera parameter method of adjustment and system Download PDFInfo
- Publication number
- CN104333707B CN104333707B CN201410693214.1A CN201410693214A CN104333707B CN 104333707 B CN104333707 B CN 104333707B CN 201410693214 A CN201410693214 A CN 201410693214A CN 104333707 B CN104333707 B CN 104333707B
- Authority
- CN
- China
- Prior art keywords
- adjustment
- camera
- evaluation
- gear
- estimate
- 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.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 27
- 238000011156 evaluation Methods 0.000 claims abstract description 137
- 230000008859 change Effects 0.000 claims description 10
- 230000008569 process Effects 0.000 claims description 4
- 241000208340 Araliaceae Species 0.000 claims 1
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 claims 1
- 235000003140 Panax quinquefolius Nutrition 0.000 claims 1
- 235000008434 ginseng Nutrition 0.000 claims 1
- 238000010586 diagram Methods 0.000 description 3
- 238000013480 data collection Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000005693 optoelectronics Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004040 coloring Methods 0.000 description 1
- 239000006185 dispersion Substances 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 229920006395 saturated elastomer Polymers 0.000 description 1
Landscapes
- Studio Devices (AREA)
Abstract
本发明提供一种相机参数调整方法和系统,其方法包括步骤:控制待调整的相机在当前曝光参数下采集图像得到图像数据,并对当前获得的图像数据进行像素统计得到像素分布数据;根据当前得到的像素分布数据计算预设的当前计算出的评价值;判断当前计算出的评价值是否满足预设的调整成功条件,若否,根据当前计算出的评价值选取相应的调整档位数以及档位调整方向,根据当前选出的调整档位数以及档位调整方向调整所述相机的曝光参数,将调整后的曝光参数作为新的当前曝光参数,返回所述控制待调整相机在当前曝光参数下采集图像得到图像数据的步骤;若是,结束对所述相机参数的调整。采用本发明的方案,可以实现相机参数的自动调节,提高调整效率。
The present invention provides a method and system for adjusting camera parameters. The method includes the steps of: controlling the camera to be adjusted to collect images under the current exposure parameters to obtain image data, and performing pixel statistics on the currently obtained image data to obtain pixel distribution data; The obtained pixel distribution data calculates the preset currently calculated evaluation value; judges whether the currently calculated evaluation value meets the preset adjustment success condition, if not, selects the corresponding adjustment gear according to the currently calculated evaluation value and Gear adjustment direction, adjust the exposure parameters of the camera according to the number of adjustment gears currently selected and the gear adjustment direction, use the adjusted exposure parameters as the new current exposure parameters, and return to the control to be adjusted in the current exposure of the camera A step of collecting images under the parameters to obtain image data; if yes, ending the adjustment of the camera parameters. By adopting the scheme of the present invention, automatic adjustment of camera parameters can be realized, and adjustment efficiency can be improved.
Description
技术领域technical field
本发明涉及光电技术领域,特别是涉及一种相机参数调整方法和系统。The invention relates to the field of optoelectronic technology, in particular to a camera parameter adjustment method and system.
背景技术Background technique
随着光电技术领域的快速发展和用户需求的日益增长,人们在日常生活中对相机的应用需求越来越广泛,可拍摄出高品质画面的相机(特别是单反相机)成为该领域的发展方向之一。传统的调整相机参数的方式是需要人工进行,对于一些对所拍摄的图像质量要求较高的领域,往往需要反复的进行参数调整,否则拍摄出的画面则无法满足应用需求。例如,在对LED显示屏进行校正时,为了节约校正成本,往往是采用相机进行数据采集,而采集数据的准确性直接影响采集效果,因此也需要对相机的参数进行反复地调整直到满足要求,这会花费一定的时间,调整效率低。With the rapid development of optoelectronic technology and the increasing demand of users, people have more and more applications for cameras in daily life, and cameras that can shoot high-quality images (especially SLR cameras) have become the development direction of this field. one. The traditional method of adjusting camera parameters is manual. For some fields that require high image quality, it is often necessary to repeatedly adjust the parameters, otherwise the captured images cannot meet the application requirements. For example, when calibrating the LED display screen, in order to save the calibration cost, the camera is often used for data collection, and the accuracy of the collected data directly affects the collection effect, so it is also necessary to repeatedly adjust the parameters of the camera until it meets the requirements. This will take a certain amount of time, and the adjustment efficiency is low.
发明内容Contents of the invention
本发明的目的在于提供一种相机参数调整方法和系统,可以实现相机参数的自动调节,提高调整效率。The object of the present invention is to provide a method and system for adjusting camera parameters, which can realize automatic adjustment of camera parameters and improve adjustment efficiency.
本发明的目的通过如下技术方案实现:The purpose of the present invention is achieved through the following technical solutions:
一种相机参数调整方法,包括如下步骤:A camera parameter adjustment method, comprising the steps of:
控制待调整的相机在当前曝光参数下采集图像得到图像数据,并对当前获得的图像数据进行像素统计得到像素分布数据;Control the camera to be adjusted to collect images under the current exposure parameters to obtain image data, and perform pixel statistics on the currently obtained image data to obtain pixel distribution data;
根据当前得到的像素分布数据和预设的评价函数计算当前采集的图像的评价值;Calculate the evaluation value of the currently collected image according to the currently obtained pixel distribution data and the preset evaluation function;
判断当前计算出的评价值是否满足预设的调整成功条件;Judging whether the currently calculated evaluation value satisfies the preset adjustment success condition;
若否,根据当前计算出的评价值选取相应的调整档位数以及档位调整方向,根据当前选出的调整档位数以及档位调整方向调整所述相机的曝光参数,将调整后的曝光参数作为新的当前曝光参数,返回所述控制待调整相机在当前曝光参数下采集图像得到图像数据的步骤;If not, select the corresponding adjustment gear number and gear adjustment direction according to the currently calculated evaluation value, adjust the exposure parameters of the camera according to the currently selected adjustment gear number and gear adjustment direction, and convert the adjusted exposure The parameter is used as a new current exposure parameter, and returns to the step of controlling the camera to be adjusted to collect an image under the current exposure parameter to obtain image data;
若是,结束对所述相机参数的调整。If yes, end the adjustment of the camera parameters.
一种相机参数调整系统,包括如下步骤:A camera parameter adjustment system, comprising the steps of:
数据采集模块,用于控制待调整的相机在当前曝光参数下采集图像得到图像数据;The data collection module is used to control the camera to be adjusted to collect images under the current exposure parameters to obtain image data;
数据统计模块,用于对当前获得的图像数据进行像素统计得到像素分布数据;The data statistics module is used to perform pixel statistics on the currently obtained image data to obtain pixel distribution data;
计算模块,用于根据当前得到的像素分布数据和预设的评价函数计算当前采集的图像的评价值;A calculation module, configured to calculate the evaluation value of the currently collected image according to the currently obtained pixel distribution data and a preset evaluation function;
判断模块,用于判断当前计算出的评价值是否满足预设的调整成功条件,a judging module, configured to judge whether the currently calculated evaluation value satisfies a preset adjustment success condition,
调整模块,用于在所述判断模块的判定结果为否时,根据当前计算出的评价值选取相应的调整档位数以及档位调整方向,根据当前选出的调整档位数以及档位调整方向调整所述相机的曝光参数,将调整后的曝光参数作为新的当前曝光参数,控制所述数据采集模块进行所述控制待调整相机在当前曝光参数下采集图像得到图像数据的过程,在所述判断模块的判定结果为是时,结束对所述相机参数的调整。An adjustment module, configured to select a corresponding number of adjustment gears and a gear adjustment direction according to the currently calculated evaluation value when the judgment result of the judgment module is negative, and adjust Directly adjust the exposure parameters of the camera, use the adjusted exposure parameters as the new current exposure parameters, and control the data acquisition module to perform the process of controlling the camera to be adjusted to collect images under the current exposure parameters to obtain image data. When the determination result of the determination module is yes, the adjustment of the camera parameters is ended.
根据上述本发明的方案,其是控制待调整的相机在当前曝光参数下采集图像得到图像数据,并对当前获得的图像数据进行像素统计得到像素分布数据,根据当前得到的像素分布数据计算预设的当前计算出的评价值,判断当前计算出的评价值是否满足预设的调整成功条件,若否,根据当前计算出的评价值选取相应的调整档位数以及档位调整方向,根据当前选出的调整档位数以及档位调整方向调整所述相机的曝光参数,将调整后的曝光参数作为新的当前曝光参数,返回所述控制待调整相机在当前曝光参数下采集图像得到图像数据的步骤,若是,结束对所述相机参数的调整,其无需用户进行任何操作就可以实现对相机参数的自动调整,提高了相机参数调整的效率。According to the above solution of the present invention, it is to control the camera to be adjusted to collect images under the current exposure parameters to obtain image data, and perform pixel statistics on the currently obtained image data to obtain pixel distribution data, and calculate the preset according to the currently obtained pixel distribution data According to the currently calculated evaluation value, judge whether the currently calculated evaluation value meets the preset adjustment success conditions. If not, select the corresponding adjustment gear number and gear adjustment direction according to the current calculated evaluation value. Adjust the number of adjustment gears and the gear adjustment direction to adjust the exposure parameters of the camera, use the adjusted exposure parameters as the new current exposure parameters, and return the control to the camera to be adjusted to collect images under the current exposure parameters to obtain image data Step, if yes, end the adjustment of the camera parameters, which can realize the automatic adjustment of the camera parameters without any operation by the user, which improves the efficiency of the camera parameter adjustment.
附图说明Description of drawings
图1为本发明的相机参数调整方法实施例的流程示意图;FIG. 1 is a schematic flowchart of an embodiment of a camera parameter adjustment method of the present invention;
图2为本发明的相机参数调整系统的一个实施例的结构示意图;FIG. 2 is a schematic structural diagram of an embodiment of the camera parameter adjustment system of the present invention;
图3为本发明的相机参数调整系统的另一个实施例的结构示意图。FIG. 3 is a schematic structural diagram of another embodiment of the camera parameter adjustment system of the present invention.
具体实施方式detailed description
为使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步的详细说明。应当理解,此处所描述的具体实施方式仅仅用以解释本发明,并不限定本发明的保护范围。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, and do not limit the protection scope of the present invention.
在下述说明中,首先针对本发明的相机参数调整方法的实施例进行说明,再对本发明的本发明的相机参数调整系统的各实施例进行说明。In the following description, the embodiment of the camera parameter adjustment method of the present invention will be described first, and then the embodiments of the camera parameter adjustment system of the present invention will be described.
参见图1所示,为本发明的相机参数调整方法实施例的流程示意图。如图1所示,本发明的相机参数调整方法包括如下步骤:Referring to FIG. 1 , it is a schematic flowchart of an embodiment of a camera parameter adjustment method of the present invention. As shown in Figure 1, the camera parameter adjustment method of the present invention comprises the following steps:
步骤S101:控制待调整的相机在当前曝光参数下采集图像得到图像数据,进入步骤S102;Step S101: Control the camera to be adjusted to collect images under the current exposure parameters to obtain image data, and enter step S102;
对于进行LED显示屏校正时的数据采集,采集的是LED显示屏显示R(红色)、G(绿色)、B(蓝色)中的一种颜色时的图像,但本发明并不限于只采集一种颜色的图像的方式;For the data acquisition when the LED display screen is calibrated, what is collected is the image when the LED display screen displays a color in R (red), G (green), and B (blue), but the present invention is not limited to only collecting A way of coloring an image;
步骤S102:对当前获得的图像数据进行像素统计得到像素分布数据,进入步骤S103;Step S102: Perform pixel statistics on the currently obtained image data to obtain pixel distribution data, and proceed to step S103;
可以对当前获得的图像数据中的每个像素点的像素值进行提取,根据提取到的各像素点的像素值得到像素分布数据,其中,像素值分布数据是指不同像素值对应的像素值(或者称为像素点)的个数情况,例如,对于图像分辨率为100×100的图像数据,共有10000个像素点,可以分别提取出这10000个像素点的像素值,再根据这10000个像素点的像素值确定像素值为0的像素值个数(或者称为像素点个数)、像素值为1像素值个数(或者称为像素点个数)、像素值为2像素值个数(或者称为像素点个数)、像素值为3像素值个数(或者称为像素点个数)……像素值为255的像素值个数(或者称为像素点个数);The pixel value of each pixel point in the currently obtained image data can be extracted, and pixel distribution data can be obtained according to the extracted pixel value of each pixel point, wherein the pixel value distribution data refers to pixel values corresponding to different pixel values ( Or called the number of pixels), for example, for image data with an image resolution of 100×100, there are 10,000 pixels in total, and the pixel values of these 10,000 pixels can be extracted respectively, and then based on the 10,000 pixels The pixel value of the point determines the number of pixel values with a pixel value of 0 (or called the number of pixel points), the number of pixel values with a pixel value of 1 (or called the number of pixel points), and the number of pixel values with a pixel value of 2 (or called the number of pixel points), the number of pixel values (or called the number of pixel points) with a pixel value of 3 ... the number of pixel values (or called the number of pixel points) with a pixel value of 255;
步骤S103:根据当前得到的像素分布数据和预设的评价函数计算当前采集的图像的评价值,进入步骤S104;Step S103: Calculate the evaluation value of the currently collected image according to the currently obtained pixel distribution data and the preset evaluation function, and proceed to step S104;
其中,评价函数的形式可以根据实际需要设置,在其中一个实施例中,评价函数的形式可如下公式(1)所示:Wherein, the form of the evaluation function can be set according to actual needs. In one embodiment, the form of the evaluation function can be shown in the following formula (1):
其中,K1、K2、…、Kn表示预设的各像素值区间的饱和系数参数,X1、X2、…、Xn表示各像素值区间的像素值个数,N表示各像素值区间的像素值个数的和值,Y表示评价函数的评价值;Among them, K 1 , K 2 , ..., K n represent the preset saturation coefficient parameters of each pixel value interval, X 1 , X 2 , ..., X n represent the number of pixel values in each pixel value interval, and N represents each pixel value The sum of the number of pixel values in the value interval, Y represents the evaluation value of the evaluation function;
需要说明的是,这里的像素值区间的个数以及每个像素值区间对应的上限值和下限值可以根据实际需要进行设置,可以是将0~255按照设定的方式划分为多个像素值区间,也可以根据实际需要只将0~255的一部分按照设定的方式划分为多个像素值区间,例如,若已知像素值小于80的像素值对判断相机曝光状态影响十分小,则可以只将80~255这一部分按照设定的方式划分为多个像素值区间,另外,这里的像素值区间包括通常所指的数值区间,但由于单个数据可以看作上限值和下限值相同的数值区间,因此,也可以将单个像素值统称为像素值区间,在本发明中,以统称的像素值区间进行说明;It should be noted that the number of pixel value intervals here and the upper and lower limit values corresponding to each pixel value interval can be set according to actual needs, which can be divided into multiple The pixel value interval can also be divided into multiple pixel value intervals according to the set method according to the actual needs. For example, if the known pixel value is less than 80, the impact on judging the camera exposure status is very small. Then only the part 80~255 can be divided into multiple pixel value intervals according to the set method. In addition, the pixel value intervals here include the commonly referred to numerical intervals, but since a single data can be regarded as an upper limit and a lower limit Numerical intervals with the same value, therefore, a single pixel value can also be collectively referred to as a pixel value interval, and in the present invention, it will be described as a collectively referred to as a pixel value interval;
上述饱和系数参数可以根据实际情况设定,具体地,由于在实际应用时,焦距、对焦和相机位置等不同LED成像的大小和清晰程度也可能不同,所以在有可能用到的范围内取一个中间状态(成像大小处于中间,对焦清晰度也处于中间左右)进行饱和系数参数的设定;The above parameters of the saturation coefficient can be set according to the actual situation. Specifically, since the size and clarity of different LED images such as focal length, focus, and camera position may also be different in actual applications, one should be selected within the range that may be used. In the intermediate state (the imaging size is in the middle, and the focus definition is also in the middle) to set the saturation coefficient parameters;
例如,在所取的中间状态下,拍摄一张参考图像,对各像素值区间的像素值个数进行统计,例如,统计结果如表1中所示:For example, in the selected intermediate state, a reference image is taken, and the number of pixel values in each pixel value interval is counted. For example, the statistical results are shown in Table 1:
表1Table 1
恰好饱和状态(临界状态)下每个LED像素分布特点:有1个像素处于231-254之间,有10个像素处于170-230之间,有20个像素处于121-170之间。其余的为在80-120之间,假设恰好不饱和的LED像点覆盖80-255像素值个数为50;由于LED屏的各LED点的亮度具有一定的离散性(有的较亮,有的较暗),可以从概率的角度设定权重系数,具体如下(由于图片的LED点的个数未知,以下以百分比说明,且以一个LED点对应有50个像素为例进行说明):The distribution characteristics of each LED pixel in the exactly saturated state (critical state): 1 pixel is between 231-254, 10 pixels are between 170-230, and 20 pixels are between 121-170. The rest are between 80-120, assuming that the unsaturated LED image points cover 80-255 pixel values and the number of pixel values is 50; because the brightness of each LED point of the LED screen has a certain degree of dispersion (some are brighter, some darker), you can set the weight coefficient from the perspective of probability, as follows (because the number of LED points in the picture is unknown, the following is described in percentage, and an LED point corresponds to 50 pixels as an example):
若允许1/100的LED点中有一个LED点的中心值像素为255,此时设定X1=5000,若允许1/10的LED点中有一个LED点的中心值像素为231-254,此时设定X2=500,若平均每个LED点要有10个像素左右分布在171-230,那么此时,X3=1/10,若均每个LED要有20个像素左右分布在121-170,那么此时,X4=1/20,由于X5的系数参考价值不大,可以设定一个较小的系数:如,e=1/200;If the center value pixel of one LED point in 1/100 of the LED points is allowed to be 255, set X 1 =5000 at this time, if the center value pixel of one LED point in 1/10 of the LED points is allowed to be 231-254 , set X 2 =500 at this time, if each LED point has about 10 pixels distributed in 171-230, then at this time, X 3 =1/10, if each LED point has about 20 pixels The distribution is 121-170, then at this time, X 4 =1/20, since the coefficient of X 5 has little reference value, a smaller coefficient can be set: for example, e=1/200;
那么,通过以上的饱和系数参数设定后,当图片刚好处于不饱和时,算的Y值在1-10左右;如果图片过曝,231-255区间的像素个数必定成倍数增加,Y值会远大于10;Then, after setting the above saturation coefficient parameters, when the picture is just undersaturated, the calculated Y value is around 1-10; if the picture is overexposed, the number of pixels in the 231-255 range must increase exponentially, and the Y value will be much greater than 10;
根据当前得到的像素分布数据计算预设的当前计算出的评价值的过程可以是:根据当前得到的像素分布数据确定各所述像素值区间的像素值个数X1、X2、…、Xn以及所述和值N,根据各所述像素值区间的像素值个数X1、X2、…、Xn以及所述和值N计算当前计算出的评价值Y,也即当前确定的各所述像素值区间的像素值个数X1、X2、…、Xn以及所述和值N代入上述公式(1)计算所述评价函数中计算当前的函数值;The process of calculating the preset currently calculated evaluation value according to the currently obtained pixel distribution data may be: according to the currently obtained pixel distribution data, determine the number of pixel values X 1 , X 2 , ..., X in each of the pixel value intervals n and the sum value N, the currently calculated evaluation value Y is calculated according to the number of pixel values X 1 , X 2 , ..., X n in each of the pixel value intervals, that is, the currently determined The number of pixel values X 1 , X 2 , ..., X n in each pixel value interval and the sum N are substituted into the above formula (1) to calculate the current function value in the evaluation function;
步骤S104:判断当前计算出的评价值是否满足预设的调整成功条件,若否,进入步骤S105,若是,进入步骤S106;Step S104: Determine whether the currently calculated evaluation value satisfies the preset adjustment success condition, if not, go to step S105, if yes, go to step S106;
判断当前计算出的评价值是否满足预设的调整成功条件的方式,可以是判断当前计算出的评价值是否与预设的目标值相同,或者判断当前计算出的评价值是否与落入预设的目标范围内;The method of judging whether the currently calculated evaluation value satisfies the preset adjustment success condition can be to judge whether the currently calculated evaluation value is the same as the preset target value, or to judge whether the currently calculated evaluation value falls within the preset target value. within the target range;
步骤S105:根据当前计算出的评价值选取相应的调整档位数以及档位调整方向,根据当前选出的调整档位数以及档位调整方向调整所述相机的曝光参数,将调整后的曝光参数作为新的当前曝光参数,返回步骤S101;Step S105: Select the corresponding number of adjustment gears and gear adjustment direction according to the currently calculated evaluation value, adjust the exposure parameters of the camera according to the currently selected number of adjustment gears and gear adjustment direction, and set the adjusted exposure parameter as the new current exposure parameter, return to step S101;
本领域技术人员应该可以理解,当当前计算出的评价值与调整成功条件的差别较大时调整档位数也较大当当前计算出的评价值与调整成功条件的差别较小时,调整档位数也较小,且过曝时应该降低档位,也可以称档位调整方向为降档方向,欠曝时应该升高档位,也可以称档位调整方向为升档方向,在实际应用时,可以根据实际需要设置不同的评价值区间所对应的调整档位数以及档位调整方向,则可以根据当前计算出的评价值所处的评价值区间选取相应的调整档位数以及档位调整方向,再根据当前选出的调整档位数以及档位调整方向调整所述相机的曝光参数(即进行档位调整);Those skilled in the art should be able to understand that when the difference between the currently calculated evaluation value and the adjustment success condition is large, the number of adjustment gears is also large; when the difference between the currently calculated evaluation value and the adjustment success condition is small, the adjustment gear The number is also small, and the gear should be lowered during overexposure. It can also be called the downshift direction, and the gear should be raised when underexposure. It can also be called the upshift direction. In practical applications , you can set the number of adjustment gears and gear adjustment direction corresponding to different evaluation value intervals according to actual needs, and then you can select the corresponding adjustment gear number and gear adjustment according to the evaluation value interval where the currently calculated evaluation value is located. direction, and then adjust the exposure parameters of the camera according to the currently selected number of adjustment gears and the gear adjustment direction (that is, adjust the gear);
在其中一个实施例中,根据当前计算出的评价值选取相应的调整档位数以及档位调整方向可以具体包括步骤:根据当前计算出的评价值确定该评价值对应的评价值区间,根据所确定的评价值区间以及预先存储的评价值区间与调整档位数、档位调整方向的绑定关系选取当前计算出的评价值对应的调整档位数以及档位调整方向;In one of the embodiments, selecting the corresponding number of adjustment gears and gear adjustment direction according to the currently calculated evaluation value may specifically include the steps of: determining the evaluation value interval corresponding to the evaluation value according to the currently calculated evaluation value; The determined evaluation value interval and the binding relationship between the pre-stored evaluation value interval and the number of adjustment gears and the direction of gear adjustment select the number of adjustment gears and the direction of gear adjustment corresponding to the currently calculated evaluation value;
步骤S106:结束对所述相机参数的调整。Step S106: End the adjustment of the camera parameters.
据此,根据上述实施例的方案,其是控制待调整的相机在当前曝光参数下采集图像得到图像数据,并对当前获得的图像数据进行像素统计得到像素分布数据,根据当前得到的像素分布数据计算预设的当前计算出的评价值,判断当前计算出的评价值是否满足预设的调整成功条件,若否,根据当前计算出的评价值选取相应的调整档位数以及档位调整方向,根据当前选出的调整档位数以及档位调整方向调整所述相机的曝光参数,将调整后的曝光参数作为新的当前曝光参数,返回所述控制待调整相机在当前曝光参数下采集图像得到图像数据的步骤,若是,结束对所述相机参数的调整,其无需用户进行任何操作就可以实现对相机参数的自动调整,提高了相机参数调整的效率。Accordingly, according to the solution of the above-mentioned embodiment, it is to control the camera to be adjusted to collect images under the current exposure parameters to obtain image data, and perform pixel statistics on the currently obtained image data to obtain pixel distribution data. According to the currently obtained pixel distribution data Calculate the preset currently calculated evaluation value, judge whether the currently calculated evaluation value meets the preset adjustment success condition, if not, select the corresponding adjustment gear number and gear adjustment direction according to the current calculated evaluation value, Adjust the exposure parameters of the camera according to the number of adjustment gears currently selected and the adjustment direction of the gear positions, use the adjusted exposure parameters as the new current exposure parameters, and return the control to the camera to be adjusted to collect images under the current exposure parameters to obtain In the step of image data, if yes, the adjustment of the camera parameters is ended, and the automatic adjustment of the camera parameters can be realized without any operation by the user, which improves the efficiency of the adjustment of the camera parameters.
此外,如前所述,根据当前计算出的评价值选取相应的调整档位数以及档位调整方向时,可以基于评价值区间与调整档位数、档位调整方向的绑定关系选取,而为了使预先存储的评价值区间与调整档位数、档位调整方向的绑定关系可以满足各种不同情况,例如相机焦距不同或者对焦状态不同,在其中一个实施例中,所述评价值区间与调整档位数、档位调整方向的绑定关系可以通过如下方式获得:In addition, as mentioned above, when selecting the corresponding number of adjustment gears and gear adjustment direction according to the currently calculated evaluation value, it can be selected based on the binding relationship between the evaluation value range, the number of adjustment gears, and the direction of gear adjustment. In order to make the binding relationship between the pre-stored evaluation value range and the number of adjustment gears and gear adjustment direction satisfy various situations, such as different camera focal lengths or different focus states, in one embodiment, the evaluation value range and The binding relationship of adjusting the number of gears and the direction of gear adjustment can be obtained through the following methods:
在所述相机处于当前焦距、当前对焦状态下改变所述相机的各曝光参数,获得各曝光参数时的控制所述相机采集图像得到的图像数据,分别根据各图像数据和所述评价函数计算各对应的图像的评价值,并根据计算得到的评价值确定评价值与相机档位的对应关系,在不满足预设的采集完毕条件时,改变当前焦距或者当前对焦状态,将改变后的当前焦距或者当前对焦状态作为新的当前焦距或者当前对焦状态,返回在所述相机处于当前焦距、当前对焦状态下改变所述相机的各曝光参数,获得各曝光参数时的控制所述相机采集图像得到的图像数据的步骤,在满足采集完毕条件时,根据各次确定的评价值与相机档位的对应关系确定评价值区间与调整档位数、档位调整方向的绑定关系。Change the exposure parameters of the camera when the camera is in the current focal length and the current focus state, and obtain the image data obtained by controlling the camera to collect images when obtaining the exposure parameters, and calculate each according to the image data and the evaluation function respectively. The evaluation value of the corresponding image, and determine the corresponding relationship between the evaluation value and the camera gear according to the calculated evaluation value. Or the current focusing state is used as the new current focal length or current focusing state, and returns the result obtained by controlling the camera to collect images when the camera is in the current focal length and current focusing state, changing each exposure parameter of the camera and obtaining each exposure parameter In the image data step, when the acquisition completion condition is met, the binding relationship between the evaluation value range, the number of adjustment gears, and the gear adjustment direction is determined according to the corresponding relationship between the evaluation value determined each time and the camera gear position.
其中,改变当前焦距的方式可以是每次将当前焦距加上或者减去一预定的焦距步长,改变当前对焦状态即将对焦状态从一对焦状态变化到更一对焦状态,采集完毕条件可以是遍历了各长度的焦距且遍历了各对焦状态;Among them, the way to change the current focal length can be to add or subtract a predetermined focal length step to the current focal length each time, to change the current focus state is to change the focus state from a focus state to a further focus state, and the acquisition completion condition can be to traverse The focal length of each length is traversed and each focus state is traversed;
可以综合各次确定的评价值与相机档位的对应关系确定评价值区间与调整档位数、档位调整方向的绑定关系,例如,第一次确定的评价值与相机档位的对应关系包括评价值A(或者称为评价值区间A)对应的相机档位为10档、评价值B(或者称为评价值区间B)对应的相机档位为3档,若评价值B(或者称为评价值区间B)对应的相机档位为最佳曝光参数对应的档位,则本次对应评价值A(或者称为评价值区间A)的调整档位数为7、档位调整方向为降档方向,同理,可以确定各次对应评价值A(或者称为评价值区间A)的调整档位数以及档位调整方向,将各次对应评价值A(或者称为评价值区间A)的调整档位数取平均值即可以确定与评价值A(或者称为评价值区间A)的绑定的调整档位数,将各次对应评价值A(或者称为评价值区间A)的档位调整方向中最多的一种档位调整方向确定为确定与评价值A(或者称为评价值区间A)的绑定的档位调整方向。The corresponding relationship between the evaluation value determined each time and the camera gear position can be integrated to determine the binding relationship between the evaluation value range, the number of adjustment gears, and the gear adjustment direction. For example, the corresponding relationship between the evaluation value determined for the first time and the camera gear position Including the camera gear corresponding to the evaluation value A (or called the evaluation value range A) is 10 gears, and the camera gear corresponding to the evaluation value B (or called the evaluation value range B) is 3 gears, if the evaluation value B (or called the evaluation value range B) is 3 gears, if the evaluation value B (or called The camera gear corresponding to the evaluation value interval B) is the gear corresponding to the optimal exposure parameter, then the number of adjustment gears corresponding to the evaluation value A (or evaluation value interval A) this time is 7, and the gear adjustment direction is The downshift direction, similarly, can determine the number of adjustment gears and the gear adjustment direction corresponding to the evaluation value A (or called the evaluation value interval A) each time, and each corresponding evaluation value A (or called the evaluation value interval A) ) to determine the number of adjustment gears bound to the evaluation value A (or called the evaluation value interval A), and each corresponding evaluation value A (or called the evaluation value interval A) The gear adjustment direction with the largest number of gear adjustment directions is determined as the gear adjustment direction bound to the evaluation value A (or called the evaluation value interval A).
在本实施例中,由于数值区间与调整档位数、档位调整方向的绑定关系是综合考虑了各焦距、各对焦状态、各曝光参数得到的,因此可以满足各种不同情况。In this embodiment, since the binding relationship between the numerical range and the number of gears to be adjusted and the direction of gear adjustment is obtained by comprehensively considering each focal length, each focus state, and each exposure parameter, various situations can be satisfied.
此外,为了防止在调整所述相机的曝光参数时,在某些极端情况下会出现死循环,例如,前一次升高了K档后,根据重新确定的评价函数的评价值又需要降低K档而陷入死循环,在其中一个实施例中,所述根据当前选出的调整档位数以及档位调整方向调整所述相机的曝光参数的步骤包括步骤:若所述当前的调整档位数与上一次调整的调整档位数相同且当前的档位调整方向与上一次调整的档位调整方向相反,则将当前的调整档位数减一或者加一;根据减一或者加一之后的调整档位数以及当前的档位调整方向调整相机的曝光参数,采用本实施例中的方案可以避免出现死循环的情况。In addition, in order to prevent an infinite loop from occurring in some extreme cases when adjusting the exposure parameters of the camera, for example, after the K level was raised last time, the K level needs to be lowered according to the evaluation value of the newly determined evaluation function In one embodiment, the step of adjusting the exposure parameters of the camera according to the currently selected number of adjustment gears and the gear adjustment direction includes the step of: if the current number of adjustment gears is the same as If the number of adjustment gears in the last adjustment is the same and the current gear adjustment direction is opposite to that of the last adjustment, then the current adjustment gear number will be reduced or added by one; according to the adjustment after subtracting or adding one The number of gears and the current gear adjustment direction adjust the exposure parameters of the camera, and the solution in this embodiment can avoid an infinite loop.
根据上述本发明的相机参数调整方法,本发明还提供一种相机参数调整系统,以下就本发明的相机参数调整系统的实施例进行详细说明。图2中示出了本发明的相机参数调整系统的实施例的结构示意图。为了便于说明,在图2中只示出了与本发明相关的部分。According to the above camera parameter adjustment method of the present invention, the present invention also provides a camera parameter adjustment system, and the embodiments of the camera parameter adjustment system of the present invention will be described in detail below. FIG. 2 shows a schematic structural diagram of an embodiment of the camera parameter adjustment system of the present invention. For ease of description, only the parts related to the present invention are shown in FIG. 2 .
如图2所示,本发明实施例的相机参数调整系统,包括采集模块201、数据统计模块202、计算模块203、判断模块204、调整模块205,其中:As shown in Figure 2, the camera parameter adjustment system of the embodiment of the present invention includes an acquisition module 201, a data statistics module 202, a calculation module 203, a judgment module 204, and an adjustment module 205, wherein:
采集模块201,用于控制待调整的相机在当前曝光参数下采集图像得到图像数据;The collection module 201 is used to control the camera to be adjusted to collect images under the current exposure parameters to obtain image data;
统计模块202,用于对当前获得的图像数据进行像素统计得到像素分布数据;A statistics module 202, configured to perform pixel statistics on the currently obtained image data to obtain pixel distribution data;
计算模块203,用于根据当前得到的像素分布数据和预设的评价函数计算当前采集的图像的评价值;Calculation module 203, configured to calculate the evaluation value of the currently collected image according to the currently obtained pixel distribution data and a preset evaluation function;
判断模块204,用于判断当前计算出的评价值是否满足预设的调整成功条件,A judging module 204, configured to judge whether the currently calculated evaluation value satisfies a preset adjustment success condition,
调整模块205,用于在判断模块204的判定结果为否时,根据当前计算出的评价值选取相应的调整档位数以及档位调整方向,根据当前选出的调整档位数以及档位调整方向调整所述相机的曝光参数,将调整后的曝光参数作为新的当前曝光参数,控制所述数据采集模块进行所述控制待调整相机在当前曝光参数下采集图像得到图像数据的过程,在判断模块204的判定结果为是时,结束对所述相机参数的调整。The adjustment module 205 is used to select the corresponding adjustment gear number and the gear adjustment direction according to the currently calculated evaluation value when the determination result of the judgment module 204 is No, and adjust the gear position according to the currently selected adjustment gear number and gear adjustment direction. Directly adjust the exposure parameters of the camera, use the adjusted exposure parameters as the new current exposure parameters, and control the data acquisition module to perform the process of controlling the camera to be adjusted to collect images under the current exposure parameters to obtain image data. When the determination result of module 204 is yes, the adjustment of the camera parameters is ended.
在其中一个实施例中,所述评价函数可以为其中,K1、K2、…、Kn表示预设的各像素值区间的饱和系数参数,X1、X2、…、Xn表示各像素值区间的像素值个数,N表示各像素值区间的像素值个数的和值;In one of the embodiments, the evaluation function can be Among them, K 1 , K 2 , ..., K n represent the preset saturation coefficient parameters of each pixel value interval, X 1 , X 2 , ..., X n represent the number of pixel values in each pixel value interval, and N represents each pixel value The sum of the number of pixel values in the value interval;
计算模块203可以根据当前得到的像素分布数据确定各所述像素值区间的像素值个数以及所述和值,根据各所述像素值区间的像素值个数以及所述和值计算当前采集的图像的评价值。The calculation module 203 can determine the number of pixel values and the sum value of each pixel value interval according to the currently obtained pixel distribution data, and calculate the currently collected pixel value number and the sum value according to the number of pixel values of each pixel value interval and the sum value The evaluation value of the image.
在其中一个实施例中,调整模块205可以根据当前计算出的评价值确定该评价值对应的评价值区间,根据所确定的评价值区间以及预先存储的评价值区间与调整档位数、档位调整方向的绑定关系选取当前计算出的评价值对应的调整档位数以及档位调整方向。In one of the embodiments, the adjustment module 205 may determine the evaluation value interval corresponding to the evaluation value according to the currently calculated evaluation value, and adjust the number of gears and gears according to the determined evaluation value interval and the pre-stored evaluation value interval and The binding relationship of the adjustment direction selects the number of adjustment gears and the gear adjustment direction corresponding to the currently calculated evaluation value.
在其中一个实施例中,如图3所示,本发明的相机参数调整系统,还包括:In one of the embodiments, as shown in Figure 3, the camera parameter adjustment system of the present invention further includes:
绑定模块206,用于在所述相机处于当前焦距、当前对焦状态下改变所述相机的各曝光参数,获得各曝光参数时的控制所述相机采集图像得到的图像数据,分别根据各图像数据和所述评价函数计算各对应的图像的评价值,并根据计算得到的评价值确定评价值与相机档位的对应关系,在不满足预设的采集完毕条件时,改变当前焦距或者当前对焦状态,将改变后的当前焦距或者当前对焦状态作为新的当前焦距或者当前对焦状态,返回执行在所述相机处于当前焦距、当前对焦状态下改变所述相机的各曝光参数,在满足采集完毕条件时,根据各次确定的评价值与相机档位的对应关系确定评价值区间与调整档位数、档位调整方向的绑定关系。The binding module 206 is used to change the exposure parameters of the camera when the camera is in the current focal length and current focus state, and control the image data acquired by the camera to collect images when obtaining the exposure parameters, respectively according to the image data Calculate the evaluation value of each corresponding image with the evaluation function, and determine the corresponding relationship between the evaluation value and the camera gear according to the calculated evaluation value, and change the current focal length or the current focus state when the preset collection completion condition is not satisfied , using the changed current focal length or current focus state as the new current focal length or current focus state, return to execute changing the exposure parameters of the camera when the camera is in the current focal length and current focus state, and when the acquisition completion condition is satisfied , determine the binding relationship between the evaluation value interval, the number of adjustment gears, and the gear adjustment direction according to the corresponding relationship between the evaluation value determined each time and the camera gear position.
在其中一个实施例中,调整模块205可以在当前的调整档位数与上一次调整的调整档位数相同且当前的档位调整方向与上一次调整的档位调整方向相反时,将当前的调整档位数减一或者加一,根据减一或者加一之后的调整档位数以及当前的档位调整方向调整相机的曝光参数。In one of the embodiments, the adjustment module 205 may set the current gear adjustment direction to the last gear adjustment direction when the current gear adjustment direction is the same as the last adjusted gear adjustment direction. The number of adjustment gears is subtracted or added by one, and the exposure parameters of the camera are adjusted according to the number of adjustment gears after subtracting or adding one and the current gear adjustment direction.
本发明的相机参数调整系统与本发明的相机参数调整方法一一对应,在上述相机参数调整方法的实施例阐述的技术特征及其有益效果均适用于相机参数调整系统的实施例中,特此声明。The camera parameter adjustment system of the present invention is in one-to-one correspondence with the camera parameter adjustment method of the present invention. The technical features and beneficial effects described in the above embodiments of the camera parameter adjustment method are applicable to the embodiments of the camera parameter adjustment system. It is hereby declared that .
以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation modes of the present invention, and the description thereof is relatively specific and detailed, but should not be construed as limiting the patent scope of the present invention. It should be pointed out that those skilled in the art can make several modifications and improvements without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent for the present invention should be based on the appended claims.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410693214.1A CN104333707B (en) | 2014-11-25 | 2014-11-25 | Camera parameter method of adjustment and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410693214.1A CN104333707B (en) | 2014-11-25 | 2014-11-25 | Camera parameter method of adjustment and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104333707A CN104333707A (en) | 2015-02-04 |
CN104333707B true CN104333707B (en) | 2017-10-10 |
Family
ID=52408349
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410693214.1A Expired - Fee Related CN104333707B (en) | 2014-11-25 | 2014-11-25 | Camera parameter method of adjustment and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104333707B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB2541041B (en) * | 2016-01-07 | 2018-05-09 | Imagination Tech Ltd | Focus statistics |
WO2019114147A1 (en) * | 2017-12-15 | 2019-06-20 | 华为技术有限公司 | Image aesthetic quality processing method and electronic device |
CN110634163B (en) * | 2019-09-29 | 2022-07-19 | 上海闻泰信息技术有限公司 | Method, device and equipment for calibrating parameters of terminal camera and storage medium |
CN112040180B (en) * | 2020-08-19 | 2022-06-07 | 浙江大华技术股份有限公司 | Control method, device and system of image acquisition device |
CN112104814B (en) * | 2020-11-03 | 2021-02-26 | 卡莱特(深圳)云科技有限公司 | Automatic exposure adjusting method and device and LED display screen correcting method |
CN112672142B (en) * | 2020-12-16 | 2022-04-15 | 长光卫星技术股份有限公司 | A feedback type image quality compensation correction automatic judgment system and method |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080158430A1 (en) * | 2006-12-29 | 2008-07-03 | Hu Shane C | Method, apparatus and system using hierarchical histogram for automatic exposure adjustment of an image |
CN103237175A (en) * | 2013-04-17 | 2013-08-07 | 中国科学院西安光学精密机械研究所 | Digital camera automatic exposure method based on human visual characteristics |
CN103327259A (en) * | 2013-07-19 | 2013-09-25 | 西安诺瓦电子科技有限公司 | Parameter adjusting method and device of camera for correcting LED (Light Emitting Diode) display screen |
CN103888681A (en) * | 2014-04-18 | 2014-06-25 | 四川华雁信息产业股份有限公司 | Automatic exposure method and device |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4151387B2 (en) * | 2002-11-15 | 2008-09-17 | セイコーエプソン株式会社 | Automatic image quality adjustment according to subject brightness |
JP4155280B2 (en) * | 2005-05-18 | 2008-09-24 | コニカミノルタオプト株式会社 | Imaging device |
-
2014
- 2014-11-25 CN CN201410693214.1A patent/CN104333707B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080158430A1 (en) * | 2006-12-29 | 2008-07-03 | Hu Shane C | Method, apparatus and system using hierarchical histogram for automatic exposure adjustment of an image |
CN103237175A (en) * | 2013-04-17 | 2013-08-07 | 中国科学院西安光学精密机械研究所 | Digital camera automatic exposure method based on human visual characteristics |
CN103327259A (en) * | 2013-07-19 | 2013-09-25 | 西安诺瓦电子科技有限公司 | Parameter adjusting method and device of camera for correcting LED (Light Emitting Diode) display screen |
CN103888681A (en) * | 2014-04-18 | 2014-06-25 | 四川华雁信息产业股份有限公司 | Automatic exposure method and device |
Non-Patent Citations (2)
Title |
---|
一种基于亮度直方图的自动曝光控制方法;杨海涛等;《光学学报》;20070531;第27卷(第5期);全文 * |
一种基于图像分区的自动曝光算法;甘玉泉等;《图像处理》;20091231;第25卷(第4-3期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN104333707A (en) | 2015-02-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104333707B (en) | Camera parameter method of adjustment and system | |
CN104301624B (en) | A kind of image taking brightness control method and device | |
JP6953311B2 (en) | Systems and methods for performing operations on pixel data | |
CN103826066B (en) | Automatic exposure adjusting method and system | |
CN104320593B (en) | A kind of digital camera automatic exposure control method | |
CN104917975B (en) | A kind of adaptive automatic explosion method based on target signature | |
CN104202535B (en) | A kind of automatic explosion method and device | |
CN106851138B (en) | A kind of image processing method based on HDR | |
JP2022184923A (en) | Systems and methods for generating high-dynamic range (hdr) pixel stream | |
CN101399924B (en) | Automatic exposure method and device based on brightness histogram | |
CN107343156A (en) | The method of adjustment and device of human face region auto-exposure control | |
US10453188B2 (en) | Methods and devices for improving image quality based on synthesized pixel values | |
US7706676B2 (en) | Automatic exposure control method | |
US9087385B2 (en) | Method for improving images captured underwater | |
KR20180035863A (en) | Image contrast enhancement method | |
WO2021088639A1 (en) | Image brightness processing method and apparatus, and image processing method and apparatus | |
CN107864342A (en) | Brightness of image adjusting method and device | |
CN105282529A (en) | RAW space based digital wide dynamic method and device | |
TW201536052A (en) | High dynamic range image generating method using exposure parameter measurement technique | |
CN112104814B (en) | Automatic exposure adjusting method and device and LED display screen correcting method | |
CN102510502B (en) | Method and system for generating high-dynamic-range image | |
CN109671044B (en) | A kind of more exposure image fusion methods decomposed based on variable image | |
JP2018098670A5 (en) | ||
CN107071294B (en) | Saturation adjusting method and system | |
CN101008764A (en) | Auto Exposure Measurement Method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address |
Address after: Kezhu road high tech Industrial Development Zone, Guangzhou city of Guangdong Province, No. 233 510670 Patentee after: VTRON GROUP Co.,Ltd. Address before: 510670 Guangdong city of Guangzhou province Kezhu Guangzhou high tech Industrial Development Zone, Road No. 233 Patentee before: VTRON TECHNOLOGIES Ltd. |
|
CP03 | Change of name, title or address | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20171010 |
|
CF01 | Termination of patent right due to non-payment of annual fee |