A brightness calibration method, system and device based on an industrial camera

Through the brightness calibration method of industrial cameras, a brightness conversion model is established, which solves the problems of high cost of brightness measurement and cumbersome operation of the display screen, and achieves efficient and low-cost brightness detection.

CN119359827BActive Publication Date: 2025-07-25SHENZHEN SEICHITECH TECHN CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411931125.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-07-25
Estimated Expiration
2044-12-26

AI Technical Summary

Technical Problem

In the prior art, display screen brightness measurement requires expensive measuring instruments, which leads to increased costs and cumbersome operations, making it difficult to efficiently perform brightness uniformity detection.

Method used

Through the brightness calibration method of industrial cameras, parameters such as exposure time, working distance and integrated sphere light source brightness are obtained, and a brightness conversion model is established to realize automatic brightness calibration.

Benefits of technology

It reduces the cost of brightness measurement, simplifies the operation process, and improves the efficiency and accuracy of brightness detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119359827B_ABST
    Figure CN119359827B_ABST
Patent Text Reader

Abstract

The present application discloses a brightness calibration method, system and device based on an industrial camera, which is used to determine the brightness of an object to be photographed through the camera shooting parameters. The method of the present application includes: obtaining the exposure time and working distance of the industrial camera and the brightness of the standard integrating sphere light source; respectively determining the first relationship, the second relationship and the third relationship corresponding to the influence of the exposure time, the working distance and the brightness of the standard integrating sphere light source on the average gray value of the image data by controlling variables; integrating the first relationship, the second relationship and the third relationship to obtain a brightness conversion model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a brightness calibration method, system and device based on an industrial camera. Background Art

[0002] With the continuous advancement of science and technology, the VR / AR display industry is in full swing, and a large number of panel display testing industries have emerged at home and abroad. The main material for panel display testing is the display screen, which is still of great concern to researchers at home and abroad. Display screen defect detection has also become a top priority, and its quality control cannot be ignored.

[0003] Brightness measurement is an indispensable part of the display industry. However, in most cases, multi-point measurement uniformity of display products is performed using measuring instruments. This is not only labor-intensive and cumbersome to operate, but also very expensive. Extensive use of these instruments in mass production equipment increases enterprise costs for manufacturers. Summary of the invention

[0004] In order to solve the above technical problems, the present application provides a brightness calibration method, system and device based on an industrial camera, which are used to determine the brightness of a photographed object through camera shooting parameters.

[0005] The technical solution provided in this application is described below:

[0006] The first aspect of the present application provides a brightness calibration method based on an industrial camera, comprising:

[0007] Obtain the benchmark exposure time, exposure time interval, working distance interval and benchmark working distance of the industrial camera and the brightness interval and benchmark brightness of the standard integrating sphere light source;

[0008] Splitting the brightness interval according to a first preset density to obtain a brightness collection;

[0009] The industrial camera is set according to the reference exposure time and the reference working distance, and the image data corresponding to each brightness state in the brightness collection is captured one by one by the industrial camera to obtain a first image data collection;

[0010] Splitting the exposure time interval according to a second preset density to obtain a collection of exposure times;

[0011] The industrial camera is set according to the reference brightness and the reference working distance, and the image data corresponding to each exposure time in the exposure time collection is captured one by one by the industrial camera to obtain a second image data collection;

[0012] Splitting the working distance interval according to a third preset density to obtain a working distance collection;

[0013] Set the industrial camera according to the reference brightness and the exposure time, and sequentially capture the image data corresponding to each working distance in the working distance set through the industrial camera to obtain a third image data set;

[0014] Sequentially obtain the first average gray value of all image data in the first image data set, and fit the first average gray value and the brightness of the corresponding standard integrating sphere light source to obtain a first relational expression;

[0015] Sequentially obtain the second average gray value of all image data in the second image data set, and fit the second average gray value and the corresponding exposure time to obtain a second relational expression;

[0016] Sequentially obtain the third average gray value of all image data in the third image data set, and fit the third average gray value and the corresponding working distance to obtain a third relational expression;

[0017] Integrate the first relational expression, the second relational expression and the third relational expression to obtain a brightness conversion model.

[0018] Optionally, the step of sequentially obtaining the first average gray value of all image data in the first image data set, and fitting the first average gray value and the brightness of the corresponding standard integrating sphere light source to obtain a first relational expression includes:

[0019] Sequentially obtain the first average gray value of all image data in the first image data set;

[0020] Taking the image data in the first image data set as an index, establish a first correspondence between the brightness of the standard integrating sphere light source corresponding to the image data and the first average gray value;

[0021] Perform fitting and solution on the first correspondence to obtain a first relational expression for representing the data relationship between the brightness of the standard integrating sphere light source and the first average gray value;

[0022] The first relational expression is expressed by the following formula:

[0023] ;

[0024] where Lv is the brightness of the standard integrating sphere light source corresponding to the first average gray value, G Lv is the first average gray value, and k is a calibration parameter

[0025] Optionally, the step of sequentially obtaining the second average gray value of all image data in the second image data set, and fitting the second average gray value and the corresponding exposure time to obtain a second relational expression includes:

[0026] Sequentially obtain the second average gray value of all the image data in the second image data set;

[0027] Using the image data in the second image data set as an index, establish a second corresponding relationship between the exposure time corresponding to the image data and the second average gray value;

[0028] Perform fitting and solution on the second corresponding relationship to obtain a second relational expression for representing the exposure time and the second average gray value;

[0029] When the exposure time is not equal to the reference exposure time, the second relational expression is represented by the following formula:

[0030] ;

[0031] where, is the average gray value of the image data corresponding to the reference exposure time, G t is the second average gray value, t is the current exposure time, and t0 is the reference exposure time.

[0032] Optionally, the step of sequentially obtaining the third average gray value of all the image data in the third image data set and fitting the third average gray value and the corresponding working distance to obtain a third relational expression includes:

[0033] Sequentially obtain the third average gray value of all the image data in the third image data set;

[0034] Using the image data in the third image data set as an index, establish a third corresponding relationship between the working distance corresponding to the image data and the third average gray value;

[0035] Calculate the gray differential value set of the third corresponding relationship;

[0036] According to the sequence of the working distance set, obtain two unequal gray differential values from the gray differential value set, and perform fitting on the two unequal gray differential values through a power function to obtain the third corresponding relationship.

[0037] Optionally, the step of obtaining two unequal gray differential values from the gray differential value set according to the sequence of the working distance set and performing fitting on the two unequal gray differential values through a power function to obtain the third corresponding relationship includes:

[0038] Sequentially obtain the gray differential values of two adjacent corresponding relationships in the third corresponding relationship;

[0039] Calculate the first model parameter, the second model parameter, and the third model parameter of the power function according to the two adjacent gray differential values until all the gray differential values in the third correspondence are calculated with other gray differential values except themselves, and obtain the target model parameter group;

[0040] Form a parameter sequence with the target model parameter group;

[0041] Calculate the mean square error of each group of parameters in the target model parameter group one by one according to the parameter sequence, and obtain the group of parameters with the smallest mean square error as the target parameter, and the target parameter is expressed as:

