CN115424008A - Method and system for detecting light modulation and focusing of laser projector production line - Google Patents

Method and system for detecting light modulation and focusing of laser projector production line Download PDF

Info

Publication number
CN115424008A
CN115424008A CN202211084796.4A CN202211084796A CN115424008A CN 115424008 A CN115424008 A CN 115424008A CN 202211084796 A CN202211084796 A CN 202211084796A CN 115424008 A CN115424008 A CN 115424008A
Authority
CN
China
Prior art keywords
light spot
image
fitting
grid
ellipse
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211084796.4A
Other languages
Chinese (zh)
Inventor
李文兴
郭永生
赵鑫
于振中
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
HRG International Institute for Research and Innovation
Original Assignee
HRG International Institute for Research and Innovation
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by HRG International Institute for Research and Innovation filed Critical HRG International Institute for Research and Innovation
Priority to CN202211084796.4A priority Critical patent/CN115424008A/en
Publication of CN115424008A publication Critical patent/CN115424008A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/24Measuring arrangements characterised by the use of optical techniques for measuring contours or curvatures
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/28Measuring arrangements characterised by the use of optical techniques for measuring areas
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01MTESTING STATIC OR DYNAMIC BALANCE OF MACHINES OR STRUCTURES; TESTING OF STRUCTURES OR APPARATUS, NOT OTHERWISE PROVIDED FOR
    • G01M11/00Testing of optical apparatus; Testing structures by optical methods not otherwise provided for
    • G01M11/02Testing optical properties
    • G01M11/0242Testing optical properties by measuring geometrical properties or aberrations
    • G01M11/0257Testing optical properties by measuring geometrical properties or aberrations by analyzing the image formed by the object to be tested
    • G01M11/0264Testing optical properties by measuring geometrical properties or aberrations by analyzing the image formed by the object to be tested by using targets or reference patterns
    • GPHYSICS
    • G02OPTICS
    • G02BOPTICAL ELEMENTS, SYSTEMS OR APPARATUS
    • G02B27/00Optical systems or apparatus not provided for by any of the groups G02B1/00 - G02B26/00, G02B30/00
    • G02B27/0012Optical design, e.g. procedures, algorithms, optimisation routines
    • GPHYSICS
    • G03PHOTOGRAPHY; CINEMATOGRAPHY; ANALOGOUS TECHNIQUES USING WAVES OTHER THAN OPTICAL WAVES; ELECTROGRAPHY; HOLOGRAPHY
    • G03BAPPARATUS OR ARRANGEMENTS FOR TAKING PHOTOGRAPHS OR FOR PROJECTING OR VIEWING THEM; APPARATUS OR ARRANGEMENTS EMPLOYING ANALOGOUS TECHNIQUES USING WAVES OTHER THAN OPTICAL WAVES; ACCESSORIES THEREFOR
    • G03B21/00Projectors or projection-type viewers; Accessories therefor
    • G03B21/14Details
    • G03B21/142Adjusting of projection optics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/28Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/36Applying a local operator, i.e. means to operate on image points situated in the vicinity of a given point; Non-linear local filtering operations, e.g. median filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/42Global feature extraction by analysis of the whole pattern, e.g. using frequency domain transformations or autocorrelation
    • G06V10/422Global feature extraction by analysis of the whole pattern, e.g. using frequency domain transformations or autocorrelation for representing the structure of the pattern or shape of an object therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Optics & Photonics (AREA)
  • Nonlinear Science (AREA)
  • Geometry (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a method and a system for detecting the dimming focus of a laser projector production line, wherein the method comprises the following steps: s1, image preprocessing is carried out by utilizing Gaussian fuzzy filtering, edge detection, contour discovery and ellipse fitting operations; s2, utilizing edge protection filtering, gaussian curve fitting, binarization processing and ellipse fitting operation to identify the light spots; s3, calculating the size and the gray level of the light spot to complete light spot check; s1', carrying out grid image adjusting pretreatment by utilizing Dajin binarization, outline discovery, minimum external rectangle and image interception operation; and S2', finishing grid check through image interception, calculation and check of grid gray. The invention solves the technical problems that the light spot boundary is difficult to accurately identify, the width of the grid line is difficult to quantize and the like, improves the efficiency and yield of the light-adjusting focusing process, saves the labor cost and brings economic benefits to customers.

Description

Method and system for detecting light modulation and focusing of laser projector production line
Technical Field
The invention relates to the field of laser projectors and machine vision, in particular to a method and a system for detecting the dimming and focusing of a laser projector production line.
Background
In 4 months of 2022, IDC published the "Chinese projector market tracking report in the fourth quarter of 2021". Wherein, in 2021 year China projector market is on the same year increased 12.6%, total shipment is more as high as 470 ten thousand, and the sales volume has broken through 214 hundred million RMB, on the same year increased 15.5%. And IDC also predicts that the market sales of Chinese projectors is expected to exceed 560 ten thousand in 2022, intelligent projection becomes a powerful opponent of the traditional television in the future, and the total amount of 700 thousand in 2023.
Through investigation, the existing laser projector production lines all use a lot of manual work to process the procedures of adjusting facula, adjusting focus and the like, each worker needs to work for 10 hours a day, and the misjudgment rate is high due to visual fatigue and the like. Taking a certain factory data as an example, the light spot adjusting process has a yield of only 85% on average, and the focusing process has a yield of 90% on average. The light spot adjusting environment is a fixed scene, and light interference is small. The process is that the size of the light spot is firstly adjusted, and the size of the light spot is close to the standard circle as much as possible in the debugging process due to the fact that the standard circle is used as a reference in the background image, and a certain error is allowed. Taking the requirement of a certain production line as an example, the spot size needs to meet 140 +/-5 mm. In addition, on the premise of meeting the size of the light spot, the clear edge of the light spot image is ensured. However, as workers work for 10 hours a day, quality problems such as unqualified spot size and unclear spot edge often occur due to visual fatigue and the like.
The focusing environment is a dark light environment, and the background is dark except that the projected grid is bright. The process is that the grid projection is clear through focusing, and the width of the grid lines is as thin as possible. But because no unified standard exists, quantitative reference indexes cannot be given in real time in the debugging process, and therefore, the product quality debugged by different operators is different. In addition, the factory management faces the problems of difficult recruitment, difficult training, difficult employee leave-asking, difficult staff leave-management, high labor cost and the like. Therefore, automation at key stations is required as soon as possible to improve the automation level of the whole production line.
The prior invention patent application document CN108803209a, "a laser control projector system, a control method, and an information processing terminal", wherein the laser control projector system includes: the device comprises a light source module, a parameter configuration module, a central control module, a collimation processing module, a homogenization processing module, a focusing processing module, an image correction module and a projection module. It can be known from the embodiments of the prior art that the prior art only solves the problem of distortion of image pixels by adjusting the pixel laser emitting angle according to the relationship between the driving current value of the projection device and the brightness value of the light source and the target color temperature value, but the prior art still cannot solve the defect that the light spot boundary in the prior art is difficult to accurately identify, and the prior art only adjusts the color temperature and the laser emitting angle and cannot quantize the grid width.
The prior invention patent application document with publication number CN114487115A, namely a Canny operator and ultrasonic plane wave imaging combined high-resolution defect nondestructive testing method, comprises the steps of 1: transmitting plane waves to a workpiece to be detected by utilizing ultrasonic coherence, and receiving echo data of random noise in a filtered signal; step 2: performing full-focus imaging on the echo data in the step 1 by utilizing a DMAS algorithm; and step 3: performing edge detection on the imaging graph of the full-focus imaging in the step 2 by using the defects of a Canny operator; and 4, step 4: and (4) based on the defect edge detection in the step (3), performing fine scanning on the obtained defects in a point-by-point focusing mode. Although Canny operator is adopted to detect the defect edge in the prior art, the prior art is applied to ultrasonic plane imaging, and a specific implementation logic of the prior art shows that although the prior scheme establishes and uses an imaging plane grid center matrix according to parameters such as grid division quantity, direction and the like, the prior art mainly aims at detecting the damage position and the edge in the ultrasonic plane imaging and cannot be directly used for solving the problem that the spot boundary in the laser imaging is difficult to accurately identify and the grid quantization problem. Meanwhile, in the prior art, before the Canny operator is suitable for detecting the edge of the defective image, the DMAS algorithm is required to be adopted for full focus imaging, the Canny operator cannot be directly processed on the pre-processed and filtered image, the pre-processing process is complicated, the robustness of the algorithm realized by the conventional scheme is reduced, and the operation efficiency is also limited.
In conclusion, the technical problems that the light spot boundary is difficult to accurately identify, the width of the grid line is difficult to quantize and the like exist in the prior art, the efficiency and the yield of the dimming focusing process are improved, the labor cost is saved, and economic benefits are brought to customers.
Disclosure of Invention
The invention solves the technical problems of difficult accurate identification of light spot boundaries, difficult width quantization of grid lines and the like in the prior art, improves the efficiency and yield of the dimming focusing process, saves the labor cost and brings economic benefits to customers.
The invention adopts the following technical scheme to solve the technical problems: the method for detecting the dimming and focusing of the laser projector production line comprises the following steps:
the light modulation spot processing method comprises the following steps:
s1, filtering an original image by using a Gaussian fuzzy filtering method, acquiring an image edge contour by using a Canny edge detection method, detecting and acquiring a standard circular contour according to the contour discovery and ellipse fitting operation, fitting a first minimum external rectangle according to the standard circular contour, intercepting the original image according to a first rectangle parameter of the first minimum external rectangle to obtain a first region of interest, and finishing image preprocessing according to the first minimum external rectangle parameter;
s2, filtering the first region of interest by using an edge protection filtering method, finding an adaptive threshold by using a Gaussian curve fitting method, finding a spot boundary, obtaining an image edge profile by using a Canny edge detection method, performing profile finding and ellipse fitting operation to obtain spot ellipse fitting parameters, and performing spot identification to obtain a spot identification result;
s3, calculating the ratio of the fitting elliptical area of the identified light spot to the fitting elliptical area of the standard circle according to the light spot identification result, and checking whether the size of the light spot in the light spot identification result meets a preset standard or not according to a preset light spot size threshold;
s4, processing the first region of interest to obtain at least 2 Gaussian distributions, calculating a pixel value corresponding to the minimum value among the Gaussian distributions, distinguishing whether the light spot edge is clear according to a preset light spot clear threshold value, calculating a light spot edge gray value, and distinguishing whether the light spot gray accords with a preset standard according to a preset light spot gray threshold value;
the focusing method comprises the following steps:
s1', an image preprocessing stage, namely performing Dajin binarization processing on an original image to obtain a binarized image, performing expansion processing on the binarized image to find a grid outline, fitting a second minimum circumscribed rectangle of the grid outline, and intercepting and processing the binarized image according to a second rectangle parameter of the second minimum circumscribed rectangle to obtain a second region of interest so as to obtain a focusing preprocessing image;
s2', a grid checking stage, namely calculating the average gray value of the focusing preprocessed image, and distinguishing whether the grid meets a preset standard according to a preset grid distinguishing threshold.
The invention solves the problem that the light spot boundary is difficult to accurately identify. The problem that the width of the grid lines is difficult to quantify is solved through image preprocessing and grid verification. The efficiency and the yields of focusing technology of adjusting luminance have been improved, have saved the human cost, have brought economic benefits for the customer. The machine vision-based laser projector dimming focusing detection method based on the machine vision performs dimming focusing detection on the laser projector, has the advantages of high yield, reduction of rework working hours, labor cost saving and the like, and is an important guarantee for enterprises to improve production efficiency and improve self competitiveness.
In a more specific technical solution, step S1 includes:
s11, fitting a first minimum circumscribed rectangle of the standard circle profile;
s12, obtaining the coordinates of the center point and the width and height parameters of the first minimum circumscribed rectangle, and amplifying the width and height of the rectangle according to the coordinates;
s13, intercepting a first region of interest containing a standard circle from the original image.
In a more specific technical solution, step S2 includes:
s21, detecting an image edge contour by a Canny edge detection method, and performing morphological closing operation on the image edge contour;
s22, finding all peripheral contours according to an image edge contour finding method, and processing the peripheral contours according to the contour area in a descending order;
s23, traversing the peripheral outline, carrying out ellipse fitting processing on the peripheral outline to obtain a fitting ellipse, and filtering according to the major axis and the minor axis of the fitting ellipse to find out the spot ellipse fitting parameters.
In a more specific technical solution, step S2 further includes:
s201, performing channel separation on the ROI subjected to edge protection filtering to obtain a green channel;
s202, counting the number of pixels of each pixel value to carry out moving average filtering on the number of the pixels so as to obtain pixel Gaussian distribution;
s203, intercepting low-pixel-value Gaussian distribution data according to the Gaussian distribution of the pixels, performing Gaussian curve fitting to obtain the mean value and the standard deviation of a Gaussian curve, and processing to obtain an adaptive threshold value;
and S204, traversing the green channel, and processing each pixel value of the green channel to obtain the spot boundary.
The method aims at solving the problem that the real boundary of the light spot is difficult to accurately identify in the actual light spot dimming process, so that the yield of the product is influenced. The invention adopts a channel separation and Gaussian curve fitting method, firstly obtains a green channel, then counts the number of each pixel value, and finds that the pixel value at the edge of the facula accords with Gaussian distribution.
In a more specific embodiment, in step S202, the pixel gaussian distribution is represented by the following logic:
Figure BDA0003835045350000041
where f (x) represents a Gaussian distribution, μ is the mean of the Gaussian curve, and δ is the standard deviation.
In a more specific technical solution, in step S203, the adaptive threshold is obtained by using the following logic processing:
threshold=μ+3*δ。
in a more specific technical solution, in step S204, each pixel value of the green channel is processed with the following logic to obtain a light spot boundary:
Figure BDA0003835045350000042
where x, y are the row index and column index of the pixel.
According to the invention, the moving average value of the data is filtered, and then Gaussian curve fitting is carried out on the data to obtain the Gaussian distribution average value and standard deviation parameters of the pixel value of the light spot edge, and the binary threshold value is found by the method, so that the light spot boundary is found.
In a more specific technical solution, step S4 includes:
s41, calculating 4 intersection points of the ellipse and a straight line passing through the center of the ellipse and having a slope of positive 1 and negative 1 according to the ellipse parameters fitted by the standard circle;
s42, selecting a region in the ellipse respectively, calculating the average gray value of 4 regions, and checking whether the gray value of the light spot meets the preset standard or not according to the average gray value.
In a more specific technical solution, in step S42, it is verified whether the light spot gray scale meets a preset standard according to the following logic:
S=π*a*b
Figure BDA0003835045350000051
wherein score is the similarity score between the facula and the standard circle, S gt Fitting an elliptical area, S, to a standard circle dt And fitting the elliptical area for the light spot, wherein a and b are respectively the major axis and the minor axis of the ellipse.
Aiming at the problem that the grid width is difficult to quantize in focusing adjustment, the method converts the problem into the problem of solving the gray value of the grid area. And (4) carrying out binarization processing on the picture by a Dajin binarization method to obtain a binarized picture, wherein the grid is white and the background is black. The wider the line width of the grid, the larger the grey value of the whole picture. According to the actual condition of a production line, after a reasonable threshold value is set, the accuracy of qualified focusing distinguishing is improved.
In a more specific technical solution, a laser projector production line dimming focus detection system includes:
the light spot adjusting module comprises:
the light-adjusting spot image preprocessing module is used for filtering an original image by a Gaussian fuzzy filtering method, acquiring an image edge outline by a Canny edge detection method, carrying out outline discovery and ellipse fitting operation according to the image edge outline to detect and acquire a standard circular outline, fitting a first minimum external rectangle according to the standard circular outline, intercepting the original image according to a first rectangle parameter of the first minimum external rectangle to acquire a first region of interest, and finishing image preprocessing according to the first minimum external rectangle parameter;
the light spot identification module is used for filtering the first region of interest by using an edge protection filtering method, finding a self-adaptive threshold value by using a Gaussian curve fitting method, finding a light spot boundary, obtaining an image edge profile by using a Canny edge detection method, carrying out profile discovery and ellipse fitting operation to obtain light spot ellipse fitting parameters, carrying out light spot identification to obtain a light spot identification result, and connecting the light spot identification module with the light dimming spot image preprocessing module;
the light spot distinguishing module is used for calculating the ratio of the fitting elliptical area of the identified light spot to the fitting elliptical area of the standard circle according to the light spot identification result, verifying whether the size of the light spot in the light spot identification result meets a preset standard or not according to a preset light spot size threshold value, and is connected with the light spot identification module;
the light spot gray level resolution module is used for processing according to the first region of interest to obtain at least 2 Gaussian distributions, calculating a pixel value corresponding to the minimum value among the Gaussian distributions, distinguishing whether the light spot edge is clear according to a preset light spot clear threshold value, calculating the gray level of the light spot edge, distinguishing whether the light spot gray level meets a preset standard according to the preset light spot gray level threshold value, and is connected with the light dimming spot image preprocessing module and the light spot identification module;
the focusing module includes:
the focusing preprocessing module is used for carrying out binaryzation processing on the original image by using the Dazun to obtain a binaryzation image, carrying out expansion processing on the binaryzation image to find a grid outline, fitting a second minimum external rectangle of the grid outline, intercepting and processing the binaryzation image according to a second rectangle parameter of the second minimum external rectangle to obtain a second region of interest so as to obtain a focusing preprocessing image;
and the grid distinguishing module is used for calculating the average gray value of the focusing pretreatment image, verifying whether the grid meets the preset standard according to a preset grid distinguishing threshold value, and is connected with the focusing pretreatment module.
Compared with the prior art, the invention has the following advantages: the invention solves the problems that the light spot boundary is difficult to accurately identify, the grid line width is difficult to quantify and the like. The efficiency and the yields of focusing technology of adjusting luminance have been improved, have saved the human cost, have brought economic benefits for the customer. The machine vision-based laser projector dimming focusing detection method based on the machine vision performs dimming focusing detection on the laser projector, has the advantages of high yield, reduction of rework working hours, labor cost saving and the like, and is an important guarantee for enterprises to improve production efficiency and improve self competitiveness.
The method aims at solving the problem that the real boundary of the light spot is difficult to accurately identify in the actual light spot dimming process, so that the yield of products is influenced. The invention adopts a channel separation and Gaussian curve fitting method, firstly obtains a green channel, then counts the number of each pixel value, and finds that the pixel value at the edge of the facula accords with Gaussian distribution.
According to the invention, after moving mean filtering is carried out on data, gaussian curve fitting is carried out on the data, gaussian distribution mean values and standard deviation parameters of spot edge pixel values are obtained, and a binary threshold value is found through the method, so that the spot boundary is found.
Aiming at the problem that the grid width is difficult to quantize in focusing adjustment, the method converts the problem into the problem of solving the gray value of the grid area. And (4) carrying out binarization processing on the picture by a Dajin binarization method to obtain a binarized picture, wherein the grid is white and the background is black. The wider the line width of the grid, the larger the grey value of the whole picture. According to the actual condition of a production line, after a reasonable threshold value is set, the accuracy of qualified focusing discrimination is improved.
The invention solves the technical problems of difficult accurate identification of light spot boundaries, difficult width quantization of grid lines and the like in the prior art, improves the efficiency and yield of the dimming focusing process, saves the labor cost and brings economic benefits to customers.
Drawings
Fig. 1 is a schematic diagram illustrating basic steps of a method for detecting the production line dimming focus of a laser projector according to embodiment 1 of the present invention;
FIG. 2 is a schematic diagram of detailed steps of image preprocessing in the process of processing the light-dimming spots in embodiment 1 of the present invention
FIG. 3 is an original diagram of light spot detection according to embodiment 1 of the present invention;
FIG. 4 is a diagram illustrating the edge contour effect of an image according to embodiment 1 of the present invention;
FIG. 5 is a graph of the effect of fitting an ellipse according to example 1 of the present invention;
fig. 6 is a schematic diagram of a specific step of spot identification in embodiment 1 of the present invention;
FIG. 7 is a statistical distribution diagram of the number of green channel pixel values according to embodiment 1 of the present invention;
FIG. 8 is a graph showing the effect of Gaussian curve fitting in example 1 of the present invention;
FIG. 9 is a diagram illustrating the effect of the binarization processing in embodiment 1 of the present invention;
FIG. 10 is a diagram showing the actual effect of ellipse fitting in example 1 of the present invention;
fig. 11 is a schematic diagram of a specific step of light spot verification in embodiment 1 of the present invention;
FIG. 12 is a schematic diagram showing the detailed steps of image preprocessing in the focusing process according to embodiment 1 of the present invention;
FIG. 13 is a diagram showing a focus detection primitive in embodiment 1 of the present invention;
FIG. 14 is a diagram illustrating specific steps of grid verification in embodiment 1 of the present invention;
FIG. 15 is a diagram of ROI interception to be detected according to embodiment 1 of the present invention;
fig. 16 is a graph showing the result of the grid verification in embodiment 1 of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the embodiments of the present invention, and it is obvious that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1
As shown in fig. 1, the method for detecting the on-line dimming focus of the laser projector according to the present invention includes the following steps:
s1, image preprocessing is carried out by utilizing Gaussian fuzzy filtering, edge detection, contour discovery and ellipse fitting operations;
as shown in fig. 2, in this embodiment, step S1 further includes the following specific steps:
s11, in the image preprocessing stage, filtering an original image by a Gaussian blur filtering method, and acquiring an image edge profile by an edge detection method;
s12, detecting a standard circular contour by a contour finding and ellipse fitting method;
and S13, intercepting the original picture according to the outline of the standard circle, so as to obtain the region of interest.
In this embodiment, the ellipse fitting method for a standard circle in an image preprocessing stage is characterized in that: detecting the edge contour of the picture by a Canny edge detection method, and performing morphological closing operation on the edge contour; finding all peripheral contours by a contour finding method, and performing descending on the contours according to the area of the contours; traversing the outline, carrying out ellipse fitting on the outline, filtering according to the long axis and the short axis of the fitting ellipse and rules, and finding out fitting parameters of the standard circle.
In this embodiment, the image capturing method in the image preprocessing stage is characterized in that: and fitting the minimum circumscribed rectangle of the outline of the standard circle, acquiring the coordinates of the central point and the width and height parameters of the rectangle, amplifying the width and height of the rectangle, and intercepting the ROI containing the standard circle from the original image.
As shown in fig. 3, in the present embodiment, the original image is filtered by a gaussian blur filtering method, where the gaussian kernel parameter is (3,3). The image edge contour is obtained by a Canny edge detection method, wherein the threshold1 parameter is 80, and the threshold2 parameter is 160.
As shown in fig. 4, an image edge contour image is acquired by a morphological closing operation. In the embodiment, all peripheral contours are found by a contour finding method, and the contours are subjected to descending order according to the area of the contours; and traversing the outline and carrying out ellipse fitting on the outline. Ellipse fitting is used here, the main reason being that the imaging of a standard circle is an ellipse due to the camera view angle. And filtering according to the major axis a and the minor axis b of the fitting ellipse according to rules to find the ellipse fitting parameters of the standard circle. The rule is that the lengths of the long axis and the short axis are in a specific range, the ratio of the long axis to the short axis also meets the specific range, and the specific numerical value needs to be adjusted according to the condition of a production line.
As shown in fig. 5, the minimum circumscribed rectangle of the standard circle outline is fitted, parameters such as the center coordinates (cx, cy), width (width), height (height) and the like of the rectangle are obtained, and the width and height of the rectangle are enlarged and intercepted. Namely, taking (cx, cy) as the center, obtaining rectangles of N width and M height, wherein N and M are larger than 1. And cutting the ROI including the standard circle from the original image according to the rectangle. The red line in fig. 4 is marked as the fitting ellipse result of the standard circle.
S2, performing light spot identification by using edge protection filtering, gaussian curve fitting, binarization processing and ellipse fitting operation;
as shown in fig. 6, in this embodiment, the step S2 further includes the following specific steps:
s21, in a light spot identification stage, filtering the ROI by an edge protection filtering method;
s22, finding a self-adaptive threshold value through a Gaussian curve fitting method, and accurately finding a light spot boundary according to the self-adaptive threshold value;
s23, an image edge contour can be obtained through an edge detection method, and light spot ellipse fitting parameters can be obtained through contour discovery and an ellipse fitting method.
In this embodiment, the gaussian curve fitting method in the light spot identification stage is characterized in that: performing channel separation on the ROI subjected to edge protection filtering to obtain a green channel, and counting the number of pixels of each pixel value; and after moving mean filtering is carried out on the number of pixels, gaussian curve fitting is carried out on the data to obtain the mean value and the standard deviation of the Gaussian curve, and the self-adaptive threshold value can be calculated according to the mean value and the standard deviation.
And in a spot identification stage, filtering the ROI by an edge protection filtering method, wherein the sigma _ s parameter is 100, and the sigma _rparameter is 0.5. The edge protection filtering is mainly used for realizing filtering and simultaneously retaining image edge information.
And finding out a self-adaptive threshold value by a Gaussian curve fitting method, and accurately finding out the boundary of the light spot according to the self-adaptive threshold value. The specific implementation manner of the step is as follows: and performing channel separation on the ROI image, and selecting a green channel because the light spot is green. The number of pixels per pixel value is counted and then a moving average filtering is performed on the number of pixels, wherein the filtering window is set to 15.
As shown in fig. 7, the abscissa in the figure represents the pixel value, and the ordinate represents the corresponding number of pixel values, and it is easy to see that the distribution of the pixel values corresponds to the gaussian distribution.
Figure BDA0003835045350000091
As shown in fig. 8, gaussian distribution data with a low pixel value is clipped, and gaussian curve fitting is performed on the data. Obtaining the mean value mu and the standard deviation delta of the Gaussian curve, and calculating the binary adaptive threshold value threshold as
threshold=μ+3*δ
As shown in fig. 9, traversing the green channel, and processing each pixel value according to the following formula, so as to obtain a binarized picture:
Figure BDA0003835045350000092
and (4) acquiring an image edge by a Canny edge detection method, and finding out a light spot peripheral outline by outline discovery.
As shown in fig. 10, ellipse fitting is performed on the light spot profile, and light spot ellipse fitting parameters can be obtained.
And S3, calculating the size and the gray level of the light spot to complete light spot check.
As shown in fig. 11, step S3 further includes the following specific steps:
s31, in a light spot checking stage, calculating the ratio of the fitting elliptical area of the identified light spot to the fitting elliptical area of the standard circle, and judging whether the size of the light spot meets the standard or not by setting a reasonable threshold;
s32, calculating a pixel value corresponding to the minimum value between the two Gaussian distributions, and setting a reasonable threshold value to distinguish whether the light spot edge is fuzzy;
and S33, calculating the gray value of the light spot edge, and distinguishing whether the gray value of the light spot meets the standard or not by setting a reasonable threshold.
In this embodiment, the method for calculating the gray value of the edge of the light spot in the light spot verification stage is characterized in that: and according to the ellipse parameters fitted by the standard circle, calculating 4 intersection points of the ellipse and a straight line passing through the center of the ellipse and having a slope of positive 1 and negative 1, respectively selecting a region in the ellipse, and calculating the average gray value of the 4 regions for verifying whether the gray value of the light spot meets the requirement.
In the light spot checking stage, the fitting elliptical area S of the identified light spot is respectively calculated by the following formula dt Fitting elliptical area S of standard circle gt And a score. Setting a reasonable threshold for score, such as 100 ± 1.5, can distinguish whether the spot size meets the criteria.
S=π*a*b
Figure BDA0003835045350000101
The method for judging whether the light spot edge is clear in the light spot checking stage comprises the following steps: because the clear picture is different from the fuzzy picture in Gaussian distribution, whether the light spot edge is clear or not can be effectively distinguished by calculating the pixel value corresponding to the minimum value between the two Gaussian distributions and setting a reasonable threshold value.
The method for calculating the gray value of the light spot edge in the light spot checking stage comprises the following steps: according to the ellipse parameters fitted by the standard circle, 4 intersection points of the ellipse and a straight line passing through the center of the ellipse and having a slope of positive 1 and negative 1 are calculated, a block of area in the ellipse is respectively selected, the area size is 5*5, and the average gray value of the 4 blocks of pixels is calculated. According to the actual condition of a production line, a reasonable threshold value is set, and whether the light spot gray scale meets the requirement or not can be verified.
The focusing detection method comprises the steps of image preprocessing, grid checking and the like.
As shown in fig. 1, the grid adjusting algorithm involved in the method for detecting the light-adjusting focus of the laser projector according to the present invention further includes the following steps:
s1', carrying out grid image adjusting pretreatment by utilizing Dajin binaryzation, outline discovery, minimum external rectangle and image interception operation;
as shown in fig. 12, in this embodiment, step S1' further includes the following specific steps:
s11', in the image preprocessing stage, carrying out binarization processing on the original image by an Otsu binarization (OSTU) method;
s12', performing expansion operation on the binary image, and finding out a grid contour by a contour finding method;
s13', fitting the minimum external rectangle of the grid outline, and intercepting the binary image according to the rectangle parameters to obtain the ROI.
As shown in fig. 13, the original picture is detected for focus. And in the image preprocessing stage, the original image is converted into a gray image, and the gray image is subjected to binarization processing by a Dajin binarization method. After this treatment, the grid color was white and the background color was black. The binarized image was subjected to a dilation operation with a kernel size of (19,19). The grid outline can be found through the outline finding method, the minimum external rectangle of the grid outline is fitted, the binaryzation picture is intercepted according to the rectangle parameters, and the ROI can be obtained.
And S2', finishing grid check through image interception, calculation and check of grid gray.
As shown in fig. 14, in this embodiment, the step S2' further includes the following specific steps:
s21', in the grid checking stage, in order to prevent edge interference, further intercepting the ROI to obtain a picture to be detected;
s22', calculating the average gray value of the picture to be detected, and distinguishing whether the grids meet the standard or not by setting a reasonable threshold.
As shown in fig. 15, in the grid verification stage, due to the view angle problem, the ROI includes a portion outside the grid region, and is further truncated to prevent edge interference. The interception method comprises the following steps: and (4) intercepting by multiplying the ROI central coordinate by 0.8 respectively according to the width and the height to obtain the picture to be detected.
As shown in fig. 16, the average gray value of the to-be-detected picture is calculated, and a reasonable threshold is set according to the actual situation of the production line, so that whether the grid meets the standard or not can be distinguished.
In this embodiment, the speckle adjusting method includes: image preprocessing, light spot identification, light spot verification and the like. In the image pre-stage, filtering an original image by a Gaussian Blur filtering method (Gaussian Blur Filter), and acquiring an image edge profile by an edge detection method; detecting a standard circular contour by a contour finding and Ellipse Fitting (Ellipse Fitting) method; and fitting the minimum circumscribed rectangle according to the standard circle outline, and intercepting the original picture according to the rectangle parameters to obtain the Region of Interest (Region of Interest). In the light spot identification stage, filtering the ROI by an Edge Preserving filtering method (Edge Preserving Filter); finding an adaptive threshold value by a Gaussian Curve Fitting (Gaussian Curve Fitting) method, and accurately finding a spot boundary according to the adaptive threshold value; the edge contour of the image can be obtained by an edge detection method, and the spot ellipse fitting parameters can be obtained by a contour discovery and ellipse fitting method. In the light spot checking stage, the ratio of the fitting elliptical area of the identified light spot to the fitting elliptical area of the standard circle is calculated, and whether the size of the light spot meets the standard or not can be distinguished by setting a reasonable threshold; calculating a pixel value corresponding to the minimum value between the two Gaussian distributions, and distinguishing whether the light spot edge is clear or not by setting a reasonable threshold; and calculating the gray value of the light spot edge, and setting a reasonable threshold value to distinguish whether the gray value of the light spot meets the standard or not.
The focusing method comprises the following steps: image preprocessing, grid checking and the like. In the image preprocessing stage, the original image is subjected to binarization processing by an Otsu binarization (OSTU) method; performing expansion operation on the binary image to find a grid outline; and fitting the minimum external rectangle of the grid outline, and intercepting the binary image according to the rectangle parameters to obtain the ROI. And in the grid checking stage, the average gray value of the picture is calculated, and whether the grid meets the standard or not can be distinguished by setting a reasonable threshold.
In conclusion, the invention aims at the problem that the real boundary of the light spot is difficult to accurately identify in the actual light spot adjusting process, so that the yield of the product is influenced. The invention adopts a channel separation and Gaussian curve fitting method, firstly obtains a green channel, then counts the number of each pixel value, and finds that the pixel value at the edge of the facula accords with Gaussian distribution.
According to the invention, the moving average value of the data is filtered, and then Gaussian curve fitting is carried out on the data to obtain the Gaussian distribution average value and standard deviation parameters of the pixel value of the light spot edge, and the binary threshold value is found by the method, so that the light spot boundary is found.
Aiming at the problem that the grid width is difficult to quantize in focusing adjustment, the method converts the problem into the problem of solving the gray value of the grid area. And (4) carrying out binarization processing on the picture by a Dajin binarization method to obtain a binarized picture, wherein the grid is white and the background is black. The wider the line width of the grid, the greater the gray value of the entire picture. According to the actual condition of a production line, after a reasonable threshold value is set, the accuracy of qualified focusing distinguishing is improved.
The invention solves the technical problems of difficult accurate identification of light spot boundaries, difficult width quantization of grid lines and the like in the prior art, improves the efficiency and yield of the dimming focusing process, saves the labor cost and brings economic benefits to customers.
The above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for detecting the dimming and focusing of a laser projector production line, the method comprising:
the light modulation spot processing method comprises the following steps:
s1, filtering an original image by using a Gaussian fuzzy filtering method, acquiring an image edge contour by using a Canny edge detection method, performing contour discovery and ellipse fitting operations to detect and acquire a standard circular contour, fitting a first minimum external rectangle according to the standard circular contour, intercepting and operating the original image according to a first rectangle parameter of the first minimum external rectangle to acquire a first region of interest, and finishing image preprocessing according to the first minimum external rectangle parameter;
s2, filtering the first region of interest by using an edge protection filtering method, finding an adaptive threshold by using a Gaussian curve fitting method, finding a spot boundary, obtaining an image edge contour by using the Canny edge detection method, performing contour finding and ellipse fitting operation to obtain spot ellipse fitting parameters, and performing spot identification to obtain a spot identification result;
s3, calculating the ratio of the fitting elliptical area of the identified light spot to the fitting elliptical area of the standard circle according to the light spot identification result, and checking whether the size of the light spot in the light spot identification result meets a preset standard or not according to a preset light spot size threshold;
s4, processing the first region of interest to obtain at least 2 Gaussian distributions, calculating a pixel value corresponding to the minimum value among the Gaussian distributions, distinguishing whether the light spot edge is clear according to a preset light spot clear threshold value, calculating a light spot edge gray value, and distinguishing whether the light spot gray accords with the preset standard according to a preset light spot gray threshold value;
the focusing method comprises the following steps:
s1', an image preprocessing stage, namely performing Dajin binarization processing on the original image to obtain a binarized image, performing expansion processing on the binarized image to find a grid outline, fitting a second minimum circumscribed rectangle of the grid outline, and intercepting and processing the binarized image according to a second rectangle parameter of the second minimum circumscribed rectangle to obtain a second region of interest to obtain a focusing preprocessed image;
s2', a grid checking stage, namely calculating the average gray value of the focusing preprocessed image, and distinguishing whether the grid meets the preset standard or not according to a preset grid distinguishing threshold.
2. The method for detecting the dimming focus of the laser projector as claimed in claim 1, wherein the step S1 comprises:
s11, fitting the first minimum circumscribed rectangle of the standard circle profile;
s12, obtaining the coordinates of the central point and the width and height parameters of the first minimum circumscribed rectangle, and amplifying the width and height of the rectangle according to the coordinates;
s13, intercepting the first region of interest containing the standard circle from the original image.
3. The method for detecting the dimming focus of the laser projector as claimed in claim 1, wherein the step S2 comprises:
s21, detecting the image edge contour by the Canny edge detection method, and performing morphological closing operation on the image edge contour;
s22, finding all peripheral outlines according to an image edge outline finding method, and processing the peripheral outlines according to the outline area in a descending order;
s23, traversing the peripheral outline, carrying out ellipse fitting processing on the peripheral outline to obtain a fitting ellipse, and filtering according to the long axis and the short axis of the fitting ellipse to find the light spot ellipse fitting parameters.
4. The method for detecting the dimming focus of the laser projector in-line of claim 1, wherein the step S2 further comprises:
s201, performing channel separation on the ROI subjected to edge protection filtering to obtain a green channel;
s202, counting the number of pixels of each pixel value to carry out moving average filtering on the number of the pixels so as to obtain pixel Gaussian distribution;
s203, intercepting low-pixel-value Gaussian distribution data according to the Gaussian distribution of the pixels, performing Gaussian curve fitting to obtain the mean value and the standard deviation of a Gaussian curve, and processing to obtain an adaptive threshold value;
s204, traversing the green channel, and processing each pixel value of the green channel to obtain a light spot boundary.
5. The method according to claim 4, wherein in step S202, the Gaussian distribution of pixels is expressed by the following logic:
Figure FDA0003835045340000021
where f (x) represents a Gaussian distribution, μ is the mean of the Gaussian curve, and δ is the standard deviation.
6. The method as claimed in claim 4, wherein in step S203, the adaptive threshold is obtained by the following logic process:
threshold=μ+3*δ。
7. the method according to claim 4, wherein in step S204, each pixel value of the green channel is processed by the following logic to obtain the flare boundary:
Figure FDA0003835045340000022
where x, y are the row index and column index of the pixel.
8. The method for detecting the dimming focus of the laser projector as claimed in claim 1, wherein the step S4 comprises:
s41, calculating 4 intersection points of the ellipse and a straight line passing through the center of the ellipse and having a slope of positive 1 and negative 1 according to the ellipse parameters fitted by the standard circle;
s42, respectively selecting one area in the ellipse, calculating the average gray value of 4 areas, and accordingly checking whether the gray value of the light spot meets the preset standard.
9. The method according to claim 8, wherein in step S42, the flare gray scale is checked to meet the preset criterion with the following logic:
S=π*a*b
Figure FDA0003835045340000031
wherein score is similarity score of the facula and the standard circle, S gt Fitting an elliptical area, S, to a standard circle dt And fitting the elliptical area for the light spot, wherein a and b are respectively the major axis and the minor axis of the ellipse.
10. A laser projector production line dimming focus detection system, the system comprising:
the light spot adjusting module comprises:
the light-adjusting spot image preprocessing module is used for filtering an original image by a Gaussian fuzzy filtering method, acquiring an image edge contour by a Canny edge detection method, detecting and acquiring a standard circle contour according to the contour discovery and ellipse fitting operation, fitting a first minimum circumscribed rectangle according to the standard circle contour, intercepting and operating the original image according to a first rectangle parameter of the first minimum circumscribed rectangle to obtain a first region of interest, and finishing image preprocessing according to the first region of interest;
the spot identification module is used for filtering the first region of interest by using an edge protection filtering method, finding an adaptive threshold value by using a Gaussian curve fitting method, finding a spot boundary, obtaining the image edge profile by using the Canny edge detection method, performing profile finding and ellipse fitting operations to obtain spot ellipse fitting parameters, performing spot identification to obtain a spot identification result, and is connected with the spot-adjusting image preprocessing module;
the light spot distinguishing module is used for calculating the ratio of the fitting elliptical area of the identified light spot to the fitting elliptical area of the standard circle according to the light spot identification result, checking whether the size of the light spot in the light spot identification result meets a preset standard according to a preset light spot size threshold value, and is connected with the light spot identification module;
the light spot gray level resolution module is used for processing according to the first region of interest to obtain at least 2 Gaussian distributions, calculating a pixel value corresponding to the minimum value among the Gaussian distributions, distinguishing whether the light spot edge is clear according to a preset light spot clear threshold value, calculating the gray level of the light spot edge, distinguishing whether the light spot gray level meets the preset standard according to a preset light spot gray level threshold value, and is connected with the light spot adjusting image preprocessing module and the light spot identification module;
the focus adjusting module comprises:
the focusing preprocessing module is used for carrying out binarization processing on the original image in a large amount of time to obtain a binarized image, expanding the binarized image to find a grid outline, fitting a second minimum circumscribed rectangle of the grid outline, and intercepting and processing the binarized image according to a second rectangle parameter of the second minimum circumscribed rectangle to obtain a second region of interest to obtain a focusing preprocessed image;
and the grid distinguishing module is used for calculating the average gray value of the focusing preprocessing image, verifying whether the grid meets the preset standard according to a preset grid distinguishing threshold value, and is connected with the focusing preprocessing module.
CN202211084796.4A 2022-09-06 2022-09-06 Method and system for detecting light modulation and focusing of laser projector production line Pending CN115424008A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211084796.4A CN115424008A (en) 2022-09-06 2022-09-06 Method and system for detecting light modulation and focusing of laser projector production line

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211084796.4A CN115424008A (en) 2022-09-06 2022-09-06 Method and system for detecting light modulation and focusing of laser projector production line

Publications (1)

Publication Number Publication Date
CN115424008A true CN115424008A (en) 2022-12-02

Family

ID=84202120

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211084796.4A Pending CN115424008A (en) 2022-09-06 2022-09-06 Method and system for detecting light modulation and focusing of laser projector production line

Country Status (1)

Country Link
CN (1) CN115424008A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115740735A (en) * 2022-12-12 2023-03-07 福州大学 Rapid automatic focusing method suitable for laser micro-nano manufacturing
CN117066702A (en) * 2023-08-25 2023-11-17 上海频准激光科技有限公司 Laser marking control system based on laser
CN118134916A (en) * 2024-05-06 2024-06-04 深圳玩智商科技有限公司 Line laser spot detection method and system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115740735A (en) * 2022-12-12 2023-03-07 福州大学 Rapid automatic focusing method suitable for laser micro-nano manufacturing
CN117066702A (en) * 2023-08-25 2023-11-17 上海频准激光科技有限公司 Laser marking control system based on laser
CN117066702B (en) * 2023-08-25 2024-04-19 上海频准激光科技有限公司 Laser marking control system based on laser
CN118134916A (en) * 2024-05-06 2024-06-04 深圳玩智商科技有限公司 Line laser spot detection method and system

Similar Documents

Publication Publication Date Title
CN115424008A (en) Method and system for detecting light modulation and focusing of laser projector production line
CN110070524B (en) Intelligent terminal panel visual fault detection system
CN108921176A (en) A kind of pointer instrument positioning and recognition methods based on machine vision
EP3309703A1 (en) Method and system for decoding qr code based on weighted average grey method
CN110210477B (en) Digital instrument reading identification method
CN117764986B (en) Titanium plate surface defect detection method based on image processing
CN115082466B (en) PCB surface welding spot defect detection method and system
CN110674812B (en) Civil license plate positioning and character segmentation method facing complex background
CN115131354A (en) Laboratory plastic film defect detection method based on optical means
CN115115612A (en) Surface defect detection method and system for mechanical parts
CN114219773B (en) Pre-screening and calibrating method for bridge crack detection data set
CN111739012A (en) Camera module white spot detecting system based on turntable
CN114359253A (en) Image pollution detection method and system based on convolutional neural network
CN113971681A (en) Edge detection method for belt conveyor in complex environment
CN111833350A (en) Machine vision detection method and system
CN116542998B (en) Contour detection method, device, equipment and medium for photoetching film inductance
CN116823771A (en) ZARA defect specification detection method, system and storage medium
CN115272345B (en) Image processing-based fireproof fabric quality analysis method
CN110310239A (en) It is a kind of to be fitted the image processing method for eliminating illumination effect based on characteristic value
CN114511851B (en) Hairspring algae cell statistical method based on microscope image
CN110148141A (en) A kind of silk-screen optical filter small pieces detection method of counting and equipment
CN114066993B (en) Power distribution cabinet control panel segmentation method based on machine vision
CN114937003A (en) Multi-type defect detection system and method for glass panel
CN114359414A (en) Lens smudge identification method and device, computer equipment and storage medium
CN114125435A (en) Intelligent image defect detection method for network camera

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination