Brightness calibration method, system and device based on industrial camera

Based on the brightness calibration method of industrial cameras, the problem of expensive and complex operations in existing technologies has been solved, and efficient and accurate brightness measurement is achieved, reducing costs and complexity.

CN119359827AActive Publication Date: 2025-01-24SHENZHEN SEICHITECH TECHN CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

The prior art relies on expensive measuring instruments in display brightness measurement, resulting in high workload, troublesome operation and high cost.

Method used

Adopt the brightness calibration method based on industrial cameras, by obtaining the benchmark exposure time, exposure time interval, working distance range, and benchmark working distance of the industrial camera. The image data at the working distance is established to create a brightness conversion model.

Benefits of technology

It achieves fast and accurate brightness measurement through industrial cameras, reduces equipment costs and operational complexity, and improves measurement efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119359827A_ABST
    Figure CN119359827A_ABST
Patent Text Reader

Abstract

The invention discloses a brightness calibration method, system and device based on an industrial camera. The brightness calibration method, system and device are used for determining the brightness of a shot object through camera shooting parameters. The method comprises the following steps: obtaining the exposure time and working distance of an industrial camera and the brightness of a standard integrating sphere light source; respectively determining a first relational expression, a second relational expression and a third relational expression 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 through the control variables; and integrating the first relational expression, the second relational expression and the third relational expression 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: The first aspect of the present application provides a brightness calibration method based on an industrial camera, comprising: 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; Splitting the brightness interval according to a first preset density to obtain a brightness collection; 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; Splitting the exposure time interval according to a second preset density to obtain a collection of exposure times; 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; Splitting the working distance interval according to a third preset density to obtain a working distance collection; The industrial camera is set according to the reference brightness and the exposure time, and the industrial camera is used to capture image data corresponding to each working distance in the working distance collection one by one to obtain a third image data collection; Acquire the first average grayscale value of all image data in the first image data collection one by one, and fit the first average grayscale value and the brightness of the corresponding standard integrating sphere light source to obtain a first relationship; Acquire the second average grayscale value of all image data in the second image data set one by one, and fit the second average grayscale value and the corresponding exposure time to obtain a second relationship; Acquire the third average grayscale value of all image data in the third image data collection one by one, and fit the third average grayscale value and the corresponding working distance to obtain a third relationship; The first relational expression, the second relational expression and the third relational expression are integrated to obtain a brightness conversion model.

[0006] Optionally, the step of acquiring the first average grayscale value of all image data in the first image data set one by one, and fitting the first average grayscale value and the brightness of the corresponding standard integrating sphere light source to obtain a first relationship includes: Acquire a first average grayscale value of all image data in the first image data collection one by one; Using the image data in the first image data collection as an index, establishing a first corresponding relationship between the brightness of a standard integrating sphere light source corresponding to the image data and the first average grayscale value; Fitting and solving the first corresponding relationship to obtain a first relationship equation for representing the data relationship between the brightness of the standard integrating sphere light source and the first average grayscale value; The first relationship is expressed by the following formula: ; Where Lv is the standard integrating sphere light source brightness corresponding to the first average gray value, G Lv is the first average gray value, k is the calibration parameter Optionally, the acquiring the second average grayscale value of all image data in the second image data set one by one, and fitting the second average grayscale value and the corresponding exposure time to obtain the second relationship includes: acquiring the second average grayscale value of all the image data in the second image data collection one by one; Using the image data in the second image data collection as an index, establishing a second corresponding relationship between the exposure time corresponding to the image data and the second average grayscale value; Fitting and solving the second corresponding relationship to obtain a second relationship expression for representing the exposure time and the second average grayscale value; When the exposure time is not equal to the reference exposure time, the second relational expression is expressed by the following formula: ; Among them, Gt0 is the average grayscale 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, t 0 is the base exposure time.

[0007] Optionally, the step of acquiring the third average grayscale value of all image data in the third image data set one by one, and fitting the third average grayscale value and the corresponding working distance to obtain a third relationship includes: Acquire a third average grayscale value of all image data in the third image data collection one by one; Using the image data in the third image data collection as an index, establishing a third corresponding relationship between the working distance corresponding to the image data and the third average grayscale value; Calculating a grayscale differential value collection of the third corresponding relationship; Two unequal grayscale differential values ​​are obtained from the grayscale differential value collection according to the sequence of the working distance collection, and the two unequal grayscale differential values ​​are fitted by a power function to obtain a third corresponding relationship.

[0008] Optionally, obtaining two unequal grayscale differential values ​​from the grayscale differential value collection according to the sequence of the working distance collection, and fitting the two unequal grayscale differential values ​​by a power function to obtain a third corresponding relationship includes: Obtaining grayscale differential values ​​of two adjacent corresponding relationships in the third corresponding relationship one by one; Calculating the first model parameter, the second model parameter and the third model parameter of the power function according to the two adjacent grayscale differential values, until all grayscale differential values ​​in the third corresponding relationship are calculated with other grayscale differential values ​​except themselves, to obtain a target model parameter group; Grouping the target model parameters into a set of parameter sequences; The mean square error of the parameters of each group in the target model parameter group is calculated one by one according to the parameter sequence, and a group of parameters with the smallest mean square error is obtained as the target parameters, and the target parameters are 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*, and B* is the third model parameter of P*; Substituting the target parameter into the power function formula, a third relational expression is obtained; The third relational expression is: .

[0009] Optionally, the calculation method of the first model parameter, the second model parameter and the third model parameter includes: 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: ; In the above formula, i, j are image data and corresponding working distances, △Gi, △Gj are the changes in the grayscale mean of the image data when the working distances are i and j respectively based on the reference working distance, Di, Dj are the changes in the working distances i and j from the reference working distance, and WD0 is the reference working distance. Optionally, the integration of the first relational expression, the second relational expression and the third relational expression to obtain a brightness conversion model includes: By integrating the first relational expression and the second relational expression, the following intermediate relational expression is obtained: ; By integrating the third relational expression and the intermediate relational expression, the following brightness conversion model is obtained: ; Among them, G is the grayscale average value of the current image, k is the calibration parameter of the brightness and average grayscale value of the standard integrating sphere light source, is the correction value of the current exposure time based on the reference exposure time, It is the correction value of the current working distance based on the reference working distance.