[0042] ;

[0043] where P * is the target parameter group, a * is the first model parameter of P * , A * is the second model parameter of P * , B * is the third model parameter of P * ;

[0044] Substitute the target parameter into the power function formula to obtain the third relation;

[0045] The third relation is:

[0046] .

[0047] Optionally, the calculation methods of the first model parameter, the second model parameter, and the third model parameter include:

[0048] The first model parameter is calculated by the following formula:

[0049] ;

[0050] The second model parameter is calculated by the following formula:

[0051] ;

[0052] The third model parameter is calculated by the following formula:

[0053] ;

[0054] In the above formulas, i, j are the image data and the corresponding working distance, △G i , △G jThe variation amounts of the gray-scale means of the image data at working distances i and j respectively, based on the reference working distance, Di and Dj are the variation values from the reference working distance at working distances i and j, and WD0 is the reference working distance. Optionally, integrating the first relational expression, the second relational expression, and the third relational expression to obtain the brightness conversion model includes:

[0055] Integrating the first relational expression and the second relational expression to obtain the following intermediate relational expression:

[0056] ;

[0057] Integrating the third relational expression and the intermediate relational expression to obtain the following brightness conversion model:

[0058] ;

[0059] where G is the average gray scale value of the current image, k is the calibration parameter of the brightness of the standard integrating sphere light source and the average gray scale value, is the correction value of the current exposure time based on the reference exposure time, is the correction value of the current working distance based on the reference working distance.

[0060] The second aspect of the present application provides a brightness calibration system based on an industrial camera, including:

[0061] An acquisition unit for acquiring the reference exposure time, exposure time interval, working distance interval, reference working distance of the industrial camera, and the brightness interval and reference brightness of the standard integrating sphere light source;

[0062] A first splitting unit for splitting the brightness interval according to a first preset density to obtain a brightness set;

[0063] A first shooting unit for setting the industrial camera according to the reference exposure time and the reference working distance, and sequentially shooting the image data corresponding to each brightness state in the brightness set through the industrial camera to obtain a first image data set;

[0064] A second splitting unit for splitting the exposure time interval according to a second preset density to obtain an exposure time set;

[0065] A second shooting unit for setting the industrial camera according to the reference brightness and the reference working distance, and sequentially shooting the image data corresponding to each exposure time in the exposure time set through the industrial camera to obtain a second image data set;

[0066] A third splitting unit for splitting the working distance interval according to a third preset density to obtain a working distance set;

[0067] A third shooting unit, configured to set the industrial camera according to the reference brightness and the exposure time, and sequentially shoot the image data corresponding to each working distance in the working distance set through the industrial camera, so as to obtain a third image data set;

[0068] A first fitting unit, configured to sequentially obtain the first average gray value of all image data in the first image data set, and fit the first average gray value and the brightness of the corresponding standard integrating sphere light source to obtain a first relational expression;

[0069] A second fitting unit, configured to sequentially obtain the second average gray value of all image data in the second image data set, and fit the second average gray value and the corresponding exposure time to obtain a second relational expression;

[0070] A third fitting unit, configured to sequentially obtain the third average gray value of all image data in the third image data set, and fit the third average gray value and the corresponding working distance to obtain a third relational expression;

[0071] An integration unit, configured to integrate the first relational expression, the second relational expression, and the third relational expression to obtain a brightness conversion model.

[0072] Optionally, the first fitting unit is mainly configured to:

[0073] Sequentially obtain the first average gray value of all image data in the first image data set;

[0074] Taking the image data in the first image data set as an index, establish a first correspondence between the brightness of the standard integrating sphere light source corresponding to the image data and the first average gray value;

[0075] Perform fitting and solution on the first correspondence to obtain a first relational expression for representing the data relationship between the brightness of the standard integrating sphere light source and the first average gray value;

[0076] The first relational expression is expressed by the following formula:

[0077] ;

[0078] where Lv is the brightness of the standard integrating sphere light source corresponding to the first average gray value, G Lv is the first average gray value, and k is a calibration parameter.

[0079] Optionally, the second fitting unit is mainly configured to:

[0080] Sequentially obtain the second average gray value of all image data in the second image data set;

[0081] Taking the image data in the second image data set as an index, establish a second correspondence between the exposure time corresponding to the image data and the second average gray value;

[0082] Perform fitting and solution on the second correspondence to obtain a second relational expression for representing the exposure time and the second average gray value;

[0083] When the exposure time is not equal to the reference exposure time, the second relational expression is represented by the following formula:

[0084] ;

[0085] where, is the average gray value of the image data corresponding to the reference exposure time, G t is the second average gray value, t is the current exposure time, and t0 is the reference exposure time.

[0086] Optionally, the third fitting unit is mainly used for:

[0087] Obtain the third average gray value of all image data in the third image data set one by one;

[0088] Taking the image data in the third image data set as an index, establish a third correspondence between the working distance corresponding to the image data and the third average gray value;

[0089] Calculate the gray differential value set of the third correspondence;

[0090] Obtain two unequal gray differential values from the gray differential value set according to the sequence of the working distance set, and perform fitting on the two unequal gray differential values through a power function to obtain the third correspondence.

[0091] Optionally, the third fitting unit is further used for:

[0092] Obtain the gray differential values of two adjacent correspondences in the third correspondence one by one;

[0093] Calculate the first model parameter, the second model parameter, and the third model parameter of the power function according to the two adjacent gray differential values until all the gray differential values in the third correspondence are calculated with other gray differential values except themselves to obtain a target model parameter group;

[0094] Form the target model parameter group into a group of parameter sequences;

[0095] Calculate the mean square error of each group of parameters in the target model parameter group one by one according to the parameter sequence, and obtain a group of parameters with the smallest mean square error as the target parameters, and the target parameters are expressed as:

[0096] ;

[0097] where P * is the target parameter group, a * is the first model parameter of P * and A * is the second model parameter of P * and B * is the third model parameter of P * ;

[0098] Substitute the target parameter into the power function formula to obtain a third relational expression;

[0099] The third relational expression is:

[0100] .

[0101] Optionally, the third fitting unit is further configured to:

[0102] The first model parameter is calculated by the following formula:

[0103] ;

[0104] The second model parameter is calculated by the following formula:

[0105] ;

[0106] The third model parameter is calculated by the following formula:

[0107] ;

[0108] In the above formulas, i and j are the image data and the corresponding working distances, and △G i , △G j are respectively the changes in the grayscale means of the image data at working distances i and j based on the reference working distance, Di and Dj are the change values from the reference working distance at working distances i and j, WD0 is the reference working distance, and N is the total number of moving step lengths in a single direction.

[0109] Optionally, the integration unit is mainly configured to:

[0110] Integrate the first relational expression and the second relational expression to obtain the following intermediate relational expression:

[0111] ;

[0112] Integrate the third relational expression and the intermediate relational expression to obtain the following brightness conversion model:

[0113] ;

[0114] wherein, G is the average gray value of the current image, k is the calibration parameter of the brightness of the standard integrating sphere light source and the average gray value, is the correction value of the current exposure time based on the reference exposure time, is the correction value of the current working distance based on the reference working distance.

