Camera linearity correction method and device
By determining and fitting the RGB channel measurement values under exposure time in industrial cameras and dynamically selecting the correction coefficients, the problem of inconsistent grayscale responses under different exposure conditions is solved, and the accuracy and adaptability of image analysis are improved.
Patent Information
- Application Number
- CN202411152267.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-08-21
AI Technical Summary
The grayscale response characteristics of industrial cameras inconsistent image under different exposure conditions, resulting in low or oversaturation of the signal, affecting the accuracy of image analysis and quantization measurement.
By determining the RGB channel measurement value at each exposure time, fitting to obtain the fitting function, calculate the correction coefficient, and dynamically select the correction coefficient based on the average grayscale value of the target image, and a correction coefficient matrix is generated to adapt to different exposure conditions.
The image grayscale change trend under different exposure conditions is accurately described, the actual correction coefficient is calculated, the flexibility and adaptability of the correction process are improved, and the image brightness and contrast changes are adapted.
Smart Images

Figure CN119071473A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of industrial camera calibration, and in particular to a camera linearity calibration method and device. Background Art
[0002] Industrial cameras are high-performance image acquisition devices mainly used in industrial applications. They convert light signals into digital images through imaging sensors and analyze and process them through image processing algorithms. Industrial cameras have high resolution, high sensitivity and powerful image processing capabilities, and are widely used in machine vision, non-destructive testing, automated production and other fields.
[0003] Industrial cameras will show different grayscale response characteristics under different exposure conditions. For example, the signal may be too low or the noise may be too high under low exposure, while the signal may be oversaturated under high exposure. How to ensure that the images acquired in different scenes are consistent in grayscale and color accuracy is very important for applications that require image analysis, pattern recognition, or image-based quantitative measurement. Summary of the invention
[0004] The present application provides a camera linearity correction method and device, which can dynamically determine the correction coefficient according to the characteristics of the actual image and has strong adaptability to different exposure conditions and image characteristics.
[0005] In a first aspect, an embodiment of the present application provides a camera linearity correction method, the camera linearity correction method comprising the following steps:
[0006] Determine the measurement values of the RGB channels of the image collected at each exposure time, wherein the grayscale values corresponding to different exposure times are located at different brightness positions of the full grayscale;
[0007] Fit the measured value of each channel and the corresponding exposure time to obtain the fitting function of each channel;
[0008] Calculate the actual value of each channel according to the fitting function of each channel, and determine the correction coefficient of each channel at different exposure times according to the measured value and the actual value;
[0009] The average grayscale value of all foreground pixels of the target image is obtained, and according to the range of the average grayscale value, a dynamic selection is made among the correction coefficients at different exposure times of each channel to determine the correction coefficients of all channels.
[0010] In combination with the first aspect, in one implementation, dynamically selecting the correction coefficients at different exposure times of each channel according to the range of the average gray value to determine the correction coefficients of all channels includes:
[0011] Generate a correction coefficient matrix according to the correction coefficients of each channel at different exposure times, where the number of rows of the matrix is the number of channels, and the number of columns of the matrix is the number of exposure times;
[0012] According to the relationship between the average grayscale value and the grayscale values corresponding to the different exposure times, the correction coefficient of the channel is determined based on the data in the corresponding column number of the matrix.
[0013] In combination with the first aspect, in one implementation, determining the correction coefficient of the channel based on the data in the number of columns corresponding to K according to the relationship between the average gray value and the gray values corresponding to the different exposure times includes:
[0014] The grayscale values corresponding to different exposure times are 5%, 20%, 40%, 60% and 80% of the full grayscale;
[0015] If the average gray value is ≤0.05, linearityK(:,1) is used as the correction coefficient of the channel, where linearityK(:,1) represents the data in the first column of the matrix linearityK;
[0016] If 0.8<average gray value≤1, linearityK(:,5) is used as the correction coefficient of the channel, where linearityK(:,5) represents the data in the 5th column of the matrix linearityK;
[0017] If the average gray value is between any two adjacent values of 0.05, 0.2, 0.4, 0.6 and 0.8, the linear interpolation coefficient is obtained by linear interpolation calculation, and then the corresponding two columns of data in linearityK are weighted averaged as the correction coefficient of the channel.
[0018] In combination with the first aspect, in one implementation, obtaining the average grayscale value of all foreground pixels of the target image includes:
[0019] Take a target image and perform region extraction, and convert the extracted region into a grayscale image;
[0020] Binarize the grayscale image to obtain a binary version of the grayscale image to determine the optimal threshold;
[0021] Calculate the average gray value of all foreground pixels in the binarized image.
[0022] In combination with the first aspect, in one implementation, determining the measurement values of the RGB channels of the image collected at each exposure time includes:
[0023] Acquire multiple images for linearity correction at each exposure time;
[0024] Calculate the average value of the RGB channels of multiple images at each exposure time as the measurement value of the RGB channels.
[0025] In combination with the first aspect, in one implementation, fitting the measured value of each channel and the corresponding exposure time to obtain a fitting function of each channel includes:
[0026] With the exposure time as the independent variable and the measured value of the channel as the dependent variable, a polynomial linear fit is performed, and the slope and intercept are determined to obtain the fitting function of each channel.
[0027] In combination with the first aspect, in one implementation, determining the correction coefficient of each channel at different exposure times according to the measured value and the actual value includes:
[0028] The correction coefficient of each channel at different exposure times is determined based on the ratio of the actual value to the measured value.
[0029] In a second aspect, an embodiment of the present application provides a camera linearity correction device, the camera linearity correction device comprising:
[0030] An acquisition module, which is used to determine the measurement values of the RGB channels of the image acquired at each exposure time, wherein the grayscale values corresponding to different exposure times are located at different brightness positions of the full grayscale;
[0031] A fitting module, which is used to fit the measured value of each channel and the corresponding exposure time to obtain a fitting function of each channel;
[0032] A calculation module, which is used to calculate the actual value of each channel according to the fitting function of each channel, and determine the correction coefficient of each channel at different exposure times according to the measured value and the actual value;
[0033] The selection module is used to obtain the average grayscale value of all foreground pixels of the target image, and dynamically select the correction coefficients of each channel at different exposure times according to the range of the average grayscale value to determine the correction coefficients of all channels.
[0034] In combination with the second aspect, in one implementation, the selection module dynamically selects among the correction coefficients at different exposure times of each channel according to the range of the average gray value to determine the correction coefficients of all channels, including:
[0035] Generate a correction coefficient matrix according to the correction coefficients of each channel at different exposure times, where the number of rows of the matrix is the number of channels, and the number of columns of the matrix is the number of exposure times;
[0036] According to the relationship between the average grayscale value and the grayscale values corresponding to the different exposure times, the correction coefficient of the channel is determined based on the data in the corresponding column number of the matrix.
[0037] In combination with the second aspect, in one implementation, the selection module determines the correction coefficient of the channel based on the data in the number of columns corresponding to K according to the relationship between the average gray value and the gray values corresponding to the different exposure times, including:
[0038] The grayscale values corresponding to different exposure times are 5%, 20%, 40%, 60% and 80% of the full grayscale;
[0039] If the average gray value is ≤0.05, linearityK(:,1) is used as the correction coefficient of the channel, where linearityK(:,1) represents the data in the first column of the matrix linearityK;
[0040] If 0.8<average gray value≤1, linearityK(:,5) is used as the correction coefficient of the channel, where linearityK(:,5) represents the data in the 5th column of the matrix linearityK;
[0041] If the average gray value is between any two adjacent values of 0.05, 0.2, 0.4, 0.6 and 0.8, the linear interpolation coefficient is obtained by linear interpolation calculation, and then the corresponding two columns of data in linearityK are weighted averaged as the correction coefficient of the channel.
[0042] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0043] The camera linearity correction method in the present application determines the measured values of the RGB channels of the image collected at each exposure time, wherein the grayscale values corresponding to different exposure times are located at different brightness positions of the full grayscale; fits the measured value of each channel and the corresponding exposure time to obtain a fitting function for each channel; calculates the actual value of the channel according to the fitting function of each channel, and determines the correction coefficient of each channel at different exposure times according to the measured value and the actual value; obtains the average grayscale value of all foreground pixels of the target image, and dynamically selects among the correction coefficients of each channel at different exposure times according to the range of the average grayscale value to determine the correction coefficients of all channels.
[0044] That is, by performing linear fitting, the present application can more accurately describe the changing trend of the channel grayscale under different exposure times, thereby effectively calculating the actual correction coefficient, and then dynamically selecting the appropriate correction coefficient according to the range of the average grayscale value, so that the correction process has a certain degree of flexibility and adjustability, and can better adapt to different image brightness and contrast changes. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1This is a flow chart of an embodiment of a camera linearity correction method of the present application;
[0046] Figure 2 This is a structural block diagram of an embodiment of a camera linearity correction device of the present application. DETAILED DESCRIPTION
[0047] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of 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.
[0048] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.
[0049] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.
[0050] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.
[0051] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.
[0052] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0053] In a first aspect, an embodiment of the present application provides a camera linearity correction method.
[0054] In one embodiment, referring to Figure 1 , Figure 1 This is a flow chart of an embodiment of the camera linearity correction method of the present application. Figure 1 As shown, the camera linearity correction method includes:
[0055] S1. Determine the measurement values of the RGB channels of the image collected at each exposure time, wherein the grayscale values corresponding to different exposure times are located at different brightness positions of the full grayscale;
[0056] RGB channel values refer to the values of the three color channels of red (Red), green (Green) and blue (Blue), which are used to represent colors in digital images.
[0057] In this embodiment, an industrial camera is used to capture images, and a 200×200 area in the center is selected. At different exposure times, multiple images (for example, three images) for linearity correction are continuously captured, and for each image at each exposure time, the average value of its grayscale or RGB channel is calculated as the measurement value imgETMeanValue of the RGB channel.
[0058] In this embodiment, five exposure times are set, and the grayscale values corresponding to different exposure times are 5%, 20%, 40%, 60% and 80% of the full grayscale respectively.
[0059] It is understandable that the number of types of exposure times and the number of images collected at each exposure time can be reasonably set as needed, and this embodiment does not limit this.
[0060] S2, fitting the measured value of each channel and the corresponding exposure time to obtain a fitting function of each channel;
[0061] It can be understood that the values and corresponding exposure times are fitted for the three channels, and then three fitting functions are obtained.
[0062] Specifically, in this embodiment, the exposure time is used as the independent variable, the measured value of the channel is used as the dependent variable, a linear polynomial fitting is performed, and the slope and intercept are determined to obtain the fitting function of each channel.
[0063] It is worth noting that, since the correction coefficient is dynamically determined according to the characteristics of the actual image by using the curve fitting method, it has strong adaptability to different exposure conditions and image features. Through the linear fitting of a first-order polynomial, the slope and intercept obtained can more accurately describe the change trend of the channel grayscale under different exposure times, thereby effectively calculating the actual correction coefficient.
[0064] S3, calculating the actual value of each channel according to the fitting function of each channel, and determining the correction coefficient of each channel at different exposure times according to the measured value and the actual value;
[0065] After obtaining the fitting function, the actual value actualValue can be calculated according to the fitting parameters, and then the correction coefficient of each channel at different exposure times can be determined according to the ratio of the actual value to the measured value.
[0066] S4. Obtain the average grayscale value of all foreground pixels of the target image, and dynamically select among the correction coefficients of each channel at different exposure times according to the range of the average grayscale value to determine the correction coefficients of all channels.
[0067] In a specific implementation, a correction coefficient matrix is generated according to the correction coefficients of each channel under different exposure times, wherein the number of rows of the matrix is the number of channels, and the number of columns of the matrix is the number of exposure times; according to the relationship between the average grayscale value and the grayscale values corresponding to the different exposure times, the correction coefficient of the channel is determined based on the data in the corresponding columns of the matrix.
[0068] To obtain the average grayscale value of all foreground pixels of the target image, in this embodiment:
[0069] First, take a picture and extract its central 200×200 area, and convert the extracted area into a grayscale image.
[0070] Then, the grayscale image is binarized using the Otsu method to obtain a binarized version of the image to determine the optimal threshold.
[0071] The Otsu method is an automatic threshold selection technique for image segmentation. It is a threshold determination method based on maximizing inter-class variance and is widely used in the field of image processing, especially in binary image processing. The optimal binarization threshold is determined according to the Otsu method, so that the correction process is automated while ensuring image quality, reducing the need for manual intervention and improving processing efficiency.
[0072] Next, the mean gray value meanGrayValue of all foreground pixels (white parts) is calculated in the binarized image;
[0073] Finally, meanGrayValue is standardized to a value in the range of 0 to 1, and the value of the final channel correction coefficient dstlinearityK is determined according to the value range of meanGrayValue (saturation 5% / 20% / 40% / 60% / 80% corresponds to (0.05 / 0.2 / 0.4 / 0.6 / 0.8), which can also be modified to other values, covering saturation from low to high).
[0074] Therefore, in this embodiment, a suitable correction coefficient is dynamically selected according to the range of meanGrayValue, so that the correction process has certain flexibility and adjustability, and can better adapt to different changes in image brightness and contrast.
[0075] Let's take a specific example to illustrate:
[0076] The grayscale values corresponding to different exposure times are 5%, 20%, 40%, 60% and 80% of the full grayscale;
[0077] If the average gray value is ≤0.05, linearityK(:,1) is used as the correction coefficient of the channel, where linearityK(:,1) represents the data in the first column of the matrix linearityK;
[0078] If 0.8<average gray value≤1, linearityK(:,5) is used as the correction coefficient of the channel, where linearityK(:,5) represents the data in the 5th column of the matrix linearityK;
[0079] If the average gray value is between any two adjacent values of 0.05, 0.2, 0.4, 0.6 and 0.8, the linear interpolation coefficient is obtained by linear interpolation calculation, and then the corresponding two columns of data in linearityK are weighted averaged as the correction coefficient of the channel.
[0080] For example, if 0.05 < average gray value ≤ 0.2, lCoeff is calculated by linear interpolation, and then linearityK(:, 1) and linearityK(:, 2) are weighted averaged. The other intervals are processed similarly: 0.2 to 0.4, 0.4 to 0.6, and 0.6 to 0.8.
[0081] Finally, traverse each channel of the image and multiply the pixel value of the original image by the corresponding dstlinearityK coefficient to adjust the pixel value.
[0082] In summary, the camera linearity correction method in the present application determines the measured values of the RGB channels of the image captured at each exposure time, wherein the grayscale values corresponding to different exposure times are located at different brightness positions of the full grayscale; fits the measured values of each channel and the corresponding exposure time to obtain a fitting function for each channel; calculates the actual value of the channel according to the fitting function of each channel, and determines the correction coefficient of each channel at different exposure times according to the measured value and the actual value; obtains the average grayscale value of all foreground pixels of the target image, and dynamically selects among the correction coefficients of each channel at different exposure times according to the range of the average grayscale value to determine the correction coefficients of all channels.
[0083] That is, by performing linear fitting, the present application can more accurately describe the changing trend of the channel grayscale under different exposure times, thereby effectively calculating the actual correction coefficient, and then dynamically selecting the appropriate correction coefficient according to the range of the average grayscale value, so that the correction process has a certain degree of flexibility and adjustability, and can better adapt to different image brightness and contrast changes.
[0084] In a second aspect, an embodiment of the present application also provides a camera linearity correction device.
[0085] In one embodiment, referring to Figure 2 , Figure 2 This is a functional module diagram of an embodiment of the camera linearity correction device of the present application. Figure 2 As shown, the camera linearity correction device includes an acquisition module, a fitting module, a calculation module and a selection module.
[0086] Among them, the acquisition module is used to determine the measurement values of the RGB channels of the image acquired at each exposure time, wherein the grayscale values corresponding to different exposure times are located at different brightness positions of the full grayscale;
[0087] A fitting module, which is used to fit the measured value of each channel and the corresponding exposure time to obtain a fitting function of each channel;
[0088] A calculation module, which is used to calculate the actual value of each channel according to the fitting function of each channel, and determine the correction coefficient of each channel at different exposure times according to the measured value and the actual value;
[0089] The selection module is used to obtain the average grayscale value of all foreground pixels of the target image, and dynamically select the correction coefficients of each channel at different exposure times according to the range of the average grayscale value to determine the correction coefficients of all channels.
[0090] Furthermore, in one embodiment, the selection module dynamically selects among the correction coefficients of each channel at different exposure times according to the range of the average gray value to determine the correction coefficients of all channels, including:
[0091] Generate a correction coefficient matrix K according to the correction coefficients of each channel at different exposure times, where the number of rows of K is the number of channels and the number of columns of K is the number of exposure times;
[0092] According to the relationship between the average grayscale value and the grayscale values corresponding to the different exposure times, the correction coefficient of the channel is determined based on the data in the column number corresponding to K.
[0093] Furthermore, in one embodiment, the selection module determines the correction coefficient of the channel based on the data in the number of columns corresponding to K according to the relationship between the average gray value and the gray values corresponding to the different exposure times, including:
[0094] The grayscale values corresponding to different exposure times are 5%, 20%, 40%, 60% and 80% of the full grayscale;
[0095] If the average gray value is ≤0.05, linearityK(:,1) is used as the correction coefficient of the channel, where linearityK(:,1) represents the first column data of K;
[0096] If 0.8<average gray value≤1, linearityK(:,5) is used as the correction coefficient of the channel, where linearityK(:,5) represents the 5th column data of K;
[0097] If the average gray value is between any two adjacent values of 0.05, 0.2, 0.4, 0.6 and 0.8, the linear interpolation coefficient is obtained by linear interpolation calculation, and then the corresponding two columns of data in K are weighted averaged as the correction coefficient of the channel.
[0098] The step of obtaining the average grayscale value of all foreground pixels of the target image includes:
[0099] Take a target image and perform region extraction, and convert the extracted region into a grayscale image;
[0100] Binarize the grayscale image to obtain a binary version of the grayscale image to determine the optimal threshold;
[0101] Calculate the average gray value of all foreground pixels in the binarized image.
[0102] Furthermore, in one embodiment, the acquisition module determines the measurement values of the RGB channels of the image acquired at each exposure time, including:
[0103] Acquire multiple images for linearity correction at each exposure time;
[0104] Calculate the average value of the RGB channels of multiple images at each exposure time as the measurement value of the RGB channels.
[0105] Furthermore, in one embodiment, the fitting module fits the measured value of each channel and the corresponding exposure time to obtain a fitting function of each channel, including:
[0106] With the exposure time as the independent variable and the measured value of the channel as the dependent variable, a polynomial linear fit is performed, and the slope and intercept are determined to obtain the fitting function of each channel.
[0107] Furthermore, in one embodiment, the calculation module determines the correction coefficient of each channel at different exposure times according to the measured value and the actual value, including:
[0108] The correction coefficient of each channel at different exposure times is determined based on the ratio of the actual value to the measured value.
[0109] Among them, the functional implementation of each module in the above-mentioned camera linearity correction device corresponds to the various steps in the above-mentioned camera linearity correction method embodiment, and its functions and implementation processes are no longer repeated here.
[0110] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A camera linearity correction method, characterized in that: The camera linearity correction method comprises the following steps: Determine the measurement values of the RGB channels of the image collected at each exposure time, wherein the grayscale values corresponding to different exposure times are located at different brightness positions of the full grayscale; Fit the measured value of each channel and the corresponding exposure time to obtain the fitting function of each channel; Calculate the actual value of each channel according to the fitting function of each channel, and determine the correction coefficient of each channel at different exposure times according to the measured value and the actual value; The average grayscale value of all foreground pixels of the target image is obtained, and according to the range of the average grayscale value, a dynamic selection is made among the correction coefficients at different exposure times of each channel to determine the correction coefficients of all channels.
2. The camera linearity correction method according to claim 1, characterized in that: According to the range of the average gray value, dynamically selecting the correction coefficients at different exposure times in each channel to determine the correction coefficients of all channels includes: Generate a correction coefficient matrix according to the correction coefficients of each channel at different exposure times, where the number of rows of the matrix is the number of channels, and the number of columns of the matrix is the number of exposure times; According to the relationship between the average grayscale value and the grayscale values corresponding to the different exposure times, the correction coefficient of the channel is determined based on the data in the corresponding column number of the matrix.
3. The camera linearity correction method according to claim 2, characterized in that: The determining of the correction coefficient of the channel based on the data in the number of columns corresponding to K according to the relationship between the average gray value and the gray values corresponding to the different exposure times comprises: The grayscale values corresponding to different exposure times are 5%, 20%, 40%, 60% and 80% of the full grayscale; If the average gray value is ≤0.05, linearityK(:,1) is used as the correction coefficient of the channel, where linearityK(:,1) represents the data in the first column of the matrix linearityK; If 0.8<average gray value≤1, linearityK(:,5) is used as the correction coefficient of the channel, where linearityK(:,5) represents the data in the 5th column of the matrix linearityK; If the average gray value is between any two adjacent values of 0.05, 0.2, 0.4, 0.6 and 0.8, the linear interpolation coefficient is obtained by linear interpolation calculation, and then the corresponding two columns of data in linearityK are weighted averaged as the correction coefficient of the channel.
4. The camera linearity correction method according to claim 1 or 2, characterized in that: The step of obtaining the average grayscale value of all foreground pixels of the target image includes: Take a target image and perform region extraction, and convert the extracted region into a grayscale image; Binarize the grayscale image to obtain a binary version of the grayscale image to determine the optimal threshold; Calculate the average gray value of all foreground pixels in the binarized image.
5. The camera linearity correction method according to claim 1, wherein: Determining the measurement values of the RGB channels of the image collected at each exposure time includes: Acquire multiple images for linearity correction at each exposure time; Calculate the average value of the RGB channels of multiple images at each exposure time as the measurement value of the RGB channels.
6. The camera linearity correction method according to claim 1, wherein: The measurement value of each channel and the corresponding exposure time are fitted to obtain a fitting function of each channel, including: With the exposure time as the independent variable and the measured value of the channel as the dependent variable, a polynomial linear fit is performed, and the slope and intercept are determined to obtain the fitting function of each channel.
7. The camera linearity correction method according to claim 1, characterized in that: The step of determining the correction coefficient of each channel at different exposure times according to the measured value and the actual value includes: The correction coefficient of each channel at different exposure times is determined based on the ratio of the actual value to the measured value.
8. A camera linearity correction device, characterized in that: The camera linearity correction device comprises: An acquisition module, which is used to determine the measurement values of the RGB channels of the image acquired at each exposure time, wherein the grayscale values corresponding to different exposure times are located at different brightness positions of the full grayscale; A fitting module, which is used to fit the measured value of each channel and the corresponding exposure time to obtain a fitting function of each channel; A calculation module, which is used to calculate the actual value of each channel according to the fitting function of each channel, and determine the correction coefficient of each channel at different exposure times according to the measured value and the actual value; The selection module is used to obtain the average grayscale value of all foreground pixels of the target image, and dynamically select the correction coefficients of each channel at different exposure times according to the range of the average grayscale value to determine the correction coefficients of all channels.
9. The camera linearity correction device according to claim 8, characterized in that: The selection module dynamically selects the correction coefficients of each channel at different exposure times according to the range of the average gray value to determine the correction coefficients of all channels, including: Generate a correction coefficient matrix according to the correction coefficients of each channel at different exposure times, where the number of rows of the matrix is the number of channels, and the number of columns of the matrix is the number of exposure times; According to the relationship between the average grayscale value and the grayscale values corresponding to the different exposure times, the correction coefficient of the channel is determined based on the data in the corresponding column number of the matrix.
10. The camera linearity correction device according to claim 9, characterized in that: The selection module determines the correction coefficient of the channel based on the data in the number of columns corresponding to K according to the relationship between the average gray value and the gray values corresponding to the different exposure times, including: The grayscale values corresponding to different exposure times are 5%, 20%, 40%, 60% and 80% of the full grayscale; If the average gray value is ≤0.05, linearityK(:,1) is used as the correction coefficient of the channel, where linearityK(:,1) represents the data in the first column of the matrix linearityK; If 0.8<average gray value≤1, linearityK(:,5) is used as the correction coefficient of the channel, where: linearityK(:,5) represents the data in the 5th column of the matrix linearityK; If the average gray value is between any two adjacent values of 0.05, 0.2, 0.4, 0.6 and 0.8, the linear interpolation coefficient is obtained by linear interpolation calculation, and then the corresponding two columns of data in linearityK are weighted averaged as the correction coefficient of the channel.
Citation Information
Patent Citations
Adaptive black level correction method
CN105578082A
A linearity correction method and device for an industrial camera
CN113873222A
Camera linearity detection method and system
CN114757946A
Color correction method and device, electronic equipment and storage medium
CN115471426A
Dark field and radiation response heterogeneity joint correction method of color area-array camera
CN117041746A
Cited By
Image pixel point anomaly removal method and system and medium
CN119545194A
A method, system and medium for removing abnormal image pixels
CN119545194B