[0010] The second aspect of the present application provides a brightness calibration system based on an industrial camera, comprising: An acquisition unit, used to acquire a reference exposure time, an exposure time interval, a working distance interval and a reference working distance of an industrial camera and a brightness interval and a reference brightness of a standard integrating sphere light source; A first splitting unit, configured to split the brightness interval according to a first preset density to obtain a brightness set; A first shooting unit is used to set the industrial camera according to the reference exposure time and the reference working distance, and to shoot the image data corresponding to each brightness state in the brightness collection one by one by the industrial camera to obtain a first image data collection; A second splitting unit, configured to split the exposure time interval according to a second preset density to obtain a set of exposure times; A second shooting unit is used to set the industrial camera according to the reference brightness and the reference working distance, and to shoot the image data corresponding to each exposure time in the exposure time collection one by one through the industrial camera to obtain a second image data collection; A third splitting unit, configured to split the working distance interval according to a third preset density to obtain a working distance collection; A third shooting unit is used to set the industrial camera according to the reference brightness and the exposure time, and to shoot the image data corresponding to each working distance in the working distance collection one by one through the industrial camera to obtain a third image data collection; A first fitting unit, used for acquiring first average grayscale values ​​of all image data in the first image data set one by one, and fitting the first average grayscale value and the brightness of the corresponding standard integrating sphere light source to obtain a first relationship; A second fitting unit is used to 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 relationship; A third fitting unit is used to 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; An integration unit is used to integrate the first relational expression, the second relational expression and the third relational expression to obtain a brightness conversion model.

[0011] Optionally, the first fitting unit is mainly used for: Acquire a first average grayscale value of all image data in the first image data collection one by one; Using the image data in the first image data collection as an index, establishing a first corresponding relationship between the brightness of a standard integrating sphere light source corresponding to the image data and the first average grayscale value; Fitting and solving the first corresponding relationship to obtain a first relationship equation for representing the data relationship between the brightness of the standard integrating sphere light source and the first average grayscale value; The first relationship is expressed by the following formula: ; Where Lv is the standard integrating sphere light source brightness corresponding to the first average gray value, G Lv is the first average gray value, and k is a calibration parameter.

[0012] Optionally, the second fitting unit is mainly used for: acquiring the second average grayscale value of all the image data in the second image data collection one by one; Using the image data in the second image data collection as an index, establishing a second corresponding relationship between the exposure time corresponding to the image data and the second average grayscale value; Fitting and solving the second corresponding relationship to obtain a second relationship expression for representing the exposure time and the second average grayscale value; When the exposure time is not equal to the reference exposure time, the second relational expression is expressed by the following formula: ; Among them, Gt0 is the average grayscale value of the image data corresponding to the reference exposure time, Gt is the second average grayscale value, t is the current exposure time, and t0 is the reference exposure time.

[0013] Optionally, the third fitting unit is mainly used for: Acquire a third average grayscale value of all image data in the third image data collection one by one; Using the image data in the third image data collection as an index, establishing a third corresponding relationship between the working distance corresponding to the image data and the third average grayscale value; Calculating a grayscale differential value collection of the third corresponding relationship; Two unequal grayscale differential values ​​are obtained from the grayscale differential value collection according to the sequence of the working distance collection, and the two unequal grayscale differential values ​​are fitted by a power function to obtain a third corresponding relationship.

[0014] Optionally, the third fitting unit is further used for: Obtaining grayscale differential values ​​of two adjacent corresponding relationships in the third corresponding relationship one by one; Calculating the first model parameter, the second model parameter and the third model parameter of the power function according to the two adjacent grayscale differential values, until all grayscale differential values ​​in the third corresponding relationship are calculated with other grayscale differential values ​​except themselves, to obtain a target model parameter group; Grouping the target model parameters into a set of parameter sequences; The mean square error of the parameters of each group in the target model parameter group is calculated one by one according to the parameter sequence, and a group of parameters with the smallest mean square error is obtained as the target parameters, and the target parameters are 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*, and B* is the third model parameter of P*; Substituting the target parameter into the power function formula, a third relational expression is obtained; The third relational expression is: .

[0015] Optionally, the third fitting unit is further used for: 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: ; In the above formula, i, j are image data and the corresponding working distances, △Gi and △Gj are the changes in the grayscale mean of the image data when the working distances are i and j respectively based on the reference working distance, Di and Dj are the changes in the reference working distance at working distances i and j, and WD0 is the reference working distance.

[0016] Optionally, the integration unit is mainly used for: By integrating the first relational expression and the second relational expression, the following intermediate relational expression is obtained: ; By integrating the third relational expression and the intermediate relational expression, the following brightness conversion model is obtained: ; Among them, G is the grayscale average value of the current image, k is the calibration parameter of the brightness and average grayscale value of the standard integrating sphere light source, is the correction value of the current exposure time based on the reference exposure time, It is the correction value of the current working distance based on the reference working distance.

[0017] The third aspect of the present application provides a brightness calibration device based on an industrial camera, the device comprising: Processor, memory, input-output unit, and bus; The processor is connected to the memory, the input and output unit, and the bus; The memory stores a program, and the processor calls the program to execute the first aspect and any optional method in the first aspect.

[0018] A fourth aspect of the present application provides a computer-readable storage medium, on which a program is stored. When the program is executed on a computer, the program executes the first aspect and any optional method in the first aspect.