[0115] The third aspect of the present application provides a brightness calibration device based on an industrial camera, and the device includes:

[0116] a processor, a memory, an input / output unit, and a bus;

[0117] The processor is connected to the memory, the input / output unit, and the bus;

[0118] The memory stores a program, and the processor calls the program to execute the method of the first aspect and any optional method in the first aspect.

[0119] The fourth aspect of the present application provides a computer-readable storage medium, and a program is stored on the computer-readable storage medium, and when the program is executed on a computer, it executes the method of the first aspect and any optional method in the first aspect.

[0120] It can be seen from the above technical solutions that the present application has the following advantages:

[0121] The present application conducts experiments on the correlation between the gray value corresponding to the brightness of the exposure time, the brightness of the integrating sphere light source, and the exposure time and the shooting distance by controlling variables. Specifically, the reference exposure time and reference working distance of the industrial camera and the reference brightness of the standard integrating sphere light source are determined. The two reference values are respectively set as fixed values, and the other reference value changes according to a preset rule within a preset interval. Image data of the light source is captured according to the changing state, and the relationship between the image gray value and the light source brightness and the relationship between the gray value and the shooting distance and exposure time are established. By fitting these relationships, a conversion relationship for converting the gray value of the image data into the brightness value of the shooting content is formed. BRIEF DESCRIPTION OF THE DRAWINGS

[0122] In order to more clearly illustrate the technical solutions in the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0123] Figure 1Schematic diagram of a process embodiment of the brightness calibration method based on an industrial camera in this application;

[0124] Figure 2a Schematic diagram of the first-stage process of another embodiment of the brightness calibration method based on an industrial camera in this application;

[0125] Figure 2b Schematic diagram of the second-stage process of another embodiment of the brightness calibration method based on an industrial camera in this application;

[0126] Figure 3 Schematic diagram of the structure of an embodiment of the brightness calibration system based on an industrial camera in this application;

[0127] Figure 4 Schematic diagram of the structure of an embodiment of the brightness calibration device based on an industrial camera in this application;

[0128] Figure 5 Image gray-scale - standard brightness fitting curve of the brightness calibration method based on an industrial camera in this application;

[0129] Figure 6 Fitting curve of working distance - average gray value of the brightness calibration method based on an industrial camera in this application. Detailed implementation manners

[0130] It should be noted that the brightness calibration method based on an industrial camera provided in this application can be applied to a terminal, a system, or a server. For example, the terminal can be a smart phone, a computer, a tablet computer, a smart TV, a smart watch, a portable computer terminal, or a fixed terminal such as a desktop computer. For the convenience of description, this application takes the terminal as the execution entity for example.

[0131] Next, the technical solutions in this application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without creative efforts shall fall within the protection scope of this application.

[0132] Please refer to Figure 1 , this application first provides an embodiment of the brightness calibration method based on an industrial camera, and this embodiment includes:

[0133] S101. Obtain the reference exposure time, exposure time interval, working distance interval, reference working distance of the industrial camera, and the brightness interval and reference brightness of the standard integrating sphere light source;

[0134] The brightness calibration of the captured content by an industrial camera mainly has the following parameters affecting the analysis process: exposure time, working distance, and the brightness of the captured content.

[0135] The exposure time is a specific exposure time value selected during brightness calibration. Generally, the reference exposure time is an initial value, serving as a reference point for subsequent other exposure times, and is used to establish the relationship between the camera's response characteristics and brightness measurement.

[0136] The exposure time interval refers to the range of all exposure times considered during the calibration process. The exposure time interval includes all possible values from the minimum exposure time to the maximum exposure time. The minimum value of the exposure time interval is usually 0, so as to avoid overexposure of the image data captured by the industrial camera by restricting the maximum exposure time.

[0137] The working distance refers to the distance between the industrial camera and the object to be captured. The reference working distance is a specific working distance value selected during calibration. In actual situations, the reference working distance is the initial value of the distance between the camera and the object to be captured when the camera is set in the shooting environment.

[0138] The working distance interval refers to the range of all working distances that can achieve effective shooting considered during the brightness calibration process. It includes all possible values from the minimum working distance to the maximum working distance. By moving the industrial camera within the working distance interval to obtain image data, the relationship between the gray value of the image data and the brightness of the object to be captured is further analyzed to see how it is affected by the distance between the industrial camera and the object to be captured.

[0139] The brightness of the standard integrating sphere light source is used as the brightness of the object to be captured during the brightness calibration process. The reference brightness is a specific brightness value selected during calibration. In this embodiment, it is generally the initial value of the brightness of the standard integrating sphere light source.

[0140] The brightness interval is the range of brightness that the object to be captured will produce. During the calibration process, the terminal captures the brightness of the standard integrating sphere light source through the industrial camera. This brightness interval is the brightness change interval of the standard integrating sphere light source during the brightness calibration process, and is used to simulate the brightness states produced by the object to be captured at different brightness levels, so as to obtain the relationship between different brightness levels and the gray scale of the captured image data.

[0141] S102. Split the brightness interval according to the first preset density to obtain a brightness set;

[0142] The first preset density is the value of the unit brightness change of the standard integrating sphere light source when acquiring image data of the standard integrating sphere light source. For example, the brightness data in the brightness set starts increasing from 0 nit, and the industrial camera needs to acquire image data every 10 nit. At this time, the first preset density is 10 nit, until it is calculated from 0 nit to the maximum value of the brightness interval, so that the data included in the brightness set are all brightness parameters with an interval of 10 nit, the minimum value is 0 nit, and the maximum value is the maximum value of the brightness interval.

[0143] S103. Set the industrial camera according to the reference exposure time and the reference working distance, and sequentially capture the image data corresponding to each brightness state in the brightness set through the industrial camera to obtain the first image data set;

[0144] Adjust the brightness of the standard integrating sphere light source according to the brightness of the brightness set and sequentially capture through the industrial camera to obtain the first image data set. The exposure time and the working distance of the image data in the first image data set are the reference exposure time and the reference working distance respectively and will not change. When capturing the image data in the first image data set, the only changing data is the brightness of the standard integrating sphere light source.

[0145] S104. Split the exposure time interval according to the second preset density to obtain the exposure time set;

[0146] The terminal obtains parameters similar to those in step S102 for the exposure time interval according to the second preset density. The second preset density is the unit change value for the exposure time. The interval duration between two adjacent data times in the exposure time set is equal to the second preset density. In the exposure time set, the first data of the exposure time is the minimum value of the exposure time interval, and the last data of the exposure time is the maximum value of the exposure time interval.

[0147] S105. Set the industrial camera according to the reference brightness and the reference working distance, and sequentially capture the image data corresponding to each exposure time in the exposure time set through the industrial camera to obtain the second image data set;

[0148] When obtaining the second image data set, the brightness of the standard integrating sphere light source is the reference brightness, and the distance between the industrial camera and the standard integrating sphere light source is the reference shooting distance. Among them, the only changing data is the exposure time of the industrial camera. Each image data corresponds to an exposure time value in the exposure time set, and the image sorting in the second image data set is the same as the exposure time order sorting in the exposure time set, so that the data in the exposure time set and the second image data set are in one-to-one correspondence.

