A surface light source calibration method, camera flat field correction method, system and medium
Through the line scanning camera, the line scanning images of the rectangular surface light source are collected and processed, and the interference of uneven light response is eliminated, and the flat field brightness array is formed, which solves the problem of rapid and accurate calibration of the light source brightness distribution in the prior art, and achieves a high-precision and fast flat field correction effect.
Patent Information
- Application Number
- CN202411476746.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-10-22
AI Technical Summary
The prior art is difficult to quickly and accurately calibrate the brightness distribution of light sources in high-precision flat field correction, resulting in long measurement time, large impact on environmental changes and limited resolution.
The line scan camera collects line scan images in the two vertical sides directions in the parallel plane of the rectangular surface light source, rotates the array to eliminate interference from the unevenness of light response, and forms a flat field brightness array to calibrate the uniform rectangular surface light source.
The brightness distribution of rectangular surface light sources is achieved quickly and accurately, improving the accuracy and efficiency of flat field correction, and avoiding the impact of light response inhomogeneity on the measurement results.
Smart Images

Figure CN119006613B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image processing technology, and in particular relates to a surface light source calibration method, a camera flat field correction method, a system and a medium. Background Art
[0002] Generally, a series of props including plane light source and uniform flat field target are used as the basis for flat field correction. The default correction reference object used during correction is "flat", so as to correct the responses of different positions of the camera to be consistent. This method is effective, simple and fast when the accuracy requirement is lower than 97%. However, when the correction accuracy requirement is higher than the unevenness of the plane itself, this method cannot meet the requirements and will bring the error of the correction reference object into the result of the flat field correction. It is necessary to design a flat field correction process with higher accuracy.
[0003] Common flat field correction reference objects are limited by factors such as manufacturing process, lighting conditions, and shooting conditions. It is difficult to achieve a brightness uniformity of more than 97% on a larger scale. In order to obtain high-precision flat field correction results, the brightness differences at different positions of the flat field target itself must be carefully characterized, and the reference flat field that has been carefully characterized must be photographed with a camera. The camera's response is then corrected to a level consistent with the calibrated flat field luminous brightness, rather than assuming that the reference flat field is uniform and corrected to the same brightness at all points. In this way, the flat field quality can theoretically be corrected to more than 99.5%.
[0004] However, in order to obtain such high-precision brightness distribution information of a surface light source in the existing technology, it is necessary to use a single brightness probe to measure the brightness of each part of the measured object in a point-by-point scanning manner, and then integrate the data to obtain the brightness distribution on the plane. This method does overcome the impact of light response non-uniformity on the measurement results, but the measurement time is long, which increases the probability that environmental changes during the measurement process (such as stray light level, ambient temperature) will have an adverse effect on the measurement results. At the same time, due to the measurement time limit, the scanning process can only be performed at a lower resolution, thus limiting the upper limit of the resolution of the data results.
[0005] Chinese patent CN201610551995.X discloses a real-time flat field correction method for an area array camera based on FPGA. In the flat field correction method, a block-based operation method is used to perform block operations on the sensor array, and an interpolation algorithm is combined on the basis of the block division to reduce resource consumption while performing operations on each point. The present invention provides the possibility of implementing a real-time FFC correction algorithm for a high-resolution and high-frame-rate area array camera, and provides a higher output image quality for high-resolution and high-frame-rate applications. By using an optimization algorithm, the light response non-uniformity (also known as PRNU) and vignetting effects are successfully corrected in real time while meeting the requirements of high resolution and high frame rate. However, the method of assuming that the surface light source is uniform for flat field correction in this scheme is different from the idea of this scheme.
[0006] Therefore, in order to solve the above-mentioned problems, the present invention provides a surface light source calibration method, a camera flat field correction method, a system and a medium, which can quickly and accurately calibrate the brightness distribution of the light source, so as to solve the problem that the existing measurement methods either cannot achieve sufficient accuracy or cannot complete the measurement in a shorter time. Summary of the invention
[0007] The purpose of the present invention is to overcome the above problems existing in the prior art and to provide a surface light source calibration method, a camera flat field correction method, a system and a medium.
[0008] In order to achieve the above technical objectives and the above technical effects, the present invention is implemented through the following technical solutions:
[0009] A method for calibrating a surface light source, comprising:
[0010] The line scan camera is used to collect line scan images of the rectangular surface light source area in the two perpendicular sides in the parallel plane of the rectangular surface light source, and a two-dimensional array of pixel brightness values of the two rectangular surface light source areas is obtained;
[0011] Rotate any of the arrays so that the same position of the rectangular surface light source as that of another array is mapped to be an array of the same type;
[0012] Select any of the same type arrays and convert it into a flat field brightness array according to the ratio of the brightness values of the same row / column corresponding to the line scanning direction of the other array, so as to eliminate the interference of the light response non-uniformity in the line scanning pixel row direction;
[0013] Used to calibrate a rectangular surface light source as a uniform rectangular surface light source.
[0014] Furthermore, the collecting of line scan images of the rectangular surface light source area in two perpendicular side directions in parallel planes of the rectangular surface light source includes:
[0015] Obtain line scan images in the directions of two perpendicular sides of the rectangular surface light source, and process the images to obtain line scan images of the rectangular surface light source area.
[0016] Furthermore, the step of obtaining a two-dimensional array of pixel brightness values of two rectangular surface light source areas includes:
[0017] The two images are equally divided to form a plurality of sub-images arranged in an array form, and the average values of the brightness values of the pixels in the plurality of sub-images in the two images are obtained to form two groups of arrays respectively.
[0018] Furthermore, the ratio conversion includes:
[0019] An alignment process is performed on any array to determine the data arrangement ratio relationship in the line scan direction, and an assimilation process is performed between the array and another array to determine the data arrangement ratio relationship in the line scan pixel row direction.
[0020] Furthermore, the alignment process includes:
[0021] The data arrangement in each line scan direction in any array is divided by the reference data arrangement corresponding to the line scan pixel row direction of the array.
[0022] Furthermore, the assimilation process includes:
[0023] The array after the alignment processing is taken and the array obtained by repeatedly expanding the corresponding data arrangement of the reference data arrangement in another array is multiplied bit by bit.
[0024] Furthermore, the method for calculating the average value of the brightness values of the pixels in the sub-image includes: using one or more combinations of weighted average, arithmetic average or square average.
[0025] A camera flat field correction method, comprising:
[0026] An image obtained by shooting a rectangular surface light source with a camera is divided into sub-images at equal intervals and a sub-image array is constructed; wherein the rectangular surface light source is a uniform rectangular surface light source calibrated by the surface light source calibration method as described above;
[0027] The sub-image array is compared with the flat-field brightness array, the proportional relationship of the elements at the corresponding positions is calculated to form an array, and the light response non-uniformity correction coefficient array is obtained to complete the flat-field correction.
[0028] A flat field calibration system, comprising:
[0029] An acquisition module, which acquires line scan images of the rectangular surface light source area in two perpendicular sides in parallel planes of the rectangular surface light source through a line scan camera, and obtains a two-dimensional array of pixel brightness values of the two rectangular surface light source areas;
[0030] A processing module, rotating any of the arrays so that the same position of the rectangular surface light source as the other array is mapped to be a same type array;
[0031] The calculation module selects any of the same type arrays and converts it into a flat field brightness array according to the ratio of the brightness values of the same row / column corresponding to the line scanning direction of the other array, so as to eliminate the interference of the light response non-uniformity in the line scanning pixel row direction.
[0032] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for calibrating a surface light source as described above is implemented.
[0033] The beneficial effects of the present invention are:
[0034] 1. In the present invention, the scanning characteristic of the line scan camera that is not affected by the light response non-uniformity in the line scan direction is utilized to scan and image the two vertical sides of the rectangular surface light source, and the brightness value in the direction not affected by the light response non-uniformity in one image is used to eliminate the brightness value affected by the light response non-uniformity in the other image, thereby obtaining a proportional relationship of brightness values that are not affected by the light response non-uniformity in both directions, so as to form a flat-field brightness array that reflects the proportional relationship of brightness values at different positions of the rectangular surface light source, thereby realizing rapid scanning and accurate calibration of the rectangular surface light source, so as to characterize the brightness difference at different positions of the rectangular surface light source.
[0035] 2. In the present invention, by performing secondary scanning imaging in the two vertical side directions of the rectangular surface light source, according to the scanning characteristic of the line scan camera that is not affected by the light response non-uniformity in the line scan direction, there is only one direction of light response non-uniformity in both images, that is, the scanning direction, and the light response non-uniformity in the direction perpendicular to the scanning direction is eliminated by vertical cross scanning, so as to efficiently obtain the brightness distribution of the rectangular surface light source, taking into account the high efficiency of the area array camera and the high precision of point-by-point scanning, and avoiding the influence of light response non-uniformity in all directions when using the area array camera. When using the point-by-point scanning method, the efficiency is low, and the calibration by the point-by-point scanning method is limited by the measurement time, which limits the upper limit of the resolution of the data results. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0037] Figure 1 is a flow chart of the rectangular surface light source calibration method of the present invention;
[0038] Figure 2 is a flow chart of the camera flat field correction method of the present invention;
[0039] Figure 3 is a system block diagram of the flat field calibration system in the present invention;
[0040] Figure 4 It is a horizontal stripe image produced by the horizontal line scanning of the line scanning camera in the present invention;
[0041] Figure 5 It is the vertical stripe image produced by the longitudinal line scanning of the line scanning camera in the present invention. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] Before flat field correction, a rectangular surface light source is generally used as the basis and it is assumed that the rectangular surface light source is uniform. However, since the rectangular surface light source is limited by factors such as manufacturing process, lighting conditions, and shooting conditions, it is difficult to achieve high brightness uniformity on a larger scale. In order to obtain high-precision flat field correction results, the brightness differences at different positions of the rectangular surface light source itself must be carefully characterized. In the prior art, a point-by-point scanning method is generally used to measure the brightness of each part of the rectangular surface light source in turn, and then the data is integrated to obtain the brightness distribution on the rectangular surface light source. However, this method takes a long time to measure. Due to the limitation of the measurement time, the scanning process can only be performed at a lower resolution, which limits the upper limit of the resolution of the data results.
[0044] Therefore, if Figure 1 As shown, the present invention first provides a surface light source calibration method, comprising:
[0045] The line scan camera is used to collect line scan images of the rectangular surface light source area in the two perpendicular sides in the parallel plane of the rectangular surface light source, and a two-dimensional array of pixel brightness values of the two rectangular surface light source areas is obtained;
[0046] Rotate any of the arrays so that the same position of the rectangular surface light source as that of another array is mapped to be an array of the same type;
[0047] Select any of the same type arrays and convert it into a flat field brightness array according to the ratio of the brightness values of the same row / column corresponding to the line scanning direction of the other array, so as to eliminate the interference of the light response non-uniformity in the line scanning pixel row direction;
[0048] Used to calibrate a rectangular surface light source as a uniform rectangular surface light source.
[0049] In the present invention, a line scan camera is used to calibrate the brightness value of each position of the rectangular surface light source. The line scan camera is not affected by the light response non-uniformity in its line scan direction (i.e., the scanning direction of the line scan camera), so that the calibration result is more accurate, taking into account the high efficiency of the area array camera and the high precision of point-by-point scanning, and avoiding the influence of light response non-uniformity in all directions when using the area array camera. When using the point-by-point scanning method, the efficiency is low, and the calibration by the point-by-point scanning method is limited by the measurement time, which limits the upper limit of the resolution of the data result.
[0050] Photo response non-uniformity, also known as PRNU (Photo Response Non-Uniformity), refers to the fact that each pixel on the camera sensor does not respond exactly the same to light. This phenomenon can cause non-uniformity in the image. In line scan cameras, since the sensor is only a few pixels high, the image non-uniformity caused by PRNU will reappear at the same position in the image, which may cause artifacts such as stripes and affect image quality.
[0051] like Figure 4-Figure 5 As shown in the figure, due to the non-uniform light response of the line scan pixel row direction, the line scan camera may be reflected in the image in the form of stripes. Depending on the scanning direction of the line scan camera, when the line scan camera scans horizontally, it will form the following Figure 4 When the line scan camera scans vertically, it will form the following Figure 5 The vertical stripes shown in the figure, in order to reduce the influence of the stripes on the image quality, the surface light source calibration method in the present invention can utilize the image consistency in the stripe direction (i.e., line scanning direction) to eliminate the influence of image inconsistency in the direction perpendicular to the stripe direction, that is, to reduce the influence of light response non-uniformity.
[0052] Due to the scanning characteristics of the line scan camera, it will not be affected by the non-uniformity of light response in the line scan direction. Therefore, by scanning and imaging in two directions along the rectangular surface light source and processing the image, the scanning result in another vertical direction (i.e., the line scan pixel row direction) is used to eliminate the data results affected by the non-uniformity of light response in this direction, thereby achieving high efficiency and high precision.
[0053] In the present invention, the line scan direction is the scanning direction in which the line scan camera and the rectangular surface light source move relative to each other, and the line scan pixel row direction is the direction perpendicular to the line scan direction and parallel to the rectangular surface light source, that is, the pixel arrangement direction in the line scan camera.
[0054] In the present invention, the shape of the surface light source is rectangular. The purpose is to match the subsequent camera flat field correction. The surface light source can completely fill the entire field of view of the camera to facilitate accurate correction of the brightness differences of different pixel points of the camera, and the line scan camera scans the two vertical sides of the rectangular surface light source respectively. The purpose is also to more accurately calculate the proportional relationship of the brightness values of the pixel points on the surface of the surface light source to improve accuracy.
[0055] In order to eliminate the camera's own shaking and further improve the accuracy, the rectangular surface light source can be scanned and imaged multiple times, and the images can be averaged to obtain a more accurate scanned image.
[0056] In the present invention, by acquiring the pixel brightness values at different positions in the rectangular surface light source area in the scanned image and forming a two-dimensional array, the proportional relationship between the pixel brightness values at different positions in the rectangular surface light source area is represented in an array manner, and then the array is used for subsequent data calculations to achieve the purpose of eliminating the influence of light response non-uniformity in the line scanning direction in one of the images.
[0057] In the present invention, since the line scan camera collects images of the two vertical sides of the rectangular surface light source respectively, the rectangular surface light source images in the two images cannot correspond one to one, that is, when the two images are overlapped, the rectangular surface light sources cannot overlap and correspond, which increases the difficulty of subsequent processing of image brightness value data. Therefore, it is necessary to rotate one of the arrays formed by the brightness value distribution so that the brightness value data of the corresponding array positions in the two images correspond one to one with the rectangular surface light source positions in the images, thereby facilitating the subsequent interference elimination operation steps.
[0058] Any of the arrays is rotated so that the same position of the rectangular surface light source as the other array is mapped into a same type array, so that the same position of the two arrays corresponds to the same relative position of the rectangular surface light source.
[0059] In the present invention, since the two images are obtained by scanning the two vertical sides of the rectangular surface light source, the relative positions of the rectangular surface light sources in the two images are rotated 90 degrees, and the relative positions of the two arrays generated by acquiring data for the images are also different. Therefore, it is necessary to rotate any one of the arrays so that the same position of the two arrays corresponds to the same relative position of the rectangular surface light source.
[0060] In the present invention, the selected array needs to be proportionally converted with respect to the brightness value data of the same row / column corresponding to the line scanning direction of another array, so as to eliminate the brightness value data of the image generated in another vertical scanning direction that is affected by the non-uniformity of light response through the brightness value data in the image generated in one scanning direction that is not affected by the non-uniformity of light response, and finally obtain a flat-field brightness array, thereby obtaining the proportional relationship of the brightness values in different positions of the rectangular surface light source, so as to characterize the brightness differences in different positions of the rectangular surface light source, thereby achieving high efficiency and high precision effects.
[0061] As described above, in the present invention, the scanning characteristic of the line scan camera that is not affected by the light response non-uniformity in the line scan direction is utilized to scan and image the two vertical sides of the rectangular surface light source, and the brightness value in the direction not affected by the light response non-uniformity in one image is used to eliminate the brightness value affected by the light response non-uniformity in the other image, thereby obtaining a proportional relationship of brightness values that are not affected by the light response non-uniformity in both directions, so as to form a flat-field brightness array that reflects the proportional relationship of brightness values at different positions of the rectangular surface light source, thereby realizing rapid scanning and precise calibration of the rectangular surface light source, so as to characterize the brightness differences at different positions of the rectangular surface light source.
[0062] As a specific implementation of the present invention, the collecting of line scan images of the rectangular surface light source area in two perpendicular side directions in parallel planes of the rectangular surface light source includes:
[0063] Obtain line scan images in the directions of two perpendicular sides of the rectangular surface light source, and process the images to obtain line scan images of the rectangular surface light source area.
[0064] A line scan camera is used to scan and image along the two vertical sides of the rectangular surface light source to obtain two images to be processed, and the position image of the luminous surface of the rectangular surface light source in the image to be processed is intercepted and retained to obtain a line scan image of the rectangular surface light source area.
[0065] In the present invention, since the scanning imaging of the line scan camera will synchronously scan the environmental image that does not belong to the rectangular surface light source, it is necessary to perform image processing on the scanned image, and intercept and retain the part of the luminous surface of the rectangular surface light source so as to use and calculate the part of the luminous surface of the rectangular surface light source.
[0066] In the present invention, when a line scan camera is used to scan and image two vertical sides of a rectangular surface light source, after scanning in one direction is completed, the line scan camera can be rotated to scan again, or the rectangular surface light source can be rotated to scan again, both of which fall within the protection scope of the present invention.
[0067] As described above, in the present invention, a secondary scanning imaging is performed on the two perpendicular sides of the rectangular surface light source. According to the scanning characteristic of the line scan camera that is not affected by the light response non-uniformity in the line scan direction, both images contain light response non-uniformity in only one direction, that is, the scanning direction. The light response non-uniformity in the direction perpendicular to the scanning direction is eliminated by vertical cross scanning, thereby efficiently obtaining the brightness distribution of the rectangular surface light source.
[0068] As a specific implementation of the present invention, the step of obtaining a two-dimensional array of pixel brightness values of two rectangular surface light source regions includes:
[0069] The two images are equally divided to form a plurality of sub-images arranged in an array form, and the average values of the brightness values of the pixels in the plurality of sub-images in the two images are obtained to form two groups of arrays respectively.
[0070] In the present invention, the processed image is divided into regions equidistantly to form sub-images, which are small grids with sizes approximately in the positive direction. The brightness values in the sub-images are read, and the brightness values of several sub-images are used as array units to form a first array and a second array respectively, so as to facilitate the subsequent array operation to eliminate the light response non-uniformity in the scanning direction of the image.
[0071] When the image is divided equally, the number of rows and columns of the corresponding sub-image is set according to the aspect ratio of the luminous surface of the rectangular surface light source in the image to ensure that the ratio of the number of rows and columns of the corresponding sub-image is equal to the aspect ratio of the rectangular surface light source.
[0072] In the present invention, the brightness value of a sub-image is the average brightness value of all pixels in the sub-image.
[0073] As a specific implementation of the present invention, the ratio conversion includes:
[0074] An alignment process is performed on any array to determine the data arrangement ratio relationship in the line scan direction, and an assimilation process is performed between the array and another array to determine the data arrangement ratio relationship in the line scan pixel row direction.
[0075] In the present invention, data arrangement refers to the corresponding data in any row or column in the array. For two arrays, the line scanning direction can be the row direction or column direction in the array.
[0076] In the present invention, one of the arrays is selected. Since the data arrangements in the line scan direction are not affected by the non-uniformity of light response, the proportional relationship of the data arrangements in this direction is accurate. Therefore, the proportional relationship of the data arrangements in this direction is clarified through alignment processing; while the data arrangements in the line scan pixel row direction are affected by the non-uniformity of light response, so the proportional relationship of the data arrangements in this direction is inaccurate. By assimilating the data arrangements in the line scan pixel row direction of another array with the corresponding data arrangements in the line scan direction, the proportional relationship of the corresponding data arrangements in the line scan pixel row direction of the array can be clarified, and then the accurate proportional relationship of the data arrangements in the row and column directions can be obtained in one array.
[0077] As a specific implementation of the present invention, the alignment process includes:
[0078] The data arrangement in each line scan direction in any array is divided by the reference data arrangement corresponding to the line scan pixel row direction of the array.
[0079] A division operation is performed using each data in the data arrangement corresponding to each line scan direction in any array as a divisor, and using the data at the intersection of the reference data arrangement corresponding to the line scan pixel row direction of the array and the data arrangement corresponding to each line scan direction as a dividend.
[0080] In the present invention, the data of a row or column in the array is used as a reference, and all the data in the column or row are divided by the data of the corresponding column or row where the reference data is located. The purpose of the alignment processing is to determine the proportional relationship between the data arrangements corresponding to each line scanning direction.
[0081] In the present invention, the data arrangement corresponding to each line scan direction in any of the first array and the second array is aligned with the reference data arrangement corresponding to the line scan pixel row direction of the array to form a third array to determine the proportional relationship between the data arrangement corresponding to each line scan direction; the data arrangement corresponding to each line scan direction of the first array and the second array can be a row or a column in the array, depending on the relative angle setting of the line scan camera and the rectangular surface light source, and the reference data arrangement can be any row or column in the data arrangement corresponding to the line scan pixel row direction in the array, and it needs to correspond to the direction of the data arrangement corresponding to each line scan direction of the first array and the second array mentioned above.
[0082] As a specific embodiment of the present invention, the assimilation process includes:
[0083] The array after the alignment processing is taken and the array obtained by repeatedly expanding the corresponding data arrangement of the reference data arrangement in another array is multiplied bit by bit.
[0084] In the present invention, a corresponding data arrangement of the reference data arrangement in another array and the aligned array is taken, and repeatedly expanded to form a fourth array of the same type as the third array, so as to determine the proportional relationship of the data arrangement corresponding to the line scan pixel row direction;
[0085] The third array is multiplied by the fourth array to obtain a flat-field brightness array.
[0086] As a specific implementation of the present invention, the method for calculating the average value of the brightness values of the pixels in the sub-image includes: using one or more combinations of weighted average, arithmetic average or square average.
[0087] The technical solution of the present invention is now specifically described with the following embodiments: Example 1
[0088] The specific steps for collecting rectangular surface light source images are as follows:
[0089] S101, placing a rectangular surface light source on a displacement platform, and adjusting the placement angle and direction of the rectangular surface light source so that the frame of the light source is parallel to the movement direction of the displacement platform;
[0090] S102, adjusting the angle between the displacement platform and the line scan camera to ensure that the movement direction of the displacement platform is perpendicular to the line scan pixel row direction of the line scan camera;
[0091] S103, start the displacement platform to perform reciprocating motion, use the line scan camera to shoot the rectangular surface light source in the lateral direction, repeat the scanning imaging 20 times and take an average to obtain a first image;
[0092] S104, rotating the rectangular surface light source by 90 degrees, repeating the alignment operation described in S101, and after completion, re-performing the reciprocating scanning and shooting described in S103 in the longitudinal direction to obtain a second image.
[0093] The specific steps to adjust the image are as follows:
[0094] S201, determining two positive integers m and n, so that m:n is close to the aspect ratio of the rectangular surface light source, so that the rectangular surface light source can be divided into m×n approximately square small grids;
[0095] S202: In the first image, locate the position of the luminous surface of the rectangular surface light source, cut out the portion of the luminous surface of the rectangular surface light source in the scan result image, divide it into m×n sub-images at equal intervals, and record the sub-image in the a-th row and the b-th column as Ih a,b , which represents the array composed of pixels in the sub-image with the a-th row and the b-th column.
[0096] Assume the length and width of the cropped image are w and h respectively, then the length and width of each sub-image are w / m and h / n respectively, construct the first array H m×n , the first array H m×n The elements are:
[0097]
[0098] in, represents the brightness value of the pixel in the i-th row and j-th column of the sub-image in the a-th row and b-th column, H a,b represents the average brightness value of the sub-image in the a-th row and the b-th column. The row elements of the first array are the scanning direction of the line scan camera.
[0099] S203, after rotating the second image by 90 degrees in the opposite direction of the rectangular surface light source in step S104, locate the position of the luminous surface of the rectangular surface light source, cut out the part of the luminous surface of the rectangular surface light source in the scanning result image, divide it into m×n sub-images with equal intervals, and record the sub-image of the a-th row and the b-th column as Iv a,b , which represents the array of pixels in the sub-image at row a and column b. Let the length and width of the intercepted image be w and h respectively, then the length and width of each sub-image are w / m and h / n respectively, and the second array V is constructed m×n , the second array V m×n The elements are:
[0100]
[0101] in, V represents the brightness value of the pixel in the i-th row and j-th column of the sub-image in the a-th row and b-th column. a,b represents the average brightness value of the sub-image in the a-th row and the b-th column, and the column elements of the second array are the scanning directions of the line scan camera;
[0102] Select a column in the first matrix (denoted as the jth 0 Column), align each row in the first matrix with this column to form a third array Ha m×n , the third array Ha m×n The elements are:
[0103]
[0104] in, The third array Ha m×n The element in row i and column j in is the element in the i-th row and j-th column of the first array, is the jth item in the i-th row of the first array 0 Elements of a column;
[0105] The specific steps to determine the brightness distribution of a rectangular surface light source are as follows:
[0106] S301, select a column in the second array (denoted as the jth 0 columns), and repeat the expansion to form a fourth array N m×n , the fourth array N m×n The elements are:
[0107]
[0108] in, The fourth array N m×n The element in row i and column j in is the jth item in the i-th row of the second array 0 Elements of a column;
[0109] The fourth array N m×n With the third array Ha m×n By multiplying the two bits (also called Hadamard product), we can estimate the brightness distribution of the rectangular surface light source. (i.e., flat-field brightness array), The elements are:
[0110]
[0111] in, is the element in the i-th row and j-th column of the flat-field brightness array, The third array Ha m×n The element in row i and column j in The fourth array N m×n The element in row i and column j of ;
[0112] S302, select multiple different j 0 , respectively give the brightness estimation of the rectangular surface light source; if a total of M estimations are made, the kth estimation is recorded as , the final brightness estimation result of the rectangular surface light source can be obtained by taking the average multiple times , The elements are:
[0113]
[0114] in, The brightness estimation result The element in row i and column j in is the element in the i-th row and j-th column of the k-th brightness estimation result;
[0115] The purpose of step S302 is mainly to avoid being affected by abnormal points on a single reference line when selecting the single reference line, and to reduce the noise mixed in the scanning process by means of multiple averaging.
[0116] The specific steps of using flat field correction are:
[0117] The image obtained by shooting the rectangular surface light source with a camera is used to construct a sub-image array using steps similar to S202. ,and The array is compared and the proportional relationship of the elements at the corresponding positions is calculated to form an array, so as to obtain a complete light response non-uniformity correction coefficient array. The specific steps are as follows:
[0118] S401, use the actual shooting system to image the rectangular surface light source so that the rectangular surface light source can just fill the field of view; record the image as an array , where each element value is the brightness value of the corresponding position of the captured image, and its length and width are w and h respectively.
[0119] S402, using the positive integers n and m selected above, It is divided into m×n subgraphs at equal intervals, and the subgraph in the ath row and bth column is denoted as , which represents the array of pixels in the sub-image in row a and column b. The parameter array is calculated using the following formula , The elements in are:
[0120]
[0121] in, For subgraph The element in row i and column j in is the parameter matrix The subgraph at row a and column b in ;
[0122] S403. Then, each element of the light response non-uniformity correction coefficient array C can be given by the following formula:
[0123]
[0124] Among them, C i,j is the element in the i-th row and j-th column of the correction coefficient array C, max(I T ) represents the parameter matrix The maximum value in The brightness estimation result The element at row i and column j in .
[0125] The correction array can be regarded as the multiplication correction coefficients of the central pixels in the equally spaced sub-images. The correction coefficients of the pixels between two central pixels can be obtained by linear interpolation between the elements of the correction array. At this point, the entire correction process is completed.
[0126] like Figure 2 As shown, based on the same inventive concept, the present application also proposes a camera flat field correction method, comprising:
[0127] An image obtained by shooting a rectangular surface light source with a camera is divided into sub-images at equal intervals and a sub-image array is constructed; wherein the rectangular surface light source is a uniform rectangular surface light source calibrated by the surface light source calibration method as described above;
[0128] The sub-image array is compared with the flat-field brightness array, the proportional relationship of the elements at the corresponding positions is calculated to form an array, and the light response non-uniformity correction coefficient array is obtained to complete the flat-field correction.
[0129] like Figure 3 As shown, based on the same inventive concept, the present application also proposes a flat field calibration system, comprising:
[0130] An acquisition module, which acquires line scan images of the rectangular surface light source area in two perpendicular sides in parallel planes of the rectangular surface light source through a line scan camera, and obtains a two-dimensional array of pixel brightness values of the two rectangular surface light source areas;
[0131] A processing module, rotating any of the arrays so that the same position of the rectangular surface light source as the other array is mapped to be a same type array;
[0132] The calculation module selects any of the same type arrays and converts it into a flat field brightness array according to the ratio of the brightness values of the same row / column corresponding to the line scanning direction of the other array, so as to eliminate the interference of the light response non-uniformity in the line scanning pixel row direction.
[0133] Based on the same inventive concept, the present application also proposes a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for calibrating a surface light source as described above is implemented.
[0134] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0135] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements all fall within the scope of the present invention to be protected.
Claims
1. A method for calibrating a surface light source, characterized in that: include: The line scan camera is used to collect line scan images of the rectangular surface light source area in the two perpendicular sides in the parallel plane of the rectangular surface light source, and a two-dimensional array of pixel brightness values of the two rectangular surface light source areas is obtained; Rotate any of the arrays so that the same position of the rectangular surface light source as that of another array is mapped to be an array of the same type; Select any of the same type arrays and convert it into a flat field brightness array according to the ratio of the brightness values of the same row / column corresponding to the line scanning direction of the other array, so as to eliminate the interference of the light response non-uniformity in the line scanning pixel row direction; Used to calibrate a rectangular surface light source as a uniform rectangular surface light source.
2. A surface light source calibration method according to claim 1, characterized in that: The collecting of line scan images of the rectangular surface light source area in two perpendicular side directions in parallel planes of the rectangular surface light source comprises: Obtain line scan images in the directions of two perpendicular sides of the rectangular surface light source, and process the images to obtain line scan images of the rectangular surface light source area.
3. A surface light source calibration method according to claim 1, characterized in that: The step of obtaining a two-dimensional array of pixel brightness values of two rectangular surface light source areas includes: The two images are equally divided to form a plurality of sub-images arranged in an array form, and the average values of the brightness values of the pixels in the plurality of sub-images in the two images are obtained to form two groups of arrays respectively.
4. A method for calibrating a surface light source according to claim 3, characterized in that: The ratio conversion includes: An alignment process is performed on any array to determine the data arrangement ratio relationship in the line scan direction, and an assimilation process is performed between the array and another array to determine the data arrangement ratio relationship in the line scan pixel row direction.
5. A method for calibrating a surface light source according to claim 4, characterized in that: The alignment process comprises: The data arrangement in each line scan direction in any array is divided by the reference data arrangement corresponding to the line scan pixel row direction of the array.
6. A method for calibrating a surface light source according to claim 5, characterized in that: The assimilation process comprises: The array after the alignment processing is taken and the array obtained by repeatedly expanding the corresponding data arrangement of the reference data arrangement in another array is multiplied bit by bit.
7. A method for calibrating a surface light source according to claim 3, characterized in that: The method for calculating the average value of the brightness values of the pixels in the sub-image includes: using one or more combinations of weighted average, arithmetic average or square average.
8. A camera flat field correction method, characterized in that: include: An image obtained by shooting a rectangular surface light source with a camera is divided into sub-images at equal intervals and a sub-image array is constructed; wherein the rectangular surface light source is a uniform rectangular surface light source calibrated by the surface light source calibration method according to any one of claims 1 to 7; The sub-image array is compared with the flat-field brightness array, the proportional relationship of the elements at the corresponding positions is calculated to form an array, and the light response non-uniformity correction coefficient array is obtained to complete the flat-field correction.
9. A flat field calibration system, characterized in that: include: An acquisition module, which acquires line scan images of the rectangular surface light source area in two perpendicular sides in parallel planes of the rectangular surface light source through a line scan camera, and obtains a two-dimensional array of pixel brightness values of the two rectangular surface light source areas; A processing module is used to rotate any of the arrays so that the same position of the rectangular surface light source as the other array is mapped to be a same-type array; The calculation module selects any of the same type arrays and converts it into a flat field brightness array according to the ratio of the brightness values of the same row / column corresponding to the line scanning direction of the other array, so as to eliminate the interference of the light response non-uniformity in the line scanning pixel row direction.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, a surface light source calibration method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
A Real-Time Plane Correction Method for Area Scan Cameras Based on FPGA
CN106204492B
A flat-field calibration method of a linear array camera
CN108986170A
Uniform light source platform for camera calibration and non-uniformity measurement and correction method
CN115037922A