[0019] It can be seen from the above technical solutions that this application has the following advantages: The present application experiments on the correlation of the grayscale values ​​corresponding to the brightness with the three parameters of exposure time, brightness of the integrating sphere light source and exposure time, and shooting distance by controlling variables. Specifically, the benchmark exposure time and benchmark working distance of the industrial camera and the benchmark brightness of the standard integrating sphere light source are determined, and the two benchmark values ​​are set as fixed values ​​respectively, and the other benchmark value changes according to a preset rule within a preset interval, and the image data of the light source is captured according to the changing state, and the relationship between the image grayscale and the brightness of the light source and the relationship between the grayscale and the shooting distance and exposure time are established, and by fitting these relationships, a conversion relationship for converting the grayscale value of the image data into the brightness value of the captured content is formed. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solution in the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0021] Figure 1 This is a schematic flow chart of an embodiment of a brightness calibration method based on an industrial camera in this application; Figure 2a This is a schematic diagram of the first stage flow of another embodiment of the brightness calibration method based on an industrial camera in the present application; Figure 2b This is a schematic diagram of the second stage flow of another embodiment of the brightness calibration method based on an industrial camera in the present application; Figure 3 This is a schematic diagram of the structure of an embodiment of a brightness calibration system based on an industrial camera in this application; Figure 4 This is a schematic diagram of the structure of an embodiment of a brightness calibration device based on an industrial camera in this application; Figure 5 This is the image grayscale-standard brightness fitting curve of the brightness calibration method based on the industrial camera in this application; Figure 6 The present application provides a fitting curve of working distance-average grayscale value based on the brightness calibration method of industrial cameras. DETAILED DESCRIPTION

[0022] It should be noted that the brightness calibration method based on industrial cameras provided in this application can be applied to terminals, systems, and servers. For example, the terminal can be a smart phone or computer, tablet computer, smart TV, smart watch, portable computer terminal, or a fixed terminal such as a desktop computer. For the convenience of explanation, this application uses the terminal as the execution subject for example.

[0023] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0024] See also Figure 1 The present application first provides an embodiment of a brightness calibration method based on an industrial camera, the embodiment comprising: S101, obtaining a reference exposure time, exposure time interval, working distance interval and reference working distance of an industrial camera and a brightness interval and reference brightness of a standard integrating sphere light source; The following parameters mainly affect the analysis process of brightness calibration of the captured content through industrial cameras: exposure time, working distance and brightness of the captured content.

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

[0026] 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. This is to avoid overexposure of the image data captured by the industrial camera by limiting the maximum exposure time.

[0027] The working distance refers to the distance between an industrial camera and the object being photographed. 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 being photographed when the camera is set in the shooting environment.

[0028] The working distance range refers to the range of all working distances that can achieve effective shooting in the brightness calibration process. It includes all possible values ​​from the minimum working distance to the maximum working distance. The image data obtained by moving the industrial camera within the working distance range is analyzed to determine how the relationship between the grayscale value of the image data and the brightness of the photographed object is affected by the distance between the industrial camera and the photographed object.

[0029] The brightness of the standard integrating sphere light source is the brightness of the object being photographed during the brightness calibration process, and the reference brightness is a specific brightness value selected during the calibration, which is generally the initial brightness value of the standard integrating sphere light source in this embodiment.

[0030] The brightness range is the brightness range that the photographed object will produce. During the calibration process, the terminal uses an industrial camera to shoot the brightness of the standard integrating sphere light source. The brightness range is the brightness change range of the standard integrating sphere light source during the brightness calibration process. It is used to simulate the brightness state of the photographed object at different brightness levels to obtain the relationship between different brightness levels and the grayscale of the captured image data.

[0031] S102, splitting the brightness interval according to the first preset density to obtain a brightness collection; The first preset density is the unit brightness change value 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 collection starts to increase from 0nit, and the industrial camera needs to acquire image data every 10nit. At this time, the first preset density is 10nit, until the maximum value of the brightness interval is calculated from 0nit, so that the data contained in the brightness collection is at intervals of 10nit, with a minimum value of 0nit and a maximum value of all brightness parameters of the maximum value of the brightness interval.

[0032] S103, setting an industrial camera according to a reference exposure time and a reference working distance, and using the industrial camera to capture image data corresponding to each brightness state in the brightness collection one by one, to obtain a first image data collection; The brightness of the standard integrating sphere light source is adjusted according to the brightness of the brightness collection and photographed one by one through an industrial camera to obtain a first image data collection. The exposure time and working distance of the image data in the first image data collection are respectively the benchmark exposure time and the benchmark working distance and will not change. When photographing the image data in the first image data collection, the only data that changes is the brightness of the standard integrating sphere light source.

[0033] S104, splitting the exposure time interval according to the second preset density to obtain a collection of exposure times; The terminal obtains parameters similar to step S102 for the exposure time interval through the second preset density. The second preset density is the unit change value for the exposure time. The interval length between two adjacent data times in the exposure time collection is equal to the second preset density. In the exposure time collection, 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.

[0034] S105, setting an industrial camera according to the reference brightness and the reference working distance, and using the industrial camera to capture image data corresponding to each exposure time in the exposure time collection one by one, to obtain a second image data collection; When acquiring the second image data collection, the brightness of the standard integrating sphere light source is the benchmark brightness, and the distance between the industrial camera and the standard integrating sphere light source is the benchmark shooting distance. The only data that changes is the exposure time of the industrial camera. Each image data corresponds to an exposure time value in the exposure time collection, and the image order in the second image data collection is the same as the exposure time order in the exposure time collection, so that the exposure time collection corresponds to the data of the second image data collection one by one.

[0035] S106, splitting the working distance interval according to the third preset density to obtain a working distance collection; Unlike exposure time and brightness data, the working distance has offset values ​​in both positive and negative directions, that is, the benchmark working distance is in the middle position. After determining the benchmark working distance of the industrial camera, the terminal uses the distance from the benchmark working distance to the maximum and minimum values ​​of the working distance interval as the movable distance. 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 working distance collection, where the position difference between two adjacent working distances in the working distance collection is the step length.