[0149] S106. Split the working distance interval according to the third preset density to obtain the working distance set;

[0150] Different from the exposure time and brightness data, the working distance has offset values in both positive and negative directions. That is, the reference working distance is at the middle position. Thus, after the terminal determines the reference working distance of the industrial camera, the distances from the reference working distance to the maximum and minimum values of the working distance interval are used as the movable distances. Starting from the minimum value of the working distance interval, the working distance interval is split according to the third preset density to obtain a set of working distances. Among them, the position difference between two adjacent working distances in the set of working distances is the step size.

[0151] S107. Set the industrial camera according to the reference brightness and exposure time, and use the industrial camera to sequentially capture the image data corresponding to each working distance in the set of working distances to obtain a third set of image data;

[0152] When obtaining the third set of image data, the brightness of the standard integrating sphere light source is the reference brightness, and the exposure time of the industrial camera is the reference exposure time. Only the working distance of the industrial camera changes. The data in the third set of image data are collected according to the working distances in the set of working distances. The image data therein correspond one-to-one with the set of working distances and have the same sorting method. That is, the position of the image data corresponding to the first data in the set of working distances in the third set of data is also the first data.

[0153] Specifically, within a certain range before and after the reference working distance WD0, assuming that the moving step size during the measurement process is d, the measurement range is [WD0 - Nd, WD0 + Nd], where N is the third preset density.

[0154] When the working distance changes each time, use the industrial camera to take pictures of the integrating sphere light source, and then calculate the average gray value of the rectangular area image to finally obtain a data set of working distance changes.

[0155] S108. Sequentially obtain the first average gray values of all the image data in the first set of image data, and fit the first average gray value and the corresponding brightness of the standard integrating sphere light source to obtain a first relationship;

[0156] Because when the image data in the first set of image data are obtained, the only parameter that changes is the brightness of the standard integrating sphere light source. Therefore, the reason for the change in the average gray value of the image data can only be caused by the change in the brightness of the standard integrating sphere light source. After determining that there is a relationship between the average gray value of the image data and the brightness of the standard integrating sphere light source, the average gray value and the brightness are fitted and solved. The methods of fitting and solving include, but are not limited to: polynomial, exponential, logarithmic, trigonometric function and other methods.

[0157] Specifically refer to Figure 5 , Figure 5It is the fitting curve of image gray level - standard brightness, which reflects the relationship between the brightness of the photographed object and the average gray value of the image data of the photographed object under the conditions of reference exposure time t0 = 1ms, reference working distance WD0 = 238mm, aperture F0 = 1.4, and photographing in a darkroom. According to the image, the light source brightness and the average image gray level show a basically linear relationship, that is, it can be expressed by the formula y = kx + b.

[0158] In actual situations, since the average gray value is also 0 when the brightness value is 0, therefore, after determining the basic formula of the linear relationship, the constant term is discarded, and the actually used model of the first relational expression is y = kx. After fitting and solving, the obtained result is the first relational expression for representing the relationship between brightness and average gray value change.

[0159] S109. Obtain the second average gray value of all image data in the second image data set one by one, and fit the second average gray value and the corresponding exposure time to obtain a second relational expression;

[0160] Similar to the process of step S108, after determining the average gray value of the image data in the second image data set, the result obtained by fitting and solving the average gray value and the exposure time of the image data in the second image data set is that the relationship between the exposure time and the average gray value is a proportional change relationship, that is, the ratio of the current exposure time to the average gray value of the corresponding image data is equal. Specifically, when the exposure time is t and the average gray value is G, the ratio of the average gray value to the exposure time of the i-th image is equal to the ratio of the exposure time to the average gray value of the n-th image. That is: G i / t i = G n / t n .

[0161] In camera imaging, the brightness of the image is proportional to the exposure time. This means that if the exposure time increases, the image will be brighter; if the exposure time decreases, the image will be darker. To maintain the consistency of image brightness at different exposure times, it is necessary to adjust the gray value to compensate for the change in exposure time. When the reference exposure time is t0, the obtained second relational expression is: G t = G lv* t0 / t, and the actual content represented by this formula is that at any exposure time t, the average gray value G t is equal to the gray value G lv obtained under the reference exposure time t0 (obtained from step S108) multiplied by t0 / t.

[0162] S110. Obtain the third average gray value of all image data in the third image data set one by one, and fit the third average gray value and the corresponding working distance to obtain a third relationship;

[0163] Specifically refer to Figure 6 , Figure 6 is the fitting curve of working distance - average gray value. The specific conditions are as follows: set the exposure time t0 = 1ms, aperture F0 = 1.4, WD0 = 238mm. The fitting curve obtained with WD0 as the center and the working distance step WD = 30mm. According to the fitting curve, it can be seen that the curve is close to the power function image. Therefore, the power function method is used for fitting to find the required parameters and obtain the third relationship.

[0164] S111. Integrate the first relationship, the second relationship, and the third relationship to obtain a brightness conversion model.

[0165] According to the relationship between the brightness and the average gray value of the image represented by the first relationship determined in step S102, the result obtained by integrating the correction value of the exposure time corresponding to the second relationship affecting the average gray value of the image data and the correction value of the working distance corresponding to the third relationship affecting the average gray value of the image data is the brightness conversion model.

[0166] By calculating the brightness of the image content through this brightness conversion model, the brightness of the photographed content can be calculated through the image data, and the calculation result will be close to the true brightness of the image content, so as to detect the actual brightness of the image data content according to this brightness conversion model.

[0167] Please refer to Figures 2a to 2b , another embodiment of the brightness calibration method based on an industrial camera is provided in the embodiment of the present application. This embodiment includes:

[0168] S201. Obtain the reference exposure time, exposure time interval, working distance interval, reference working distance of the industrial camera, and the brightness interval and reference brightness of the standard integrating sphere light source;

[0169] S202. Split the brightness interval according to the first preset density to obtain a brightness set;

[0170] S203. Set the industrial camera according to the reference exposure time and reference working distance, and use the industrial camera to take the image data corresponding to each brightness state in the brightness set one by one to obtain a first image data set;

[0171] S204. Split the exposure time interval according to the second preset density to obtain an exposure time set;

[0172] S205. Set the industrial camera according to the reference brightness and the reference working distance, and capture the corresponding image data at each exposure time in the exposure time set one by one through the industrial camera to obtain a second set of image data;

[0173] S206. Split the working distance interval according to the third preset density to obtain a set of working distances;

[0174] S207. Set the industrial camera according to the reference brightness and the exposure time, and capture the corresponding image data at each working distance in the set of working distances one by one through the industrial camera to obtain a third set of image data;

[0175] Steps S201 to S207 in this embodiment are similar to steps S101 to S107 in the foregoing embodiment, and will not be elaborated here specifically.

[0176] S208. Obtain the first average gray value of all the image data in the first set of image data one by one;

[0177] The average gray value is determined by determining the ROI area, calculating the image gray value of each partition in the ROI area, and then calculating the average value of each block in these ROI areas.

