A light source calibration method and system based on line scan imaging system
Through the light source calibration method and system based on the line scanning imaging system, the adjustable calibration device and image detection are used to solve the problem of inaccurate light source debugging in the prior art, and the light source calibration accuracy and detection effect are improved.
Patent Information
- Application Number
- CN202210878501.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-25
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2042-07-25
AI Technical Summary
In the prior art, light source debugging is difficult to achieve precise control of the light source, resulting in difficult to achieve expectations.
Using a light source calibration method and system based on a line scan imaging system, an adjustable calibration device is provided to determine the target calibration area within the imaging area, and the detection images acquired by the line scan imaging system are used to calibrate the light source.
It effectively improves the calibration accuracy of the light source and ensures the detection effect of the visual detection system.
Smart Images

Figure CN115046743B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of light source calibration, and in particular to a light source calibration method and system based on a line scan imaging system. Background Art
[0002] Visual inspection can use machines instead of human eyes to measure products to determine whether the products have defects. With the popularization and application of visual inspection technology, large-size and high-precision inspection applications are gradually increasing.
[0003] In order to meet the requirements of large-size and high-precision inspection, the types of lighting sources included in visual inspection systems are increasing. For example, coaxial light sources, high-angle light sources and low-angle light sources are set up simultaneously in a visual inspection system.
[0004] With the increase in large-size and high-precision detection applications, there are more and more cases where multiple lighting angles are included in a machine vision imaging module. For example, the patent application number is 201821511046.X, and the name is an image acquisition system for detecting defects on transparent substrates. The system integrates three upper light sources and three lower light sources. The divergence angle and lighting angle changes of any of the three light sources have a huge impact on high-precision detection. In the prior art, it is difficult to achieve precise control of the light source by debugging the light source with the naked eye, resulting in the detection effect being difficult to achieve the expected result. Summary of the invention
[0005] In view of the shortcomings of the prior art, the present invention provides a light source calibration method and system based on a line scan imaging system, which solves the problem in the prior art that it is difficult to achieve precise control of the light source by debugging the light source through the naked eye, resulting in difficulty in achieving the expected detection effect.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] A light source calibration method based on a line scan imaging system is used to calibrate a light source, wherein the light source is irradiated in an imaging area of the line scan imaging system; a calibration device is provided, wherein the calibration device includes calibration areas corresponding to the types of the light sources one by one; the calibration method includes:
[0008] Determining a light source type of the light source to be calibrated, and determining a target calibration area from the calibration device according to the light source type;
[0009] Adjusting the position of the calibration device so that the target calibration area is located within the imaging area;
[0010] A detection image captured by the line scan imaging system is acquired, and the light source to be calibrated is calibrated based on the detection image.
[0011] Optionally, acquiring the detection image acquired by the line scan imaging system and calibrating the light source to be calibrated based on the detection image includes:
[0012] Obtaining the distribution of light spots in the detection image;
[0013] The illumination angle of the light source to be calibrated is calibrated based on the light spot distribution until the light spots in the detection image present a sinusoidal distribution.
[0014] Optionally, the light source includes a plurality of illumination areas;
[0015] The acquiring the detection image acquired by the line scan imaging system and calibrating the light source to be calibrated based on the detection image includes:
[0016] Obtaining brightness distribution of the detection image;
[0017] Based on the brightness distribution, the light source is adjusted by partition until the brightness of the detection image is evenly distributed.
[0018] Optionally, acquiring the detection image acquired by the line scan imaging system and calibrating the light source to be calibrated based on the detection image includes:
[0019] Acquire the grayscale value area of the detection image;
[0020] The gray value area is compared with a preset standard area range, and the first angle parameter of the light source to be calibrated is calibrated according to the comparison result until the gray value area of the detection image matches the preset standard area range.
[0021] Optionally, acquiring the detection image acquired by the line scan imaging system and calibrating the light source to be calibrated based on the detection image includes:
[0022] Obtaining the grayscale value distribution of the detection image;
[0023] The second angle parameter of the light source to be calibrated is calibrated based on the grayscale value distribution until the grayscale distribution of the detection image presents a Gaussian distribution.
[0024] Optionally, the light source comprises a coaxial light source, and the calibration device comprises a coaxial calibration area corresponding to the coaxial light source;
[0025] An arc-shaped protrusion in the form of a long strip is provided in the coaxial calibration area, and the cross section of the arc-shaped protrusion is an arc-shaped curved surface.
[0026] Optionally, the light source further comprises a first inclined light source and a second inclined light source, and an angle between an outgoing light of the second inclined light source and a horizontal line is greater than an angle between an outgoing light of the first inclined light source and a horizontal line;
[0027] The calibration device comprises a first angle calibration area corresponding to the first inclined light source, and a second angle calibration area corresponding to the second inclined light source, wherein the first angle calibration area and the second angle calibration area respectively comprise at least one arc-shaped base member, and the arc-shaped base member is in a strip shape;
[0028] The arc-shaped base member comprises two arc-shaped side portions, the two arc-shaped side portions are symmetrically arranged, and the cross section of the arc-shaped side portion is an arc-shaped curved surface.
[0029] Optionally, in the first angle calibration area, an angle between the arc base of the arc-shaped side portion and a horizontal line is positively correlated with a target illumination angle of the first oblique light source;
[0030] In the second angle calibration area, the angle between the arc base of the arc side portion and the horizontal line is positively correlated with the target illumination angle of the second inclined light source.
[0031] The present invention further provides a light source calibration system based on a line scan imaging system, which is used to implement the light source calibration method based on a line scan imaging system as described in any one of the above items, so as to calibrate the light source; the calibration system comprises:
[0032] A line scan imaging system, wherein the light source is irradiated in an imaging area of the line scan imaging system;
[0033] A calibration device, the calibration device comprising calibration areas corresponding one to one with the types of light sources in the line scan imaging system;
[0034] a determination unit, configured to determine a light source type of the light source to be calibrated, and determine a target calibration area from the calibration device according to the light source type;
[0035] an adjusting unit, used for adjusting the position of the calibration device so that the target calibration area is located within the imaging area;
[0036] An execution unit is used to obtain a detection image collected by the line scan imaging system, and calibrate the light source to be calibrated based on the detection image.
[0037] Optionally, the light source includes a coaxial light source, a first inclined light source and a second inclined light source, and the angle between the emitted light of the second inclined light source and the horizontal line is greater than the angle between the emitted light of the first inclined light source and the horizontal line;
[0038] The calibration device comprises a coaxial calibration area corresponding to the coaxial light source, a first angle calibration area corresponding to the first oblique light source, and a second angle calibration area corresponding to the second oblique light source;
[0039] The coaxial calibration area is provided with an arc-shaped protrusion in the form of a long strip, and the cross section of the arc-shaped protrusion is an arc-shaped curved surface;
[0040] The first angle calibration area and the second angle calibration area respectively include at least one arc-shaped base member, and the arc-shaped base member is in the shape of an elongated strip; the arc-shaped base member includes two arc-shaped side portions, and the two arc-shaped side portions are symmetrically arranged, and the cross section of the arc-shaped side portion is an arc-shaped curved surface;
[0041] In the first angle calibration area, the angle between the arc base of the arc side portion and the horizontal line is positively correlated with the target illumination angle of the first inclined light source; in the second angle calibration area, the angle between the arc base of the arc side portion and the horizontal line is positively correlated with the target illumination angle of the second inclined light source.
[0042] Compared with the prior art, the present invention has the following beneficial effects:
[0043] The present invention provides a light source calibration method and system based on a line scan imaging system. By setting a calibration device with adjustable position, when the light source needs to be calibrated, a target calibration area corresponding to the light source to be calibrated in the calibration device is located within the imaging area, so that the detection image collected by the line scan imaging system can be used as a calibration basis to calibrate the light source to be calibrated; based on this, the present invention effectively improves the calibration accuracy of the light source, thereby ensuring the detection effect of the visual detection system. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0045] Figure 1 A combined structural diagram and a light path schematic diagram of a line scanning imaging system and a calibration device in a light source calibration method based on a line scanning imaging system provided by the present invention;
[0046] Figure 2 A schematic structural diagram of a calibration device in a light source calibration method based on a line scan imaging system provided by the present invention;
[0047] Figure 3 A cross-sectional view of a calibration device in a light source calibration method based on a line scan imaging system provided by the present invention;
[0048] Figure 4 A flow chart of a light source calibration method based on a line scan imaging system provided by the present invention;
[0049] Figure 5 A flow chart of step S3 in a light source calibration method based on a line scan imaging system provided by the present invention;
[0050] Figure 6 A second flow chart of step S3 in a light source calibration method based on a line scan imaging system provided by the present invention;
[0051] Figure 7 The third flow chart of step S3 in the light source calibration method based on the line scan imaging system provided by the present invention;
[0052] Figure 8 A fourth flow chart of step S3 in a light source calibration method based on a line scan imaging system provided by the present invention;
[0053] Fig. 9 A schematic diagram of the partial structure of a calibration device in a light source calibration method based on a line scan imaging system provided by the present invention;
[0054] Fig.10 A structural block diagram of a light source calibration system based on a line scan imaging system provided by the present invention.
[0055] In the above figure: 11, coaxial light source; 12, first inclined light source; 13, second inclined light source; 20, calibration device; 21, focusing area; 22, coaxial calibration area; 23, first angle calibration area; 24, second angle calibration area; 30, determination unit; 40, adjustment unit; 50, execution unit; 60, line scan imaging system. DETAILED DESCRIPTION
[0056] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below 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.
[0057] It should be understood that in the description of the present invention, the specific embodiments are only used to explain the present invention, rather than to limit the present invention. Among them, the exemplary embodiments are described as processes or methods depicted as flowcharts; although the flowchart describes the processing of various operations or steps in a certain order, many of the operations or steps can be implemented in parallel, concurrently or simultaneously, and the order of the operations can be rearranged. When its operation or step is completed, the corresponding processing can be terminated, and there can also be additional steps not included in the drawings. The aforementioned processing can correspond to methods, functions, procedures, subroutines, subprograms, etc., and the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0058] The term "including" and its variations used in the present invention are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The technical solution of the present invention is further described below in conjunction with the accompanying drawings and through specific implementation methods; it can be understood that for the sake of ease of description, the accompanying drawings only show parts related to the present invention rather than all structures.
[0059] With the increase in large-size and high-precision detection applications, there are more and more cases where multiple lighting angles are included in a machine vision imaging module. For example, the patent application number is 201821511046.X, and the name is an image acquisition system for detecting defects on transparent substrates. The system integrates three upper light sources and three lower light sources. The divergence angle and lighting angle changes of any of the three light sources have a huge impact on high-precision detection. In the prior art, it is difficult to achieve precise control of the light source by debugging the light source with the naked eye, resulting in the detection effect being difficult to achieve the expected result.
[0060] In the prior art, the divergence angle and illumination angle of the light source are determined by LED lamp beads and optical components. However, the combination and fixation of multiple light sources are completed by fixed structural parts, which will produce a large cumulative error between the LED lamp beads and optical components and the fixed structural parts. Although the tolerance of the divergence angle and illumination angle of the light source can be reduced through methods such as DFSS (Six Sigma Design), the error still exists.
[0061] Based on this, the present invention provides a light source calibration solution based on a line scan imaging system to solve the above problems in the prior art.
[0062] The present invention provides a light source calibration method based on a line scan imaging system, which is used to calibrate the light source; wherein the light source may specifically include more than two light sources, and the line scan imaging system can ultimately image an imaging area, and these light sources irradiate the imaging area of the line scan imaging system.
[0063] Please refer to Figures 1 to 3In this embodiment, the light source includes a coaxial light source 11, a first inclined light source 12 and a second inclined light source 13; wherein the angle between the emitted light of the second inclined light source 13 and the horizontal line is greater than the angle between the emitted light of the first inclined light source 12 and the horizontal line, that is, the first inclined light source 12 is a high-angle light source in this embodiment, and the second inclined light source 13 is a low-angle light source in this embodiment.
[0064] In order to achieve the calibration purpose, the present embodiment provides a calibration device 20, which includes calibration areas corresponding to the types of light sources, specifically: a coaxial calibration area 22 corresponding to the coaxial light source 11, a first angle calibration area 23 corresponding to the first inclined light source 12, and a second angle calibration area 24 corresponding to the second inclined light source 13, and the surface of each calibration area is a high-reflection surface.
[0065] Among them, the coaxial calibration area 22 is provided with an arc-shaped protrusion in the shape of an elongated strip, and the cross-section of the arc-shaped protrusion is an arc-shaped curved surface; the first angle calibration area 23 and the second angle calibration area 24 respectively include at least one arc-shaped base member, the arc-shaped base member is in the shape of an elongated strip, and includes two arc-shaped side portions, the two arc-shaped side portions are symmetrically arranged and connected to each other, and the cross-section of the arc-shaped side portion is an arc-shaped curved surface.
[0066] Specifically, please refer to Figure 4 , the calibration method provided in this embodiment includes:
[0067] S1. Determine the light source type of the light source to be calibrated, and determine a target calibration area from the calibration device 20 according to the light source type.
[0068] In this step, it is first necessary to determine the light source type of the light source to be calibrated, such as whether the light source to be calibrated is a coaxial light source 11 or an inclined light source; when the light sources to be calibrated include multiple inclined light sources, they can be divided into high-angle light sources and low-angle light sources according to the degree of inclination of the inclined light sources. During calibration, it is necessary to determine whether the light source to be calibrated is a high-angle light source or a low-angle light source, so as to determine the target calibration area from the calibration device 20.
[0069] S2, adjusting the position of the calibration device 20 so that the target calibration area is located within the imaging area;
[0070] In this step, based on the light source type of the light source to be calibrated determined in step S1, the position of the calibration device 20 is adjusted so that the light source to be calibrated can illuminate the target calibration area of the calibration device 20, so that the line scan imaging system can image the imaging area under the illumination environment.
[0071] It is understandable that the position adjustment of the calibration device 20 can be achieved by driving a driving member, such as a cylinder or a servo motor.
[0072] S3. Acquire a detection image captured by the line scan imaging system, and calibrate the light source to be calibrated based on the detection image.
[0073] In this step, a detection image is collected for the target calibration area under the illumination of the target calibration area of the light source to be calibrated, and the detection image is used as a basis to calibrate the light source to be calibrated.
[0074] Please refer to Figure 5 Specifically, step S3 includes:
[0075] S311, obtaining the distribution of light spots in the detection image;
[0076] S312, calibrating the illumination angle of the light source to be calibrated based on the light spot distribution, until the light spots in the detection image present a sinusoidal distribution.
[0077] In this step, no matter it is a coaxial light source 11 or an inclined light source, the illumination angle can be detected by detecting the distribution of light spots in the image, and the illumination angle of the light source to be calibrated can be adjusted according to the distribution of light spots, until the light spots in the detected image show a sinusoidal distribution, the illumination angle of the light source to be calibrated meets the requirements, and the adjustment of the illumination angle of the light source to be calibrated can be completed at this time.
[0078] Please refer to Figure 6 Further, in this embodiment, at least the coaxial light source 11 includes a plurality of irradiation areas; based on this, the step S3 further includes:
[0079] S321, obtaining the brightness distribution of the detection image;
[0080] S322: Based on the brightness distribution, the light source is adjusted by partition until the brightness of the detected image is evenly distributed.
[0081] The steps S321 to S322 can adjust the illumination parameters of the partitions of the coaxial light source 11, and specifically use the brightness distribution of the detection image as the basis for adjusting the partitions of the light source. For example, if the brightness of the edge position in the detection image is different from that of other positions, the edge area of the calibration light source is calibrated; based on this, each partition of the calibration light source is calibrated until the brightness of the detection image is evenly distributed.
[0082] Please refer to Figure 7 Further, step S3 also includes:
[0083] S331, obtaining the gray value area of the detection image;
[0084] S332, comparing the gray value area with a preset standard area range, and calibrating the first angle parameter of the light source to be calibrated according to the comparison result, until the gray value area of the detected image matches the preset standard area range.
[0085] For the coaxial light source 11, the first angle parameter is the light cone angle; for the inclined light source, the first angle parameter is the divergence angle.
[0086] Taking an inclined light source as an example, when the divergence angle of the light source is small, the grayscale value area of the detected image is small; when the divergence angle of the light source is large, the grayscale value area of the detected image is large. It can be understood that the divergence angle threshold used to distinguish whether the divergence angle of the light source is large or small can be set according to actual conditions.
[0087] Please refer to Figure 8 Further, step S3 also includes:
[0088] S341, obtaining the gray value distribution of the detection image;
[0089] S342, calibrating the second angle parameter of the light source to be calibrated based on the grayscale value distribution, until the grayscale distribution of the detected image presents a Gaussian distribution.
[0090] Among them, for the inclined light source, the second angle parameter is the divergence angle; the divergence angle of the inclined light source is calibrated based on the grayscale value distribution of the detection image. When the grayscale distribution of the detection image finally collected presents a Gaussian distribution, it means that the divergence angle of the inclined light source meets the working requirements.
[0091] It can be understood that after calibrating each partition of the light source to be calibrated until the brightness of the detection image is evenly distributed, the camera in the line scan imaging system can be calibrated by flat field correction based on the grayscale value distribution of the detection image, so as to achieve camera calibration, which is beneficial to ensure the accuracy of the calibration results.
[0092] Furthermore, if Fig. 9 As shown in the figure, the left side is the local structure of the second angle calibration area 24, and the right side is the local structure of the first angle calibration area 23; the arc-shaped base members in the first angle calibration area 23 and the second angle calibration area 24 both include two arc-shaped side portions, the two arc-shaped side portions are symmetrically arranged and connected to each other, and the cross-section of the arc-shaped side portions is an arc-shaped curved surface; wherein the arc-shaped side portions in the arc-shaped base member can be regarded as consisting of an arc-shaped base A with an inclined surface, and an arc surface B located on the arc-shaped base.
[0093] Among them, in the first angle calibration area 23, the angle θ1 between the arc base A of the arc side and the horizontal line is positively correlated with the target illumination angle α1 of the first inclined light source 12; in the second angle calibration area 24, the angle between the arc base θ2 of the arc side and the horizontal line is positively correlated with the target illumination angle α2 of the second inclined light source 13.
[0094] Specifically, the relationship between θ1 and α1, and between θ2 and α2 is as follows:
[0095] θ1=1 / 2α1;
[0096] θ2=1 / 2α2.
[0097] Therefore, in this embodiment, the inclination angle of the arc-shaped base relative to the horizontal line in the arc-shaped base member can also be determined according to the type of light source, so that the current illumination angle of the light source can be detected and calibrated during the calibration process.
[0098] Taking the first inclined light source 12 and the first angle calibration area 23 as an example, specifically, in step S3, a standard reference image is pre-set, and the standard reference image is obtained by the first inclined light source 12 illuminating the first angle calibration area 23 at the target illumination angle; during the calibration process, the detection image is compared with the standard reference image to determine whether the current illumination angle of the first inclined light source 12 meets the requirements, and the illumination angle of the first inclined light source 12 is calibrated according to the comparison result.
[0099] In addition, in the first angle calibration area 23 and the second angle calibration area 24, under certain conditions, such as when the height of the arc-shaped side portion remains unchanged, the smaller the radius of the cross-section of the arc-shaped side portion, the more the grayscale value distribution of the detected image tends to be Gaussian distribution; in this embodiment, in the first angle calibration area 23, the radius of the cross-section of the arc-shaped side portion ranges from 4 to 20 mm; in the second angle calibration area 24, the radius of the cross-section of the arc-shaped side portion ranges from 0.5 to 4 mm.
[0100] Please refer again Figure 2 , 3 In this embodiment, the calibration device 20 also includes a focus area 21, which is used to test the field of view and working distance of the line scan imaging system; specifically, a Siemens star test pattern is provided in the focus area 21, and a size scale is provided; by detecting the resolution of the detection image obtained in step S3, and adjusting the field of view and working distance of the line scan imaging system based on the detection result, until the resolution of the detection image in the detection image reaches the requirement, then the field of view and working distance of the line scan imaging system meet the working requirements.
[0101] Please refer to Fig.10 Based on the aforementioned embodiments, the present invention further provides a light source calibration system based on a line scan imaging system, which is used to implement the light source calibration method based on a line scan imaging system as described in the above embodiments to calibrate the light source.
[0102] Specifically, the calibration system includes:
[0103] A line scan imaging system 60, wherein the light source is irradiated in an imaging area of the line scan imaging system 60;
[0104] A calibration device 20, the calibration device 20 comprising calibration areas corresponding one to one with the types of light sources in the line scan imaging system 60;
[0105] A determination unit 30, configured to determine the light source type of the light source to be calibrated, and determine a target calibration area from the calibration device 20 according to the light source type;
[0106] An adjustment unit 40, used for adjusting the position of the calibration device 20 so that the target calibration area is located within the imaging area;
[0107] The execution unit 50 is used to obtain the detection image collected by the line scan imaging system 60, and calibrate the light source to be calibrated based on the detection image.
[0108] Please refer to Figures 1 to 3 In this embodiment, the light source includes a coaxial light source 11, a first inclined light source 12 and a second inclined light source 13; wherein the angle between the emitted light of the second inclined light source 13 and the horizontal line is greater than the angle between the emitted light of the first inclined light source 12 and the horizontal line, that is, the first inclined light source 12 is a high-angle light source in this embodiment, and the second inclined light source 13 is a low-angle light source in this embodiment.
[0109] In order to achieve the calibration purpose, the present embodiment provides a calibration device 20, which includes calibration areas corresponding to the types of light sources, specifically: a coaxial calibration area 22 corresponding to the coaxial light source 11, a first angle calibration area 23 corresponding to the first inclined light source 12, and a second angle calibration area 24 corresponding to the second inclined light source 13, and the surface of each calibration area is a high-reflection surface.
[0110] Among them, the coaxial calibration area 22 is provided with an arc-shaped protrusion in the shape of an elongated strip, and the cross-section of the arc-shaped protrusion is an arc-shaped curved surface; the first angle calibration area 23 and the second angle calibration area 24 respectively include at least one arc-shaped base member, the arc-shaped base member is in the shape of an elongated strip, and includes two arc-shaped side portions, the two arc-shaped side portions are symmetrically arranged and connected to each other, and the cross-section of the arc-shaped side portion is an arc-shaped curved surface.
[0111] Specifically, the determination unit 30 is used to determine the light source type of the light source to be calibrated, such as whether the light source to be calibrated is a coaxial light source 11 or an inclined light source, etc.; when the light source to be calibrated includes multiple inclined light sources, they can be divided into high-angle light sources and low-angle light sources according to the degree of inclination of the inclined light sources. During calibration, it is necessary to determine whether the light source currently to be calibrated is a high-angle light source or a low-angle light source, so as to determine the target calibration area from the calibration device 20.
[0112] The adjustment unit 40 is used to adjust the position of the calibration device 20 based on the determined light source type of the light source to be calibrated, so that the light source to be calibrated can illuminate the target calibration area of the calibration device 20, so that the line scan imaging system 60 can image the imaging area under the illumination environment.
[0113] It is understandable that the position adjustment of the calibration device 20 can be achieved by driving a driving member, such as a cylinder or a servo motor.
[0114] The execution unit 50 collects a detection image of the target calibration area under the illumination of the target calibration area of the light source to be calibrated, and uses the image as a basis to calibrate the light source to be calibrated.
[0115] Specifically, the execution unit 50 is used to:
[0116] Obtain the distribution of light spots in the detection image;
[0117] The illumination angle of the light source to be calibrated is calibrated based on the light spot distribution until the light spots in the detection image present a sinusoidal distribution.
[0118] Whether it is a coaxial light source 11 or an inclined light source, the illumination angle can be detected by detecting the distribution of light spots in the image, and the illumination angle of the light source to be calibrated can be adjusted according to the distribution of light spots until the light spots in the detected image show a sinusoidal distribution. The illumination angle of the light source to be calibrated meets the requirements, and the adjustment of the illumination angle of the light source to be calibrated can be completed at this time.
[0119] Specifically, the execution unit 50 is further used for:
[0120] Obtain the brightness distribution of the detection image;
[0121] Based on the brightness distribution, the light source is adjusted in different zones until the brightness of the detected image is evenly distributed.
[0122] The execution unit 50 can adjust the partition illumination parameters of the coaxial light source 11, specifically based on the brightness distribution of the detection image as the basis for adjusting the light source partition. For example, if the brightness of the edge position in the detection image is different from that of other positions, the edge area of the calibration light source is calibrated; based on this, each partition of the calibration light source is calibrated until the brightness of the detection image is evenly distributed.
[0123] Furthermore, the execution unit 50 is further configured to:
[0124] Get the gray value area of the detection image;
[0125] The gray value area is compared with a preset standard area range, and the first angle parameter of the light source to be calibrated is calibrated according to the comparison result until the gray value area of the detected image matches the preset standard area range.
[0126] For the coaxial light source 11, the first angle parameter is the light cone angle; for the inclined light source, the first angle parameter is the divergence angle.
[0127] Taking an inclined light source as an example, when the divergence angle of the light source is small, the grayscale value area of the detected image is small; when the divergence angle of the light source is large, the grayscale value area of the detected image is large. It can be understood that the divergence angle threshold used to distinguish whether the divergence angle of the light source is large or small can be set according to actual conditions.
[0128] Furthermore, the execution unit 50 is further configured to:
[0129] Obtain the gray value distribution of the detection image;
[0130] The second angle parameter of the light source to be calibrated is calibrated based on the grayscale value distribution until the grayscale distribution of the detected image presents a Gaussian distribution.
[0131] Among them, for the inclined light source, the second angle parameter is the divergence angle; the divergence angle of the inclined light source is calibrated based on the grayscale value distribution of the detection image. When the grayscale distribution of the detection image finally collected presents a Gaussian distribution, it means that the divergence angle of the inclined light source meets the working requirements.
[0132] It can be understood that after calibrating each partition of the light source to be calibrated until the brightness of the detection image is evenly distributed, the execution unit 50 can also perform flat field correction on the camera in the line scan imaging system 60 based on the grayscale value distribution of the detection image to achieve camera calibration, which is beneficial to ensure the accuracy of the calibration result.
[0133] Furthermore, if Fig. 9 As shown in the figure, the left side is the local structure of the second angle calibration area 24, and the right side is the local structure of the first angle calibration area 23; the arc-shaped base members in the first angle calibration area 23 and the second angle calibration area 24 both include two arc-shaped side portions, the two arc-shaped side portions are symmetrically arranged and connected to each other, and the cross-section of the arc-shaped side portions is an arc-shaped curved surface; wherein the arc-shaped side portion in the arc-shaped base member can be regarded as consisting of an arc-shaped base A with an inclined surface, and an arc surface B located on the arc-shaped base; in the first angle calibration area 23, the angle θ1 between the arc-shaped base A of the arc-shaped side portion and the horizontal line is positively correlated with the target illumination angle α1 of the first inclined light source 12; in the second angle calibration area 24, the angle between the arc-shaped base θ2 of the arc-shaped side portion and the horizontal line is positively correlated with the target illumination angle α2 of the second inclined light source 13.
[0134] Specifically, the relationship between θ1 and α1, and between θ2 and α2 is as follows:
[0135] θ1=1 / 2α1;
[0136] θ2=1 / 2α2.
[0137] Therefore, in this embodiment, the inclination angle of the arc base in the arc base member relative to the horizontal line can also be determined according to the type of light source to be calibrated, so that the current illumination angle of the light source can be detected and calibrated during the calibration process.
[0138] Taking the first inclined light source 12 and the first angle calibration area 23 as an example, specifically, in step S3, a standard reference image is pre-set, and the standard reference image is obtained by the first inclined light source 12 illuminating the first angle calibration area 23 at the target illumination angle; during the calibration process, the detection image is compared with the standard reference image to determine whether the current illumination angle of the first inclined light source 12 meets the requirements, and the illumination angle of the first inclined light source 12 is calibrated according to the comparison result.
[0139] In addition, in the first angle calibration area 23 and the second angle calibration area 24, under certain conditions, such as when the height of the arc-shaped side portion remains unchanged, the smaller the radius of the cross-section of the arc-shaped side portion, the more the grayscale value distribution of the detected image tends to be Gaussian distribution; in this embodiment, in the first angle calibration area 23, the radius of the cross-section of the arc-shaped side portion ranges from 4 to 20 mm; in the second angle calibration area 24, the radius of the cross-section of the arc-shaped side portion ranges from 0.5 to 4 mm.
[0140] Please refer again Figure 2 , 3 In this embodiment, the calibration device 20 also includes a focusing area 21, which is used to test the field of view and working distance of the line scan imaging system 60; specifically, a Siemens star test pattern is provided in the focusing area 21, and a size scale is provided; by detecting the resolution of the detection image obtained in step S3, and adjusting the field of view and working distance of the line scan imaging system 60 based on the detection result, until the resolution of the detection image in the detection image reaches the requirement, then the field of view and working distance of the line scan imaging system 60 meet the working requirements.
[0141] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A light source calibration method based on a line scan imaging system, for calibrating a light source, wherein the light source is irradiated in an imaging area of the line scan imaging system; It is characterized in that A calibration device is provided, the calibration device comprising calibration areas corresponding one to one with the types of the light sources; the calibration method comprises: Determining a light source type of the light source to be calibrated, and determining a target calibration area from the calibration device according to the light source type; Adjusting the position of the calibration device so that the target calibration area is located within the imaging area; Acquire a detection image captured by the line scan imaging system, and calibrate the light source to be calibrated based on the detection image; The light source comprises a coaxial light source, and the calibration device comprises a coaxial calibration area corresponding to the coaxial light source; The coaxial calibration area is provided with an arc-shaped protrusion in the form of a long strip, and the cross section of the arc-shaped protrusion is an arc-shaped curved surface; The light source further comprises a first inclined light source and a second inclined light source, wherein the angle between the emitted light of the second inclined light source and the horizontal line is greater than the angle between the emitted light of the first inclined light source and the horizontal line; The calibration device comprises a first angle calibration area corresponding to the first inclined light source, and a second angle calibration area corresponding to the second inclined light source, wherein the first angle calibration area and the second angle calibration area respectively comprise at least one arc-shaped base member, and the arc-shaped base member is in a strip shape; The arc-shaped base member comprises two arc-shaped side portions, the two arc-shaped side portions are symmetrically arranged, and the cross section of the arc-shaped side portion is an arc-shaped curved surface; In the first angle calibration area, the angle θ1 between the arc base of the arc side portion and the horizontal line is positively correlated with the target illumination angle α1 of the first inclined light source, and θ1=1 / 2α1; In the second angle calibration area, an angle θ2 between the arc base of the arc side portion and the horizontal line is positively correlated with a target illumination angle α2 of the second oblique light source, and θ2=1 / 2α2.
2. The light source calibration method based on the line scan imaging system according to claim 1, It is characterized in that The acquiring the detection image acquired by the line scan imaging system and calibrating the light source to be calibrated based on the detection image includes: Obtaining the distribution of light spots in the detection image; The illumination angle of the light source to be calibrated is calibrated based on the light spot distribution until the light spots in the detection image present a sinusoidal distribution.
3. The light source calibration method based on the line scan imaging system according to claim 1, It is characterized in that The light source includes a plurality of illumination areas; The acquiring the detection image acquired by the line scan imaging system and calibrating the light source to be calibrated based on the detection image includes: Obtaining brightness distribution of the detection image; Based on the brightness distribution, the light source is adjusted by partition until the brightness of the detection image is evenly distributed.
4. The light source calibration method based on the line scan imaging system according to claim 1, It is characterized in that The acquiring the detection image acquired by the line scan imaging system and calibrating the light source to be calibrated based on the detection image includes: Acquire the grayscale value area of the detection image; Comparing the grayscale value area with a preset standard area range, and calibrating the first angle parameter of the light source to be calibrated according to the comparison result until the grayscale value area of the detection image matches the preset standard area range; The first angle parameter is the light cone angle of the coaxial light source, or the divergence angle of the first inclined light source and / or the second inclined light source.
5. The light source calibration method based on the line scan imaging system according to claim 1, It is characterized in that The acquiring the detection image acquired by the line scan imaging system and calibrating the light source to be calibrated based on the detection image includes: Obtaining the grayscale value distribution of the detection image; Calibrating the second angle parameter of the light source to be calibrated based on the grayscale value distribution until the grayscale distribution of the detection image presents a Gaussian distribution; The second angle parameter is a divergence angle of the first inclined light source and / or the second inclined light source.
6. A light source calibration system based on a line scan imaging system, It is characterized in that Used to implement the light source calibration method based on the line scan imaging system according to any one of claims 1 to 5, so as to calibrate the light source; the calibration system comprises: A line scan imaging system, wherein the light source is irradiated in an imaging area of the line scan imaging system; A calibration device, the calibration device comprising calibration areas corresponding one to one with the types of light sources in the line scan imaging system; a determination unit, configured to determine a light source type of the light source to be calibrated, and determine a target calibration area from the calibration device according to the light source type; an adjusting unit, used for adjusting the position of the calibration device so that the target calibration area is located within the imaging area; An execution unit, configured to obtain a detection image acquired by the line scan imaging system, and calibrate the light source to be calibrated based on the detection image; The light source comprises a coaxial light source, a first inclined light source and a second inclined light source, wherein the angle between the emitted light of the second inclined light source and the horizontal line is greater than the angle between the emitted light of the first inclined light source and the horizontal line; The calibration device comprises a coaxial calibration area corresponding to the coaxial light source, a first angle calibration area corresponding to the first oblique light source, and a second angle calibration area corresponding to the second oblique light source; The coaxial calibration area is provided with an arc-shaped protrusion in the form of a long strip, and the cross section of the arc-shaped protrusion is an arc-shaped curved surface; The first angle calibration area and the second angle calibration area respectively include at least one arc-shaped base member, and the arc-shaped base member is in the shape of an elongated strip; the arc-shaped base member includes two arc-shaped side portions, and the two arc-shaped side portions are symmetrically arranged, and the cross section of the arc-shaped side portion is an arc-shaped curved surface; In the first angle calibration area, the angle θ1 between the arc base of the arc side portion and the horizontal line is positively correlated with the target illumination angle α1 of the first inclined light source, and θ1=1 / 2α1; in the second angle calibration area, the angle θ2 between the arc base of the arc side portion and the horizontal line is positively correlated with the target illumination angle α2 of the second inclined light source, and θ2=1 / 2α2.
Citation Information
Patent Citations
And image acquisition system is used for detecting defects of transparent substrate
CN208984513U
Device and method for measuring a surface topography, and calibration method
CN109416245A
3D arc-shaped surface defect detection method based on differential image analysis
CN112033965A