[0036] S107, setting an industrial camera according to the reference brightness and exposure time, and using the industrial camera to capture image data corresponding to each working distance in the working distance collection one by one, to obtain a third image data collection; When acquiring the third image data collection, the brightness of the standard integrating sphere light source is the reference brightness, the exposure time of the industrial camera is the reference exposure time, and only the working distance of the industrial camera changes. The data in the third image data collection is collected according to the working distance in the working distance collection, and the image data therein corresponds to the working distance collection one by one and is sorted in the same way. That is, the image data corresponding to the first data in the working distance collection is also the first data in the position of the third data collection.

[0037] Specifically, at the reference working distance WD 0 Within a certain range before and after, assuming that the moving step length of the measurement process is d, the measurement range [WD 0 -Nd, WD 0 +Nd], where N is the third preset density.

[0038] Every time the working distance changes, an industrial camera is used to take a picture of the integrating sphere light source, and then the average grayscale of the rectangular area image is calculated to finally obtain the working distance change data set.

[0039] S108, acquiring first average grayscale values ​​of all image data in the first image data collection one by one, and fitting the first average grayscale values ​​and the brightness of the corresponding standard integrating sphere light source to obtain a first relationship; Because when the image data in the first image data collection are acquired, the only parameter that changes is the brightness of the standard integrating sphere light source, and therefore the reason for the change in the average grayscale 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 grayscale value of the image data and the brightness of the standard integrating sphere light source, the average grayscale value and the brightness are fitted and solved, and the fitting solution methods include but are not limited to: polynomial, exponential, logarithmic, trigonometric function and other methods.

[0040] Specific reference Figure 5 , Figure 5 is the image grayscale-standard brightness fitting curve, which reflects the condition of the reference exposure time t 0 =1ms, reference working distance WD 0 =238mm, aperture F0=1.4, take pictures in a dark room, and get the image grayscale-standard brightness fitting curve. The curve of the relationship between the brightness of the photographed object and the average grayscale value of the photographed object image data is obtained. According to the image, it can be seen that the brightness of the light source and the average grayscale of the image present a basically linear relationship, which can be expressed by the formula y=kx+b.

[0041] In actual situations, when the brightness value is 0, the average gray value is also 0. Therefore, after determining the basic linear relationship formula, the constant term is discarded, and the actual model used for the first relationship is y=kx. After fitting and solving, the result is the first relationship used to express the relationship between brightness and average gray value changes.

[0042] S109, obtaining the second average grayscale value of all image data in the second image data collection one by one, and fitting the second average grayscale value and the corresponding exposure time to obtain a second relationship; Similar to the process of step S108, after determining the average grayscale value of the image data in the second image data collection, the average grayscale value of the image data in the second image data collection and the exposure time are fitted and solved to obtain a result that the relationship between the exposure time and the average grayscale value is a proportional relationship, that is, the current exposure time and the average grayscale value ratio of the corresponding image data are equal. Specifically, when the exposure time is t and the average grayscale value is G, the ratio of the average grayscale value of the i-th image to the exposure time is equal to the ratio of the exposure time to the average grayscale value of the n-th image. That is: G i / t i =G n / t n .

[0043] 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. In order to maintain the consistency of image brightness at different exposure times, it is necessary to compensate for the change in exposure time by adjusting the grayscale value. When the base exposure time is t 0 When G t =G lv* t 0 / t, the actual expression of this formula is, under any exposure time t, the average gray value G t Equal to the reference exposure time t 0 Lower gray value G lv (obtained from step S108) multiplied by t 0 / t.

[0044] S110, obtaining the third average grayscale value of all image data in the third image data collection one by one, and fitting the third average grayscale value and the corresponding working distance to obtain a third relationship; Specific reference Figure 6 , Figure 6 is the fitting curve of working distance-average gray value. The specific conditions are: setting the exposure time t 0 =1ms, aperture F0=1.4, WD 0 =238mm, in WD 0 The fitting curve is obtained when the working distance step length WD=30mm and the curve is centered. 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.

[0045] S111, integrating the first relational expression, the second relational expression and the third relational expression to obtain a brightness conversion model.

[0046] According to step S102, the relationship between the brightness and the average grayscale value of the image represented by the first relationship is determined, and the correction value of the exposure time corresponding to the second relationship on the average grayscale value of the image data and the correction value of the working distance corresponding to the third relationship on the average grayscale value of the image data are integrated to obtain a brightness conversion model.

[0047] By calculating the brightness of the image content through the brightness conversion model, the brightness of the captured content can be calculated through the image data, and the calculation result will be close to the actual brightness of the image content, so that the actual brightness of the image data content can be detected according to the brightness conversion model.

[0048] See also Figure 2a to Figure 2b The present application provides another embodiment of a brightness calibration method based on an industrial camera, which includes: S201, obtaining a reference exposure time, exposure time interval, working distance interval and reference working distance of an industrial camera and a brightness interval and reference brightness of a standard integrating sphere light source; S202, splitting the brightness interval according to the first preset density to obtain a brightness collection; S203, setting an industrial camera according to a reference exposure time and a reference working distance, and using the industrial camera to capture image data corresponding to each brightness state in the brightness collection one by one, to obtain a first image data collection; S204, splitting the exposure time interval according to the second preset density to obtain a collection of exposure times; S205, setting an industrial camera according to the reference brightness and the reference working distance, and using the industrial camera to capture image data corresponding to each exposure time in the exposure time collection one by one, to obtain a second image data collection; S206, splitting the working distance interval according to the third preset density to obtain a working distance collection; S207, setting an industrial camera according to the reference brightness and exposure time, and using the industrial camera to capture image data corresponding to each working distance in the working distance collection one by one, to obtain a third image data collection; Steps S201 to S207 in this embodiment are similar to steps S101 to S107 in the aforementioned embodiment, and will not be described in detail here.