[0178] Specifically, select a rectangular area with a certain size range in the image data whose gray value needs to be determined. For example, assume that the actual size of the image of the image data is height and width respectively, and the terminal calculates the center point coordinates of the image as height / 2, width / 2. Taking the center point coordinates as the reference, select an ROI area with a size of height*0.3 / 2 and width*0.3 / 2 along the length and width directions respectively as the rectangular area;

[0179] Calculate the average gray value. The average gray value is obtained by first dividing the ROI area image into blocks, then calculating the average gray value of the divided images, and finally obtaining the average gray value data of the image rectangular area.

[0180] S209. Establish a first correspondence between the brightness of the standard integrating sphere light source corresponding to the image data and the first average gray value with the image data in the first set of image data as the index;

[0181] In this embodiment, the terminal needs to obtain the brightness set of the standard integrating sphere light source corresponding to all images in the first image set and the average gray value data of the image data itself. It should be noted that the average gray value data is the average of the gray value data of each partition after the ROI region corresponding to the image data is segmented. Therefore, the average gray value data corresponds to the gray value of an image data. When the terminal performs subsequent calculations, it needs to obtain the corresponding standard integrating sphere light source brightness and average gray value data according to the image data, and determine the relationship between the brightness of the standard integrating sphere light source and the gray value of the image data in the model. Therefore, the terminal needs to use the image data as an index identifier to determine the corresponding relationship between the brightness of the standard integrating sphere light source and the average gray value.

[0182] S210. Fit and solve the first corresponding relationship to obtain a first relational expression representing the data relationship between the brightness of the standard integrating sphere light source and the first average gray value;

[0183] The first relational expression is expressed by the following formula:

[0184] ;

[0185] where Lv is the brightness of the standard integrating sphere light source corresponding to the first average gray value, G Lv is the first average gray value, and k is a calibration parameter.

[0186] It should be noted that the current brightness Lv and the average gray value G Lv are basically linearly related. According to the foregoing description, the model used to calculate the first relational expression is the state after discarding the constant term of y = kx + b, that is, y = kx. When y is the current brightness and x is G Lv , this model is converted into the first relational expression, that is, the above formula.

[0187] where k is a calibration parameter, and the calibration parameter is used to determine the relationship between the current brightness and the average gray value when the exposure time is the reference exposure time and the working distance is the reference working distance. It should be noted that G Lv is the average gray value of the image data when the exposure time is the reference exposure time and the working distance is the reference working distance.

[0188] S211. Obtain the second average gray value of all image data in the second image data set one by one;

[0189] S212. Establish a second corresponding relationship between the exposure time corresponding to the image data and the second average gray value with the image data in the second image data set as an index;

[0190] It should be noted that when acquiring the image data in the second image data set, the brightness of the standard integrating sphere light source is the reference brightness and the working distance is the reference working distance. Therefore, when acquiring the image data in the second image data, the only variable is the exposure time.

[0191] Steps S211 and S212 are similar to steps S208 and S209 in the process of obtaining the average gray value, and will not be elaborated here.

[0192] S213. Fit and solve the second corresponding relationship to obtain a second relational expression for representing the exposure time and the second average gray value;

[0193] When the exposure time is not equal to the reference exposure time, the second relational expression is represented by the following formula:

[0194] ;

[0195] Where is the average gray value of the image data corresponding to the reference exposure time, G t is the second average gray value, t is the current exposure time, and t0 is the reference exposure time.

[0196] Specifically, when generating a function image according to the corresponding relationship between the exposure time and the average gray value, the obtained function image changes in equal proportion, that is: , where G n is the average gray value, and t n is the exposure time.

[0197] Therefore, after determining the relationship between the average gray value and the brightness of the object to be photographed according to step S210, when the terminal corrects the currently calculated brightness of the object to be photographed based on the exposure time, the terminal will multiply the average gray value G t corresponding to the image data by the proportional relationship t0 / t, so that the average gray value G t is closer to the average gray value at the reference exposure time . In actual situations, the average gray value is the image taken at the reference exposure time and the reference working distance under the current light source. Therefore is equivalent to G Lv Therefore, it satisfies Lv = kG Lv , and further makes Lv = k * G t * t0 / t.

[0198] S214. Obtain the third average gray value of all the image data in the third image data set one by one;

[0199] S215. Using the image data in the third image data set as an index, establish a third correspondence between the working distance corresponding to the image data and the third average gray value;

[0200] Steps S214 and S215 are similar to the process of obtaining the average gray value in steps S208 and S209, and the details are not elaborated here.

[0201] It should be noted that when obtaining the image data in the third image data set, the brightness of the standard integrating sphere light source is the reference brightness, and the exposure time is the reference exposure time. Therefore, when obtaining the image data in the third image data, the only variable is the working distance.

[0202] S216. Calculate the gray differential value set of the third correspondence;

[0203] Specifically, within a certain range before and after the working distance WD0 (assuming the moving step size in the measurement process is d, and the measurement range is [WD0 - Nd, WD0 + Nd]), every time the working distance changes, the terminal takes a picture of the integrating sphere light source through an industrial camera, and then calculates the average gray value of the image data. The finally obtained working distance set is expressed as: D = { -Nd, -(N - 1)d, …, 0, …(N - 1)d, Nd}; the corresponding set of gray means {G△WD | △WD ∈ D}.

[0204] Under this condition, using D = { -Nd, -(N - 1)d, …, 0, …(N - 1)d, Nd} and {M△WD | △WD ∈ D} for fitting calculation to obtain the first model parameter a, the second model parameter A, and the third model parameter B of the brightness distribution model. The specific fitting process is as follows.

[0205] S217. Obtain the gray differential values of two adjacent correspondences in the third correspondence one by one;

[0206] Take any two in the sequence {△G i | i = 1, 2, 3, …, 2N} to calculate the model parameter a, and estimate the corresponding parameters A and B, where △G i is the gray differential value of the image data corresponding to two adjacent correspondences, which are respectively expressed as G i and G j , where i and j are the image data corresponding to two adjacent correspondences, that is, j = i + 1 or j = i - 1, and then obtain , where D is the working distance set.

[0207] S218. Calculate the first model parameter, the second model parameter, and the third model parameter of the power function according to two adjacent gray differential values until all the gray differential values in the third correspondence relationship are calculated with other gray differential values except themselves, and obtain the target model parameter group;

[0208] It should be noted that the basic model of the power function is: G = A*(WD) a + B. In this case, the first model parameter, the second model parameter, and the third model parameter are calculated respectively in the following ways:

[0209] The first model parameter a is calculated by the following formula:

[0210] ;

[0211] Specifically, taking G = A*(WD) a + B as the basic model, a as a ij , A as A ij , B as B ij In the case of, a is an exponent. Therefore, to calculate the exponent, the exponent needs to be converted to a logarithm, that is, logG = logA + alogWD + logB. Assuming that B is very small relative to A*(WD) a , B can be ignored. Therefore, the equation is simplified to logG ≈ alogWD + logA.

