Industrial camera calibration method and device
Through random calibration scheme and light source rotation exchange technology, the environmental and manual impact problems in the calibration process of industrial cameras are solved, efficient and accurate camera calibration is achieved, and the operation process is simplified and calibration distortion is reduced.
Patent Information
- Application Number
- CN202211080350.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-05
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2042-09-05
AI Technical Summary
In the prior art, industrial cameras are greatly affected by the environment and manual during calibration, resulting in calibration distortion and complex processes.
The random calibration scheme is adopted to break the stripe periodic distribution by replacing the dark area bias value, reduce environmental and manual influence, and use surface light source rotation and standard camera to exchange light source positions with the camera to be calibrated, unify the light source conditions, and calculate the offset value and magnification ratio in combination with the fitted photosensitive characteristic curve intercept to calculate the offset value and magnification ratio to achieve automatic calibration.
Reduces calibration distortion, simplifies operating procedures, improves calibration consistency and accuracy, and reduces dependence on environment and labor.
Smart Images

Figure CN115409902B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of camera calibration, and in particular to an industrial camera calibration method and device. Background Art
[0002] With the development of the machine vision industry, customers have higher requirements for camera quantity, cost, and consistency. However, due to the sensor production process, the color and brightness of each sensor vary significantly, so calibration is required before shipment. In addition, calibration is also required for different sensor and camera characteristics, such as fixed stripes and vignetting, resulting in a large number of calibration equipment and workstations. Therefore, minimizing the impact of environmental and labor on the calibration process is a pressing issue. Summary of the Invention
[0003] The object of the present invention is to provide an industrial camera calibration method and device that reduces environmental and human influences and reduces calibration distortion.
[0004] The technical solution of the present invention is to provide an industrial camera calibration method, which includes: collecting the sensitivity characteristic curve of the i-th column of the camera to be calibrated and fitting its grayscale intercept on the curve as the offset value Offset of the grayscale value of the i-th column i , and calculate the required amplification factor Gain for the gray value of column i i ;
[0005] When detecting the maximum magnification Gain required for each column of the camera to be calibrated i When the preset threshold is not exceeded, the random calibration scheme is started to eliminate the noise visible to the human eye by breaking the slope of the photosensitive characteristic curve and the periodic distribution of the offset. Otherwise, the offset value of each column is set to Offset. i and Gain i Write to the camera to be calibrated to complete the calibration;
[0006] The random calibration scheme includes: calculating the bias value cycle, calibrating the columns with a value less than the average bias value within the cycle as dark columns, otherwise calibrating them as light columns, and randomly replacing the dark column with the bias value of any light column within the same cycle if the grayscale difference between the dark column and the bright column with the largest bias value within the same cycle is less than 2. Otherwise, no processing is performed.
[0007] In any of the above technical solutions, further, the calculation process of the bias value period in the random calibration scheme includes: calculating the difference between the bias values of any column in the camera to be calibrated and each of the twenty columns after the column, and taking the interval between the two columns with the smallest difference as the bias value period.
[0008] In any of the above technical solutions, further, in the random calibration solution, the dark column calibration value is set to 0, and the bright column calibration value is set to 1. After the calibration value is written into the camera to be calibrated, the dark column and the bright column are determined according to the calibration value using the FPGA of the camera to be calibrated.
[0009] In any of the above technical solutions, further, the photosensitivity characteristic curves of the standard camera and the camera to be calibrated are collected simultaneously, and the surface light source is placed on a rotatable platform. After each certain exposure time, the platform is rotated to exchange the light source positions of the standard camera and the camera to be calibrated, and then the exposure is continued until the standard camera and the camera to be calibrated are overexposed.
[0010] In any of the above technical solutions, further, the magnification of the grayscale value of the i-th column Gain i In the calculation process, the slope k of the photosensitivity curve is first i The average value of is taken as the calibration target value k mean ,calculate And normalize it about its minimum value to ensure that all are greater than 1, and finally get the magnification of the gray value of column i Gain i .
[0011] In any of the above technical solutions, further, when the maximum amplification factor Gain is detected i When the random calibration scheme cannot be started and the magnification of the grayscale value in column i exceeds 1.015, the magnification of the grayscale value in column i is increased by i Zoom in 512 times and round down to the offset value of the grayscale value in column i i Synthesize a 32-bit data and write it into the camera to be calibrated.
[0012] In any of the above technical solutions, the calibration method further includes: adjusting the sensitivity characteristic curves of the camera to be calibrated to be consistent with that of the standard camera, and calculating the average value k of the slope of each column of the sensitivity characteristic curve of the standard camera. standard , and get the overall gain of the camera to be calibrated Write the camera to be calibrated.
[0013] In any of the above technical solutions, further, the predetermined threshold is 1.015.
[0014] A device for executing any of the above-mentioned industrial camera calibration methods is also provided, comprising: a surface light source and a rotating table, wherein the surface light source is fixed on the rotating table and rotates with the rotating table, the standard camera and the camera to be calibrated are located at the same height, and the lens directions of the standard camera and the camera to be calibrated are perpendicular to the surface of the surface light source.
[0015] The beneficial effects of the present invention are:
[0016] The technical solution of this invention adopts a random calibration scheme. By replacing the dark area bias value, the periodic distribution of the stripes is broken, making the stripes imperceptible to the human eye, completing the camera calibration. Compared with the common fixed template denoising scheme, it suppresses distortion and does not affect image quality.
[0017] The offset value is obtained by fitting the intercept of the photosensitivity curve, eliminating the dark field acquisition process in the existing technology and reducing the requirements for tooling and operating procedures.
[0018] In a preferred implementation of the present invention, the light source is placed on a rotating platform, and the standard camera and the camera to be calibrated exchange the light source position at any time, thereby ensuring the uniformity of the light source during the calibration process and reducing errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The advantages of the above and additional aspects of the present invention will become apparent and readily understood from the following description of the embodiments with reference to the accompanying drawings, in which:
[0020] Figure 1 is a periodic distribution diagram of bias values of an industrial camera calibration method according to an embodiment of the present invention;
[0021] Figure 2 is a photosensitivity characteristic curve of an industrial camera calibration method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0022] In order to more clearly understand the above-mentioned objects, features and advantages of the present invention, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present invention and the features therein can be combined with each other without conflict.
[0023] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the scope of protection of the present invention is not limited to the specific embodiments disclosed below.
[0024] This embodiment provides an industrial camera calibration method, which includes: simultaneously collecting photosensitivity characteristic curves of a standard camera and a camera to be calibrated, placing a surface light source on a rotatable platform and rotating with it, the standard camera and the camera to be calibrated are at the same height, and the lens directions of the standard camera and the camera to be calibrated are perpendicular to the surface of the surface light source. During the collection, the automatic exposure is first used to adjust the expected grayscale value to 5. After each exposure for a certain period of time, the platform is rotated to swap the light source positions of the standard camera and the camera to be calibrated, and then the exposure is continued until the standard camera and the camera to be calibrated are overexposed and the grayscale reaches 255. Figure 2 As shown, draw a photosensitivity characteristic curve.
[0025] The sensitivity characteristic curve of the i-th column of the camera to be calibrated is fitted with a straight line by the least squares method, and the grayscale intercept obtained by fitting is used as the offset value Offset of the grayscale value of the i-th column i , the slope k of the photosensitivity curve i The average value of is taken as the calibration target value k mean ,calculate And normalize it about its minimum value to ensure that all are greater than 1, to ensure that the image can be saturated, and obtain the magnification Gain required for the grayscale value of the i-th column i .
[0026] When the maximum amplification factor is detected i When it does not exceed 1.015, the random calibration scheme is started to eliminate the noise visible to the human eye by breaking the periodic distribution of the slope and bias of the photosensitive characteristic curve. Otherwise, the amplification factor of the grayscale value in the i-th column is Gain. i Zoom in 512 times and round down to the offset value of the grayscale value in column i i The calibration is completed by synthesizing a 32-bit data and writing it into the camera to be calibrated.
[0027] The random calibration scheme includes: Figure 1 As shown in the figure, after sorting the offset values of each column by column number, the offset value difference between any column in the camera and each of the twenty columns after it is calculated, and the interval between the two columns with the smallest difference is used as the offset value period; within the same period, the column with an offset value less than the average value within the period is calibrated as a dark column, otherwise it is calibrated as a bright column, the dark column calibration value is set to 0, the bright column calibration value is set to 1, and the calibration value is written to the camera to be calibrated; the FPGA of the camera to be calibrated determines the dark column and the bright column according to the calibration value. If the grayscale difference between a dark column and the bright column with the largest offset value within the same period is less than 2, it is randomly replaced with the offset value of any bright column within the same period, otherwise no processing is performed.
[0028] Specifically, stripes appear in images captured by a camera. These stripes have grayscale differences from their surroundings, and these grayscale differences are periodically distributed. Within a grayscale range of 100, the human eye can only detect a difference of 1 to 2 grayscale values. By breaking the periodicity of grayscale distribution in images with minimal stripe variation, the stripes can be rendered imperceptible. Most currently manufactured industrial cameras meet this requirement. If the grayscale value difference between a dark column and a bright column of the same period is less than 2, the regularity can be broken by randomly replacing the dark column with the offset value of the bright column of the same period. Furthermore, if the grayscale difference is greater than 2, the grayscale variation is sufficient to mask the stripes. In this case, no replacement is performed, and no stripes appear.
[0029] The above process has completed the correction of the inconsistency of the columns of the camera to be calibrated. It is still necessary to compare it with the standard camera. First, the average value k of the slope of the photosensitivity characteristic curve of each column of the standard camera is calculated.standard , and get the overall gain of the camera to be calibrated Write the camera to be calibrated and adjust the photosensitivity curve of the camera to be calibrated to be consistent with that of the standard camera.
[0030] In summary, the present invention proposes an industrial camera calibration method, comprising: collecting the sensitivity characteristic curve of the i-th column of the camera to be calibrated and fitting its grayscale intercept on the curve as the offset value Offset of the grayscale value of the i-th column i , and calculate the required amplification factor Gain for the gray value of column i i ; When it is detected that for each column of the camera to be calibrated, the maximum magnification Gain required i When the value does not exceed 1.015, the bias value cycle is calculated, and the columns with a value less than the average bias value within the cycle are marked as dark columns, otherwise they are marked as bright columns. If the grayscale difference between the dark column and the bright column with the largest bias value within the same cycle is less than 2, it is randomly replaced with the bias value of any bright column within the same cycle; the maximum amplification factor Gain is detected i If the offset value exceeds 1.015, the offset value of each column will be i and Gain i Write the camera to be calibrated to complete the template calibration; calculate the average value k of the slope of each column of the photosensitivity characteristic curve of the standard camera standard and the average value k of the slope of each column of the sensitivity characteristic curve of the camera to be calibrated mean , and get the overall gain of the camera to be calibrated Write the camera to be calibrated.
[0031] The present invention also provides a device for executing any of the above-mentioned industrial camera calibration methods, the device comprising: a surface light source and a rotating table, the surface light source being fixed on the rotating table and rotating with it, the standard camera and the camera to be calibrated being located at the same height, and the lens directions of the standard camera and the camera to be calibrated being perpendicular to the surface of the surface light source.
[0032] The area light source is turned on, and the standard camera and the camera to be calibrated are exposed simultaneously for a certain period of time. The area light source is then turned off, the rotating stage is started to rotate the area light source 180 degrees, and the area light source is turned on again to expose the standard camera and the camera to be calibrated. The above process is repeated until the standard camera and the camera to be calibrated are overexposed.
[0033] The steps in the present invention can be adjusted in sequence, combined, or deleted according to actual needs.
[0034] Although the present invention has been disclosed in detail with reference to the accompanying drawings, it should be understood that these descriptions are merely illustrative and are not intended to limit the application of the present invention. The scope of the present invention is defined by the appended claims and includes various modifications, variations, and equivalents made to the invention without departing from the scope and spirit of the present invention.
Claims
1. A method for calibrating an industrial camera, characterized in that: The method comprises: collecting the first i The sensitivity characteristic curve of the column is fitted and its grayscale intercept on the curve is used as the first i Offset value of column grayscale value Offset i , and calculate for the i Required magnification for column grayscale values Gain i ; When the maximum magnification required for each column of the camera to be calibrated is detected, Gain i When the threshold is not exceeded, the random calibration scheme is started to eliminate the noise visible to the human eye by breaking the periodic distribution of the slope and bias of the photosensitive characteristic curve. Otherwise, the bias value of each column is Offset i and magnification Gain i Write to the camera to be calibrated to complete the calibration; No. i Magnification of column grayscale values Gain i In the calculation process, the slope of the photosensitivity curve is first k i The average value of k mean ,calculate And normalize it about its minimum value to ensure that all are greater than 1, and finally get the i Magnification of column grayscale values Gain i ; The random calibration scheme includes: calculating the bias value cycle, calibrating the columns with a value less than the average bias value within the cycle as dark columns, otherwise calibrating them as bright columns, and randomly replacing the dark column with the bias value of any bright column within the same cycle if the grayscale difference between the dark column and the bright column with the largest bias value within the same cycle is less than 2, otherwise no processing is performed; The calibration method also includes: adjusting the sensitivity characteristic curve of the camera to be calibrated to be consistent with that of the standard camera, and calculating the average slope of each column of the sensitivity characteristic curve of the standard camera. k standard , and get the overall gain of the camera to be calibrated Write the camera to be calibrated.
2. The industrial camera calibration method according to claim 1, wherein: The calculation process of the bias value period in the random calibration scheme includes: calculating the difference between the bias values of any column in the camera to be calibrated and each of the twenty columns after the column, and taking the interval between the two columns with the smallest difference as the bias value period.
3. The industrial camera calibration method according to claim 1, wherein: In the random calibration scheme, the dark column calibration value is set to 0, and the bright column calibration value is set to 1. After the calibration values are written into the camera to be calibrated, the dark column and the bright column are determined according to the calibration values using the FPGA of the camera to be calibrated.
4. The industrial camera calibration method according to claim 1, wherein: The sensitivity characteristic curves of the standard camera and the camera to be calibrated are collected at the same time. The surface light source is placed on a rotatable platform. After a certain period of exposure, the platform is rotated to swap the light source positions of the standard camera and the camera to be calibrated, and then exposure is continued until the standard camera and the camera to be calibrated are overexposed.
5. The industrial camera calibration method according to claim 1, wherein: When the maximum magnification is detected Gain i When the random calibration scheme is not started and the value exceeds 1.015, the i Magnification of column grayscale values Gain i Magnify 512 times and round down, and i Offset value of column grayscale value Offset i A 32-bit data is synthesized and written into the camera to be calibrated.
6. The industrial camera calibration method according to claim 1, wherein: The predetermined threshold is 1.
015.
7. A device for executing the industrial camera calibration method according to any one of claims 1 to 6, characterized in that: The device includes: a surface light source and a rotating platform, the surface light source is fixed on the rotating platform and rotates with it, the standard camera and the camera to be calibrated are located at the same height, and the lens directions of the standard camera and the camera to be calibrated are perpendicular to the surface of the surface light source.
Citation Information
Patent Citations
Method and equipment for testing photosensitive chip based on charge calculation
CN108668124A
Joint processing method of defective pixel detection and flat field calibration
CN109348216A