[0049] S208, obtaining a first average grayscale value of all image data in the first image data collection one by one; The average gray value is determined by determining the ROI area, calculating the image gray value of each partition of the ROI area, and then calculating the average value of each block of these ROI areas.

[0050] Specifically, a rectangular area of ​​a certain size range is selected in the image data whose grayscale value needs to be determined. For example, the actual sizes of the image data are height and width respectively, and the terminal calculates the center point coordinates of the image as height / 2, width / 2. Based on the center point coordinates, a ROI area of ​​height*0.3 / 2 and width*0.3 / 2 is selected along the length and width directions as the rectangular area. The average grayscale is obtained by first dividing the ROI area image into blocks and then calculating the average grayscale of the divided image, and finally obtaining the average grayscale data of the rectangular area of ​​the image.

[0051] S209, using the image data in the first image data collection as an index, establishing a first corresponding relationship between the brightness of the standard integrating sphere light source corresponding to the image data and the first average grayscale value; In this embodiment, the terminal needs to obtain the brightness collection of the standard integrating sphere light source corresponding to all images in the first image collection when shooting and the average grayscale value data of the image data itself. It should be noted that the average grayscale value data is the average value of the grayscale value data of each partition after the ROI area corresponding to the image data is segmented. Therefore, the average grayscale value data corresponds to the grayscale value of an image data. When the terminal performs subsequent calculations, it is necessary to obtain the corresponding standard integrating sphere light source brightness and average grayscale value data based on the image data, and determine the relationship between the brightness of the standard integrating sphere light source and the grayscale 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 grayscale value.

[0052] S210, fitting and solving the first corresponding relationship to obtain a first relationship equation for representing the data relationship between the brightness of the standard integrating sphere light source and the first average grayscale value; The first relationship is expressed by the following formula: ; Where Lv is the standard integrating sphere light source brightness corresponding to the first average gray value, G Lv is the first average gray value, and k is the calibration parameter.

[0053] It should be noted that the current brightness Lv and the average gray value G Lv Basically, it is a linear relationship. According to the above description, the model used to calculate the first relationship is y=kx+b after discarding the constant term, that is, y=kx, when y is the current brightness and x is G Lv , the model is converted into the first relation, namely the above formula.

[0054] Among them, k is the calibration parameter, which 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 It 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.

[0055] S211, acquiring a second average grayscale value of all image data in the second image data collection one by one; S212, using the image data in the second image data collection as an index, establishing a second corresponding relationship between the exposure time corresponding to the image data and the second average grayscale value; 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, the only variable generated when acquiring your image data in the second image data is the exposure time.

[0056] The process of obtaining the average grayscale value in steps S211 and S212 is similar to that in steps S208 and S209, and will not be described in detail here.

[0057] S213, fitting and solving the second corresponding relationship to obtain a second relationship 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 expressed by the following formula: ; Among them, Gt0 is the average grayscale value of the image data corresponding to the reference exposure time, Gt is the second average grayscale value, t is the current exposure time, and t0 is the reference exposure time.

[0058] Specifically, when a function image is generated 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, t n is the exposure time.

[0059] Therefore, after determining the relationship between the average gray value and the brightness of the photographed object according to step S210, when the terminal corrects the currently calculated brightness of the photographed object based on the exposure time, the terminal will convert the average gray value G corresponding to the image data into t Relationship with the ratio 0 / t, so that the average gray value Gt is closer to the average gray value G at the reference exposure time. t0 In actual situations, the average gray value G t0 is the image captured under the current light source, the reference exposure time and the reference working distance, so G t0 Equivalent to G Lv Therefore, Lv=kG Lv , which makes Lv=k*G t *t 0 / t.

[0060] S214, obtaining a third average grayscale value of all image data in the third image data collection one by one; S215, using the image data in the third image data collection as an index, establishing a third corresponding relationship between the working distance corresponding to the image data and the third average grayscale value; The process of obtaining the average grayscale value in steps S214 and S215 is similar to that in steps S208 and S209, and will not be described in detail here.

[0061] It should be noted that when acquiring the image data in the third image data collection, the brightness of the standard integrating sphere light source is the benchmark brightness, and the exposure time is the benchmark exposure time. Therefore, the only variable generated when acquiring your image data in the third image data is the working distance.

[0062] S216, calculating a grayscale differential value set of the third corresponding relationship; Specifically, at the working distance WD 0 Within a certain range before and after (assuming that the moving step length of the measurement process is d, and the measurement range is [WD0-Nd, WD0+Nd]), each 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 grayscale of the image data. The final working distance collection is expressed as: D = {-Nd, -(N-1)d, …, 0, …(N1)d, Nd}; the corresponding set of grayscale means {G△WD|△WD∈D}.

[0063] Under this condition, fitting calculation is performed using D = { -Nd, -(N-1)d, … , 0, …(N-1)d, Nd} and {M△WD|△WD∈D} 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 shown in the subsequent steps.

[0064] S217, obtaining grayscale differential values ​​of two adjacent corresponding relationships in the third corresponding relationship one by one; Take the sequence {△G i | i=1,2,3,…,2N}, and estimate the corresponding parameters A and B, where △Gi is the grayscale differential value of the corresponding image data of two adjacent corresponding relationships, respectively expressed as G i and G j , where i and j are the image data corresponding to two adjacent corresponding relationships, that is, j=i+1 or j=i-1, and then we get , where D is the set of working distances.

[0065] S218, calculating the first model parameter, the second model parameter and the third model parameter of the power function according to two adjacent grayscale differential values, until all grayscale differential values ​​in the third corresponding relationship are calculated with other grayscale differential values ​​except themselves, to obtain a target model parameter group; 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 by: The first model parameter a is calculated by the following formula: ; Specifically, in G=A*(WD) a +B is the base model, a is a ij , A is A ij , B is B ij In this case, a is an exponential, so to calculate the exponent, you need to convert the exponent into a logarithm, that is, logG = logA + alogWD + logB. Assuming that B is relative to A*(WD) a When it is very small, B can be ignored, so the equation is simplified to logG≈alogWD+logA.

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