[0212] Under the condition of logG ≈ alogWD + logA, perform linear regression, that is, logG = alogWD + C, where C = logA. At this time, the slope a can be calculated.

[0213] In this embodiment, the calculation is performed through two adjacent gray differential values, that is, there are two gray value means based on the reference value change amounts △G i and △G j corresponding to the working distances D i and D j , so that logG = alogWD + C is transformed into:

[0214] ;

[0215] The +1 in the calculation process of the first model parameter a is to adjust the linear relationship after logarithmic transformation to make it closer to the actual power function relationship, and finally obtain the calculation method of the first model parameter a based on two adjacent image data. After determining the exponent a, A describes the rate of change of the average gray value with the working distance at the reference working distance WD0, and B describes the gray baseline when the working distance is 0.

[0216] The second model parameter A is calculated by the following formula:

[0217] ;

[0218] Among them, A is calculated by dividing the difference in grayscale values at two different working distances by the difference in the power terms of the corresponding working distances. A ij represents the influence of each unit change in the working distance WD on the grayscale mean at the reference working distance WD0.

[0219] The third model parameter B is calculated by the following formula:

[0220] ;

[0221] Among them, B represents the grayscale baseline at the reference working distance WD0, which is used to represent the baseline grayscale level when there is no change in the working distance.

[0222] In the above formulas, i and j are the image data and the corresponding working distances, and △G i , △G j are respectively the change amounts of the grayscale means of the image data at working distances i and j based on the reference working distance. Di and Dj are the change values from the reference working distance at working distances i and j, and WD0 is the reference working distance.

[0223] S219. Form a group of parameter sequences from the target model parameter groups;

[0224] According to the above steps, a group of target model parameter groups will be generated between two adjacent image data. The model parameter groups are represented by P. Each target model parameter group contains the first model parameter a, the second model parameter A, and the third model parameter B. The target model parameter group is represented as P = (a ij , A ij , B ij ).

[0225] Form a group of parameter sequences from all the corresponding model parameters P = {a ij , A ij , B ij} obtained by the calculation in step S218. There are a total of N(2N - 1) kinds, where N is the maximum number of the step size d within the working distance interval.

[0226] S220. Calculate the mean square error of each group of parameters in the target model parameter group one by one according to the parameter sequence, and obtain the group of parameters with the minimum mean square error as the target parameters. The target parameters are represented as:

[0227] ;

[0228] Among them, P * is the target parameter group, and a* is the first model parameter of P * and A * is the second model parameter of P * and B * is the third model parameter of P * ;

[0229] Respectively obtain the model parameters {a ij , A ij , B ij} such that a set of parameter values with the minimum mean square error is used as the finally calibrated working distance model parameter .

[0230] The calculation method of the minimum mean square error is as follows:

[0231]

[0232] It should be noted that the mean square error is a common indicator to measure the difference between the model prediction value and the actual observation value. The mean square error formula is , where is the actual observation value, is the model prediction value, and n is the number of data points. Therefore, the above formula means that the average value of the sum of the squared prediction errors of all data points in the parameter sequence, and the goal is to minimize this average error, that is, to find the target model parameter group to minimize the sum of the squared errors.

[0233] Specifically, is the prediction of the gray mean value by the model at the working distance . The calculation method of this mean square error is essentially to obtain the parameter combination with the minimum mean square error by traversing all possible j values from 1 to N(2N−1).

[0234] S221. Substitute the target parameters into the power function formula to obtain the third relationship;

[0235] The third relationship is:

[0236] .

[0237] Similar to the second relationship, the third relationship is that the gray mean value G WD at any working distance WD is the gray mean value G WD0 at the reference working distance WD0 multiplied by the ratio . And G WD has the reference exposure time in the actual image acquisition, so G WD can be regarded as G t .

[0238] S222. Integrate the first relational expression and the second relational expression to obtain the following intermediate relational expression:

[0239] ;

[0240] In the actual situation, the average gray value is the image captured under the current light source at the reference exposure time and the reference working distance. Therefore is equivalent to G Lv So it satisfies Lv = kG Lv , and further makes Lv = k * G t * t0 / t.

[0241] S223. Integrate the third relational expression and the intermediate relational expression to obtain the following brightness conversion model:

[0242] ;

[0243] Similar to step S222, combining the description in step S221, it can be known that G WD can be regarded as G t .

[0244] Among them, G is the average gray value of the current image, k is the calibration parameter of the brightness of the standard integrating sphere light source and the average gray value, is the correction value of the current exposure time based on the reference exposure time, is the correction value of the current working distance based on the reference working distance.

[0245] Through the method provided in this embodiment, after obtaining the average gray value of the image data, the average gray value can be input into the brightness conversion model, and the brightness of the actual captured content in the image data can be obtained by calculating the average gray value through the brightness conversion model.

[0246] The above has described in detail the brightness calibration method based on an industrial camera in the embodiments of the present application. Next, the brightness calibration system and device based on an industrial camera will be described in detail.

[0247] Please refer to Figure 3 , an embodiment of the brightness calibration system based on an industrial camera provided in the embodiments of the present application includes:

[0248] An acquisition unit 301, configured to acquire the reference exposure time, exposure time interval, working distance interval, reference working distance of the industrial camera, and the brightness interval and reference brightness of the standard integrating sphere light source;

[0249] A first splitting unit 302, configured to split the brightness interval according to a first preset density to obtain a brightness set;

[0250] The first shooting unit 303 is configured to set an industrial camera according to a reference exposure time and a reference working distance, and sequentially shoot image data corresponding to each brightness state in a brightness set through the industrial camera to obtain a first image data set;

[0251] The second splitting unit 304 is configured to split an exposure time interval according to a second preset density to obtain an exposure time set;

[0252] The second shooting unit 305 is configured to set an industrial camera according to a reference brightness and a reference working distance, and sequentially shoot image data corresponding to each exposure time in the exposure time set through the industrial camera to obtain a second image data set;

[0253] The third splitting unit 306 is configured to split a working distance interval according to a third preset density to obtain a working distance set;

[0254] The third shooting unit 307 is configured to set an industrial camera according to a reference brightness and an exposure time, and sequentially shoot image data corresponding to each working distance in the working distance set through the industrial camera to obtain a third image data set;

[0255] The first fitting unit 308 is configured to sequentially obtain first average gray values of all image data in the first image data set, and fit the first average gray values and the brightness of a corresponding standard integrating sphere light source to obtain a first relationship;

[0256] The second fitting unit 309 is configured to sequentially obtain second average gray values of all image data in the second image data set, and fit the second average gray values and the corresponding exposure time to obtain a second relationship;

[0257] The third fitting unit 310 is configured to sequentially obtain third average gray values of all image data in the third image data set, and fit the third average gray values and the corresponding working distance to obtain a third relationship;

[0258] The integration unit 311 is configured to integrate the first relationship, the second relationship, and the third relationship to obtain a brightness conversion model.

[0259] Optionally, the first fitting unit 308 is mainly configured to:

[0260] Sequentially obtain first average gray values of all image data in the first image data set;

[0261] Taking the image data in the first image data set as an index, establish a first correspondence between the brightness of the standard integrating sphere light source corresponding to the image data and the first average gray value;