[0067] In this embodiment, the calculation is performed through two adjacent grayscale differential values, that is, there are corresponding working distances D i and D j The change of the two grayscale values ​​based on the reference value △G i and △G j , so that logG=alogWD+C is transformed into: ; 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 the data of two adjacent images. After determining the exponent a, A describes the 0 Below, the rate at which the average gray value changes with working distance, while B describes the gray baseline when the working distance is 0.

[0068] The second model parameter A is calculated by the following formula: ; Among them, A is calculated by dividing the difference in grayscale values ​​at two different working distances by the power difference of the corresponding working distances. ij Indicates the reference working distance WD 0 The effect of each unit change in working distance WD on the grayscale mean.

[0069] The third model parameter B is calculated by the following formula: ; Wherein, 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.

[0070] In the above formula, i, j are image data and the corresponding working distances, △Gi and △Gj are the changes in the grayscale mean of the image data when the working distances are i and j respectively based on the reference working distance, Di and Dj are the changes in the reference working distance at working distances i and j, and WD0 is the reference working distance.

[0071] S219, grouping the target model parameters into a set of parameter sequences; According to the above steps, a set of target model parameter groups will be generated between two adjacent image data. The model parameter group is represented by P. Each target model parameter group includes a first model parameter a, a second model parameter A and a third model parameter B. The target model parameter group is represented by P = (a ij ,A ij ,B ij ).

[0072] The model parameters P corresponding to all combinations obtained by calculation in step S218 are ij , A ij , B ij}, a total of N(2N-1) types are formed into a set of parameter sequences, where N is the maximum number of step lengths d in the working distance interval.

[0073] S220, calculating the mean square error of the parameters of each group in the target model parameter group one by one according to the parameter sequence, and obtaining a group of parameters with the smallest mean square error as the target parameters, and the target parameters are 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*, and B* is the third model parameter of P*; Calculate the model parameters { a ij , A ij , B ij}, a set of parameter values ​​that minimizes the mean square error is used as the final calibration working distance model parameters .

[0074] The minimum mean square error is calculated as follows:

[0075] It should be noted that the mean square error is a common indicator for measuring the difference between the model prediction value and the actual observation value. The mean square error formula is: ,in is the actual observed value, is the model prediction value, n is the number of data points, so the above formula represents the average of the sum of squared prediction errors of all data points in the parameter sequence. The goal is to minimize this average error, that is, to find the target model parameter group that minimizes the sum of squared errors.

[0076] Specifically, is the model working distance The prediction of the grayscale mean is essentially calculated by traversing all possible j values ​​from 1 to N(2N−1) to obtain the parameter combination with the minimum mean square error.

[0077] S221, substituting the target parameter into the power function formula to obtain a third relational expression; The third relation is: .

[0078] Similar to the second relation, the third relation is the grayscale mean G at any working distance WD WD is the reference working distance WD 0 The gray mean G under WD0 Multiply by ratio . And G WD In actual image acquisition, the exposure time is the reference exposure time, so G WD Can be regarded as G t .

[0079] S222. Integrate the first relational expression and the second relational expression to obtain the following intermediate relational expression: ; In actual situations, the average gray value G t0 is the image captured under the current light source, the reference exposure time and the reference working distance, so G t0 Equivalent to G Lv Therefore, Lv=kG Lv , which makes Lv=k*G t *t 0 / t.

[0080] S223, integrating the third relational expression and the intermediate relational expression, and obtaining the following brightness conversion model: ; Similar to step S222, combined with the description in step S221, it can be seen that G WD Can be regarded as G t .

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

[0082] Through the method provided in this embodiment, after obtaining the average grayscale value of the image data, the average grayscale value can be input into a brightness conversion model and the average grayscale value can be calculated through the brightness conversion model to obtain the brightness of the actual captured content in the image data.

[0083] The brightness calibration method based on an industrial camera in the embodiment of the present application is described in detail above. The brightness calibration system and device based on an industrial camera will be described in detail below.

[0084] See also Figure 3 The present application provides an embodiment of a brightness calibration system based on an industrial camera, which includes: An acquisition unit 301 is used to acquire a reference exposure time, an exposure time interval, a working distance interval and a reference working distance of an industrial camera and a brightness interval and a reference brightness of a standard integrating sphere light source; A first splitting unit 302 is used to split the brightness interval according to a first preset density to obtain a brightness set; The first shooting unit 303 is used to set the industrial camera according to the reference exposure time and the reference working distance, and to shoot the image data corresponding to each brightness state in the brightness collection one by one through the industrial camera to obtain the first image data collection; A second splitting unit 304 is used to split the exposure time interval according to a second preset density to obtain an exposure time collection; The second shooting unit 305 is used to set the industrial camera according to the reference brightness and the reference working distance, and to shoot the image data corresponding to each exposure time in the exposure time collection one by one through the industrial camera to obtain a second image data collection; A third splitting unit 306 is used to split the working distance interval according to a third preset density to obtain a working distance collection; The third shooting unit 307 is used to set the industrial camera according to the reference brightness and exposure time, and to shoot the image data corresponding to each working distance in the working distance collection one by one through the industrial camera to obtain a third image data collection; A first fitting unit 308 is used to obtain the first average gray value of all image data in the first image data set one by one, and fit the first average gray value and the brightness of the corresponding standard integrating sphere light source to obtain a first relationship; A second fitting unit 309 is used to obtain the second average grayscale value of all image data in the second image data set one by one, and fit the second average grayscale value and the corresponding exposure time to obtain a second relationship; A third fitting unit 310 is used to 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; The integration unit 311 is used to integrate the first relational expression, the second relational expression and the third relational expression to obtain a brightness conversion model.

[0085] Optionally, the first fitting unit 308 is mainly used for: Obtaining first average grayscale values ​​of all image data in the first image data collection one by one; Using the image data in the first image data collection as an index, establishing a first corresponding relationship between the brightness of a standard integrating sphere light source corresponding to the image data and a first average grayscale value; Fitting and solving the first corresponding relationship to obtain a first relationship equation for representing the data relationship between the brightness of the standard integrating sphere light source and the first average grayscale value; The first relationship is expressed by the following formula: ; Among them, Lv is the standard integrating sphere light source brightness corresponding to the first average gray value, GLv is the first average gray value, and k is a calibration parameter.

[0086] Optionally, the second fitting unit 309 is mainly used for: Obtaining a second average grayscale value of all image data in the second image data collection one by one; Using the image data in the second image data collection as an index, establishing a second corresponding relationship between the exposure time corresponding to the image data and the second average grayscale value; Fitting and solving the second corresponding relationship to obtain a second relationship expression for representing the exposure time and the second average grayscale value; When the exposure time is not equal to the reference exposure time, the second relational expression is expressed by the following formula: ; Among them, G t0 is the average grayscale value of the image data corresponding to the reference exposure time, Gt is the second average grayscale value, t is the current exposure time, t 0 is the base exposure time.

[0087] Optionally, the third fitting unit 310 is mainly used for: Obtaining a third average grayscale value of all image data in the third image data collection one by one; Using the image data in the third image data collection as an index, establishing a third corresponding relationship between the working distance corresponding to the image data and the third average grayscale value; Calculate the grayscale differential value set of the third corresponding relationship; Two unequal grayscale differential values ​​are obtained from the grayscale differential value collection according to the sequence of the working distance collection, and the two unequal grayscale differential values ​​are fitted by a power function to obtain a third corresponding relationship.

[0088] Optionally, the third fitting unit 310 is further configured to: Obtaining grayscale differential values ​​of two adjacent corresponding relationships in the third corresponding relationship one by one; Calculating the first model parameter, the second model parameter and the third model parameter of the power function according to two adjacent grayscale differential values, until all grayscale differential values ​​in the third corresponding relationship are calculated with other grayscale differential values ​​except themselves, to obtain a target model parameter group; Grouping the target model parameters into a set of parameter sequences; According to the parameter sequence, the mean square error of each parameter group in the target model parameter group is calculated one by one, and the group of parameters with the smallest mean square error is obtained as the target parameter. The target parameter 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*, and B* is the third model parameter of P*; Substituting the target parameter into the power function formula, we get the third relation; The third relation is: .

[0089] Optionally, the third fitting unit 310 is further configured to: 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: ; In the above formula, i, j are image data and the corresponding working distances, △Gi and △Gj are the changes in the grayscale mean of the image data when the working distances are i and j respectively based on the reference working distance, Di and Dj are the changes in the reference working distance at working distances i and j, and WD0 is the reference working distance.

[0090] Optionally, the integration unit 311 is mainly used for: Integrating the first and second relations, we get the following intermediate relation: ; Integrating the third relation and the intermediate relation, we get the following brightness conversion model: ; Among them, G is the grayscale average value of the current image, k is the calibration parameter of the brightness and average grayscale value of the standard integrating sphere light source, is the correction value of the current exposure time based on the reference exposure time, It is the correction value of the current working distance based on the reference working distance.

[0091] In this embodiment, the functions of each unit are the same as those described above. Figure 1 , Figure 2a , Figure 2b The steps in the illustrated embodiments correspond to each other and will not be described again here.

[0092] See also Figure 4 The present application provides another embodiment of a brightness calibration device based on an industrial camera, including: Processor 401, memory 402, input and output unit 403, bus 404; The processor 401 is connected to the memory 402, the input and output unit 403 and the bus 404; Processor 401 specifically performs Figure 1 , Figure 2a , Figure 2b The operations corresponding to the steps in the method are not described in detail here.

[0093] The present application also relates to a computer-readable storage medium on which a program is stored, wherein when the program is run on a computer, the computer is caused to execute any of the above methods.

[0094] 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 aforementioned method embodiments and will not be repeated here.

[0095] In the 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 only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. 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 mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0096] 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 may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

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

[0098] 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 this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk, etc. Various media that can store program codes.

Claims

1. A brightness calibration method based on an industrial camera, characterized in that: The method comprises: 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; Splitting the brightness interval according to a first preset density to obtain a brightness collection; 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; Splitting the exposure time interval according to a second preset density to obtain a collection of exposure times; 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; Splitting the working distance interval according to a third preset density to obtain a working distance collection; The industrial camera is set according to the reference brightness and the exposure time, and the industrial camera is used to capture image data corresponding to each working distance in the working distance collection one by one to obtain a third image data collection; Acquire the first average grayscale value of all image data in the first image data collection one by one, and fit the first average grayscale value and the brightness of the corresponding standard integrating sphere light source to obtain a first relationship; Acquire the second average grayscale value of all image data in the second image data set one by one, and fit the second average grayscale value and the corresponding exposure time to obtain a second relationship; Acquire the third average grayscale value of all image data in the third image data collection one by one, and fit the third average grayscale value and the corresponding working distance to obtain a third relationship; The first relational expression, the second relational expression and the third relational expression are integrated to obtain a brightness conversion model.

2. The method according to claim 1, characterized in that The first average grayscale value of all image data in the first image data collection is obtained one by one, and the first average grayscale value and the brightness of the corresponding standard integrating sphere light source are fitted to obtain a first relationship, including: Acquire a first average grayscale value of all image data in the first image data collection one by one; Using the image data in the first image data collection as an index, establishing a first corresponding relationship between the brightness of a standard integrating sphere light source corresponding to the image data and the first average grayscale value; Fitting and solving the first corresponding relationship to obtain a first relationship equation for representing the data relationship between the brightness of the standard integrating sphere light source and the first average grayscale value; The first relationship is expressed by the following formula: ; Wherein, Lv is the standard integrating sphere light source brightness corresponding to the first average gray value, G Lv is the first average gray value, and k is a calibration parameter.