[0262] Fitting and solving the first corresponding relationship to obtain a first relational expression for representing the data relationship between the luminance of the standard integrating sphere light source and the first average gray value;

[0263] The first relational expression is expressed by the following formula:

[0264] ;

[0265] wherein, Lv is the luminance of the standard integrating sphere light source corresponding to the first average gray value, G Lv is the first average gray value, and k is a calibration parameter.

[0266] Optionally, the second fitting unit 309 is mainly used for:

[0267] Obtaining the second average gray value of all the image data in the second image data set one by one;

[0268] Taking the image data in the second image data set as an index, establishing a second corresponding relationship between the exposure time corresponding to the image data and the second average gray value;

[0269] Fitting and solving the second corresponding relationship to obtain a second relational expression for representing the exposure time and the second average gray value;

[0270] When the exposure time is not equal to the reference exposure time, the second relational expression is represented by the following formula:

[0271] ;

[0272] wherein, is the average gray value of the image data corresponding to the reference exposure time, G t is the second average gray value, t is the current exposure time, and t0 is the reference exposure time.

[0273] Optionally, the third fitting unit 310 is mainly used for:

[0274] Obtaining the third average gray value of all the image data in the third image data set one by one;

[0275] Taking the image data in the third image data set as an index, establishing a third corresponding relationship between the working distance corresponding to the image data and the third average gray value;

[0276] Calculating a gray differential value set of the third corresponding relationship;

[0277] Obtaining two unequal gray differential values from the gray differential value set according to the sequence of the working distance set, and fitting the two unequal gray differential values through a power function to obtain the third corresponding relationship.

[0278] Optionally, the third fitting unit 310 is further configured to:

[0279] Obtain the gray-scale differential values of two adjacent corresponding relationships in the third corresponding relationship one by one;

[0280] Calculate the first model parameter, the second model parameter, and the third model parameter of the power function based on the two adjacent gray-scale differential values until all the gray-scale differential values in the third corresponding relationship are calculated with other gray-scale differential values except themselves, to obtain a target model parameter group;

[0281] Form the target model parameter group into a group of parameter sequences;

[0282] Calculate the mean square error of each group of parameters in the target model parameter group one by one according to the parameter sequence, and obtain the group of parameters with the smallest mean square error as the target parameters, where the target parameters are expressed as:

[0283] ;

[0284] where P * is the target parameter group, a * is the first model parameter of P * A * is the second model parameter of P * B * is the third model parameter of P * ;

[0285] Substitute the target parameters into the power function formula to obtain a third relational expression;

[0286] The third relational expression is:

[0287] .

[0288] Optionally, the third fitting unit 310 is further configured to:

[0289] The first model parameter is calculated by the following formula:

[0290] ;

[0291] The second model parameter is calculated by the following formula:

[0292] ;

[0293] The third model parameter is calculated by the following formula:

[0294] ;

[0295] In the above formulas, i and j are the image data and the corresponding working distance, △G i , △G jThe variation amounts of the gray-scale means of the image data at working distances i and j respectively, based on the reference working distance, Di and Dj are the variation values from the reference working distance at working distances i and j, and WD0 is the reference working distance.

[0296] Optionally, the integration unit 311 is mainly used for:

[0297] Integrating the first relational expression and the second relational expression to obtain the following intermediate relational expression:

[0298] ;

[0299] Integrating the third relational expression and the intermediate relational expression to obtain the following brightness conversion model:

[0300] ;

[0301] Wherein, G is the average gray scale of the current image, k is the calibration parameter of the brightness of the standard integrating sphere light source and the average gray scale value, is the correction value of the current exposure time based on the reference exposure time, is the correction value of the current working distance based on the reference working distance.

[0302] In this embodiment, the functions of each unit correspond to the steps in the foregoing Figure 1 、 Figure 2a 、 Figure 2b illustrated embodiments, and will not be elaborated herein.

[0303] Please refer to Figure 4 , another embodiment of the brightness calibration device based on an industrial camera provided by the embodiment of the present application includes:

[0304] A processor 401, a memory 402, an input / output unit 403, and a bus 404;

[0305] The processor 401 is connected to the memory 402, the input / output unit 403, and the bus 404;

[0306] The processor 401 specifically executes the operations corresponding to the steps in Figure 1 、 Figure 2a 、 Figure 2b 's method, and will not be elaborated herein specifically.

[0307] The present application also relates to a computer-readable storage medium, on which a program is stored. It is characterized in that when the program runs on a computer, the computer is made to execute any of the foregoing methods.

[0308] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0309] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the couplings or direct couplings or communication connections shown or discussed with each other can be indirect couplings or communication connections through some interfaces, devices, or units, and can be in electrical, mechanical, or other forms.

[0310] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0311] In addition, in each embodiment of the present application, the functional units can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0312] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in each embodiment of the present application. The foregoing storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs, and other media that can store program codes.

Claims

1. A brightness calibration method based on an industrial camera, characterized in that, The method includes: Obtaining the reference exposure time, exposure time interval, working distance interval, reference working distance of the industrial camera, and the brightness interval and reference brightness of the standard integrating sphere light source; Splitting the brightness interval according to a first preset density to obtain a brightness set; Setting the industrial camera according to the reference exposure time and the reference working distance, and sequentially capturing image data corresponding to each brightness state in the brightness set through the industrial camera to obtain a first image data set; Splitting the exposure time interval according to a second preset density to obtain an exposure time set; Setting the industrial camera according to the reference brightness and the reference working distance, and sequentially capturing image data corresponding to each exposure time in the exposure time set through the industrial camera to obtain a second image data set; Splitting the working distance interval according to a third preset density to obtain a working distance set; Setting the industrial camera according to the reference brightness and the reference exposure time, and sequentially capturing image data corresponding to each working distance in the working distance set through the industrial camera to obtain a third image data set; Sequentially obtaining the first average gray value of all image data in the first image data set; Taking the image data in the first image data set as an index, establishing a first correspondence between the brightness of the standard integrating sphere light source corresponding to the image data and the first average gray value; Performing fitting solution on the first correspondence to obtain a first relational expression for representing the data relationship between the brightness of the standard integrating sphere light source and the first average gray value; The first relational expression is expressed by the following formula: ; wherein, Lv is the luminance of the standard integrating sphere light source corresponding to the first average gray value, G Lv is the first average gray value, and k is a calibration parameter; Sequentially obtaining the second average gray value of all image data in the second image data set; Taking the image data in the second image data set as an index, establishing a second correspondence between the exposure time corresponding to the image data and the second average gray value; Performing fitting solution on the second correspondence to obtain a second relational expression for representing the exposure time and the second average gray value; When the exposure time is not equal to the reference exposure time, the second relational expression is represented by the following formula: ; Among them, is the average gray value of the image data corresponding to the reference exposure time, G t is the second average gray value, t is the current exposure time, and t0 is the reference exposure time; Sequentially obtaining the third average gray value of all image data in the third image data set; Taking the image data in the third image data set as an index, establishing a third correspondence between the working distance corresponding to the image data and the third average gray value; Calculating a gray differential value set of the third correspondence; Obtaining two unequal gray differential values from the gray differential value set according to the sequence of the working distance set, and performing fitting on the two unequal gray differential values through a power function to obtain the third correspondence; Sequentially obtaining the gray differential values of two adjacent correspondences in the third correspondence; Calculating the first model parameter, second model parameter, and third model parameter of the power function according to the two adjacent gray differential values until all gray differential values in the third correspondence are calculated with other gray differential values except itself to obtain a target model parameter group; Forming the target model parameter group into a group of parameter sequences; Calculate the mean square error of each set of parameters in the target model parameter group one by one according to the parameter sequence, and obtain the set of parameters with the minimum mean square error as the target parameter, which is expressed as: ; Where P * is the target parameter group, a * is the first model parameter of P * A * is the second model parameter of P * B * is the third model parameter of P * ; Substitute the target parameter into the power function formula to obtain a third relational expression; The third relational expression is: ; where WD0 is the reference working distance and WD is the working distance step; Integrate the first relational expression, the second relational expression and the third relational expression to obtain a brightness conversion model.