3. The method according to claim 2, characterized in that The step of acquiring the second average grayscale value of all image data in the second image data collection one by one, and fitting the second average grayscale value and the corresponding exposure time to obtain a second relationship includes: acquiring the second average grayscale value of all the image data in the second image data collection one by one; Using the image data in the second image data collection as an index, establishing a second corresponding relationship between the exposure time corresponding to the image data and the second average grayscale value; Fitting and solving the second corresponding relationship to obtain a second relationship 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 expressed by the following formula: ; Among them, G t0 is the average grayscale value of the image data corresponding to the reference exposure time, G t is the second average grayscale value, t is the current exposure time, and t0 is the reference exposure time.

4. The method according to claim 3, characterized in that The step of acquiring the third average grayscale value of all the image data in the third image data collection one by one, and fitting the third average grayscale value and the corresponding working distance to obtain a third relationship includes: Acquire a third average grayscale value of all image data in the third image data collection one by one; Using the image data in the third image data collection as an index, establishing a third corresponding relationship between the working distance corresponding to the image data and the third average grayscale value; Calculating a grayscale differential value collection of the third corresponding relationship; Two unequal grayscale differential values ​​are obtained from the grayscale differential value collection according to the sequence of the working distance collection, and the two unequal grayscale differential values ​​are fitted by a power function to obtain a third corresponding relationship.

5. The method according to claim 4, characterized in that The step of obtaining two unequal grayscale differential values ​​from the grayscale differential value collection according to the sequence of the working distance collection, and fitting the two unequal grayscale differential values ​​by a power function to obtain a third corresponding relationship includes: Obtaining grayscale differential values ​​of two adjacent corresponding relationships in the third corresponding relationship one by one; Calculating the first model parameter, the second model parameter and the third model parameter of the power function according to the two adjacent grayscale differential values, until all grayscale differential values ​​in the third corresponding relationship are calculated with other grayscale differential values ​​except themselves, to obtain a target model parameter group; Grouping the target model parameters into a set of parameter sequences; The mean square error of the parameters of each group in the target model parameter group is calculated one by one according to the parameter sequence, and a group of parameters with the smallest mean square error is obtained as the target parameters, and the target parameters are expressed as: ; Where P * is the target parameter group, a * P * The first model parameter, A * P * The second model parameter, B * P * The third model parameter of Substituting the target parameter into the power function formula, a third relational expression is obtained; The third relational expression is: 。 6. The method according to claim 5, characterized in that The calculation method of the first model parameter, the second model parameter and the third model parameter includes: 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: ; In the above formula, i, j are image data and corresponding working distance, △G i , △G j are the changes in the grayscale mean of the image data when the working distance is i and j based on the reference working distance, D i , D j is the change value of the reference working distance when the working distance is i and the working distance is j, and WD0 is the reference working distance.

7. The method according to claim 5, characterized in that The step of integrating the first relational expression, the second relational expression and the third relational expression to obtain a brightness conversion model includes: By integrating the first relational expression and the second relational expression, the following intermediate relational expression is obtained: ; By integrating the third relational expression and the intermediate relational expression, the following brightness conversion model is obtained: ; Among them, G is the grayscale average value of the current image, k is the calibration parameter of the brightness and average grayscale value of the standard integrating sphere light source, is the correction value of the current exposure time based on the reference exposure time, It is the correction value of the current working distance based on the reference working distance.

8. A brightness calibration system based on an industrial camera, characterized in that: The system comprises: An acquisition unit, used to acquire a reference exposure time, an exposure time interval, a working distance interval and a reference working distance of an industrial camera and a brightness interval and a reference brightness of a standard integrating sphere light source; A first splitting unit, configured to split the brightness interval according to a first preset density to obtain a brightness set; A first shooting unit is used to set the industrial camera according to the reference exposure time and the reference working distance, and to shoot the image data corresponding to each brightness state in the brightness collection one by one by the industrial camera to obtain a first image data collection; A second splitting unit, configured to split the exposure time interval according to a second preset density to obtain a set of exposure times; A second shooting unit is used to set the industrial camera according to the reference brightness and the reference working distance, and to shoot the image data corresponding to each exposure time in the exposure time collection one by one by the industrial camera to obtain a second image data collection; A third splitting unit, configured to split the working distance interval according to a third preset density to obtain a working distance collection; A third shooting unit is used to set the industrial camera according to the reference brightness and the exposure time, and to shoot the image data corresponding to each working distance in the working distance collection one by one by the industrial camera to obtain a third image data collection; A first fitting unit, used for acquiring first average grayscale values ​​of all image data in the first image data set one by one, and fitting the first average grayscale value and the brightness of the corresponding standard integrating sphere light source to obtain a first relationship; A second fitting unit is used to 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 relationship; A third fitting unit is used to 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; An integration unit is used to integrate the first relational expression, the second relational expression and the third relational expression to obtain a brightness conversion model.

9. A brightness calibration device based on an industrial camera, characterized in that: The device comprises: Processor, memory, input-output unit, and bus; The processor is connected to the memory, the input and 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 7.

10. A computer-readable storage medium having a program stored thereon, wherein the program, when executed on a computer, performs the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Calibration method and system for inner and outer brightness meter of tunnel hole based on deep learning

    CN109357754A

  • Display screen brightness measurement model generation method and related device

    CN113936580A

  • Method and device for jointly correcting visual angle of display screen and vignetting of camera

    CN114745538A

  • Mitigating Display Interference With Captured Image By Controlling Display Brightness

    US20220208142A1

Cited By

  • Blood bag blood grade classification method based on permeability attribute and impurity attribute

    CN121392413A

  • Blood bag blood grade classification method based on transparency attribute and impurity attribute

    CN121392413B