2. The method according to claim 1, characterized in that, The calculation methods of the first model parameter, the second model parameter and the third model parameter include: The first model parameter is calculated by the following formula: ; The second model parameter is calculated by the following formula: ; The third model parameter is calculated by the following formula: ; Among them, B ij represents the gray level baseline of the image data i at the reference working distance WD0, and the gray level baseline is used to represent the gray level when there is no change in the working distance. is the gray value of the image data i when there is no change in the working distance; Separate the model parameters {a ij , A ij , B ij } are obtained, and the set of parameter values with the smallest mean square error is used as the model parameters of the finally calibrated working distance ; In the above formula, i and j are the image data and the corresponding working distances, and △G i and △G j are the changes in the grayscale means of the image data at working distances i and j based on the reference working distance, G i and G j are the grayscale means of the image data at working distances i and j based on the reference working distance, D i and D j are the change values of the working distances i and j from the reference working distance, WD0 is the reference working distance, and N is the total number of working distance step sizes moved in one direction.

3. The method according to claim 1, characterized in that, The integration of the first relational expression, the second relational expression and the third relational expression to obtain a brightness conversion model includes: Integrate the first relational expression and the second relational expression to obtain the following intermediate relational expression: ; Integrate the third relational expression and the intermediate relational expression to obtain the following brightness conversion model: ; where G is the average gray value of the current image, and k is the calibration parameter of the brightness of the standard integrating sphere light source and the average gray value. is the correction value of the current exposure time based on the reference exposure time. is the correction value of the current working distance based on the reference working distance.

4. An industrial camera-based brightness calibration system, characterized in that, The system includes: An acquisition unit for acquiring the reference exposure time, exposure time interval, working distance interval, reference working distance of an industrial camera, and the brightness interval and reference brightness of a standard integrating sphere light source; A first splitting unit for splitting the brightness interval according to a first preset density to obtain a brightness set; A first photographing unit for setting the industrial camera according to the reference exposure time and the reference working distance, and successively photographing the image data corresponding to each brightness state in the brightness set through the industrial camera to obtain a first image data set; A second splitting unit for splitting the exposure time interval according to a second preset density to obtain an exposure time set; A second photographing unit for setting the industrial camera according to the reference brightness and the reference working distance, and successively photographing the image data corresponding to each exposure time in the exposure time set through the industrial camera to obtain a second image data set; A third splitting unit for splitting the working distance interval according to a third preset density to obtain a working distance set; A third photographing unit for setting the industrial camera according to the reference brightness and the reference exposure time, and successively photographing the image data corresponding to each working distance in the working distance set through the industrial camera to obtain a third image data set; A first fitting unit for successively obtaining the first average gray value of all the image data in the first image data set, and fitting the first average gray value and the corresponding brightness of the standard integrating sphere light source to obtain a first relational expression; A second fitting unit for successively obtaining the second average gray value of all the image data in the second image data set, and fitting the second average gray value and the corresponding exposure time to obtain a second relational expression; A third fitting unit for successively obtaining the third average gray value of all the image data in the third image data set, and fitting the third average gray value and the corresponding working distance to obtain a third relational expression; An integration unit, configured to integrate the first relational expression, the second relational expression, and the third relational expression to obtain a brightness conversion model; The first fitting unit is further configured to: Obtain the first average gray value of all the image data in the first image data set one by one; Taking the image data in the first image data set as an index, establish a first correspondence between the brightness of the standard integrating sphere light source corresponding to the image data and the first average gray value; Perform fitting and solution on the first correspondence to obtain a first relational expression for representing the data relationship between the brightness of the standard integrating sphere light source and the first average gray value; The first relational expression is expressed by the following formula: ; Among them, Lv is the luminance of the standard integrating sphere light source corresponding to the first average gray value, G Lv is the first average gray value, and k is a calibration parameter; The second fitting unit is further configured to: Obtain the second average gray value of all the image data in the second image data set one by one; Taking the image data in the second image data set as an index, establish a second correspondence between the exposure time corresponding to the image data and the second average gray value; Perform fitting and solution on the second correspondence to obtain a second relational expression for representing the exposure time and the second average gray value; When the exposure time is not equal to the reference exposure time, the second relational expression is represented by the following formula: ; Among them, is the average gray value of the image data corresponding to the reference exposure time, G t is the second average gray value, t is the current exposure time, and t0 is the reference exposure time; The third fitting unit is further configured to: Obtain the third average gray value of all the image data in the third image data set one by one; Taking the image data in the third image data set as an index, establish a third correspondence between the working distance corresponding to the image data and the third average gray value; Calculate a set of gray differential values of the third correspondence; Obtain two unequal gray differential values from the set of gray differential values according to the sequence of the working distance set, and perform fitting on the two unequal gray differential values through a power function to obtain a third correspondence; The third fitting unit is further configured to: Obtain the gray differential values of two adjacent correspondences in the third correspondence one by one; Calculate the first model parameter, the second model parameter, and the third model parameter of the power function according to the two adjacent gray differential values until all the gray differential values in the third correspondence are calculated with other gray differential values except itself to obtain a target model parameter group; Form the target model parameter group into a set of parameter sequences; Calculate the mean square error of each group of parameters in the target model parameter group one by one according to the parameter sequence, and obtain a group of parameters with the smallest mean square error as the target parameters, and the target parameters are expressed as: ; Among which P * is the target parameter group, a * is the first model parameter of P * and A * is the second model parameter of P * and B * is the third model parameter of P * ; Substitute the target parameters into the power function formula to obtain a third relational expression; The third relational expression is: ; Wherein, WD0 is the reference working distance, and WD is the working distance step.

5. An industrial camera-based brightness calibration device, characterized in that, The device includes: A processor, a memory, an input / output unit, and a bus; The processor is connected to the memory, the input / output unit, and the bus; The memory stores a program, and the processor calls the program to execute the method according to any one of claims 1 to 3.

6. A computer-readable storage medium, on which a program is stored, and when the program is executed on a computer, it executes the method according to any one of claims 1 to 3.