Search

CN-122023504-A - Light source centering system and method based on image detection

CN122023504ACN 122023504 ACN122023504 ACN 122023504ACN-122023504-A

Abstract

The invention relates to the technical field of machine vision and precise optical detection, in particular to a light source centering system based on image detection and a method thereof, comprising the steps of obtaining a light spot image projected by a light source to be detected and constructing gray potential energy field data; setting a preset gray threshold sequence avoiding the saturation value of a pixel, executing layering slicing processing in gray potential field data, extracting a plurality of corresponding groups of equi-energy closed contour lines from the gray potential field data based on the preset gray threshold sequence, respectively calculating the geometric centroid of each group of equi-energy closed contour lines, constructing centroid drifting track vectors, calculating virtual absolute centroid coordinates in a saturation region based on geometric distribution characteristics of the centroid drifting track vectors, calculating deviation vectors of the virtual absolute centroid coordinates and the physical center of a preset image, and generating a centering adjustment instruction according to the deviation vectors to drive a light source position adjustment mechanism to eliminate deviation.

Inventors

  • ZHANG LING
  • WANG ZHILIN
  • YU XUNJUN

Assignees

  • 深圳中天创图科技有限公司

Dates

Publication Date
20260512
Application Date
20260211

Claims (8)

  1. 1. A light source centering method based on image detection, comprising: Acquiring a light spot image projected by a light source to be detected, mapping gray values of pixel points in the light spot image into topological height values, and constructing gray potential energy field data; Setting a preset gray threshold sequence avoiding the saturation value of the pixel, and executing layering slice processing in gray potential energy field data; step 1, based on a preset gray threshold sequence, extracting a plurality of groups of corresponding isokinetic closed contour lines from gray potential energy field data; Step 2, respectively calculating geometric centroids of each group of equal-energy closed contour lines, and connecting a plurality of geometric centroids according to the energy hierarchy order to construct a centroid drift track vector; step 3, calculating virtual absolute heart coordinates in a saturation interval through a weighted extrapolation algorithm based on geometric distribution characteristics of centroid drift trajectory vectors; Step 4, calculating a deviation vector of the virtual absolute center coordinates and a preset image physical center; And step 5, generating a centering adjustment instruction according to the deviation vector so as to drive the light source position adjustment mechanism to eliminate the deviation.
  2. 2. The method for centering a light source based on image detection according to claim 1, wherein the pre-setting of the gray threshold sequence comprises: selecting a plurality of discrete values lower than the saturation value of the pixel in the effective gray scale range of the facula image; Arranging a plurality of discrete values in order from low to high to form a threshold set for hierarchical slicing; The value range of the threshold value set covers a gray value interval from a gray value at the background noise edge of the facula image to a gray value interval from 90% to 95% of a pixel saturation value.
  3. 3. The method of claim 1, wherein constructing centroid drift trajectory vectors in step 2 comprises: acquiring a pixel coordinate set of each level of equi-closeable contour lines; calculating a first moment of a pixel coordinate set, and determining geometric centroid coordinates of a current level; Establishing an analysis coordinate system with the physical center of the image as an origin; and performing spatial mapping on geometric centroid coordinates of different levels in an analysis coordinate system to generate centroid drift trajectory vectors describing asymmetry of light energy distribution.
  4. 4. A method of aligning a light source based on image detection as claimed in claim 3 wherein in step 3, the method comprises: calculating the contour symmetry index of each group of equi-energy closed contour lines, wherein the contour symmetry index is defined as the standard deviation of Euclidean distance from each pixel point on the contour lines to the geometric centroid of the contour; based on the profile symmetry index, generating confidence weights of the corresponding levels, configured to: If the profile symmetry index of the current level is larger than a preset symmetry threshold, judging that the current level is interfered by stray light, and giving low confidence weight; If the profile symmetry index of the current level is smaller than or equal to a preset symmetry threshold, high confidence weight is given.
  5. 5. The method for centering a light source based on image detection as claimed in claim 4, the method is characterized by solving virtual absolute heart coordinates in a saturation interval, and comprising the following steps of: Combining the geometric centroid coordinates and the confidence weights to construct a weighted least squares regression model; fitting the tangential direction of the centroid drift trajectory vector by using a weighted least square regression model; and linearly extending along the tangential direction to the increasing direction of the gray value, and calculating the intersection point of the extension line and the target gray plane to be used as the virtual absolute center coordinate.
  6. 6. The method of claim 1, wherein generating the centering adjustment command according to the deviation vector in step 5 comprises: decomposing the bias vector into a horizontal component and a vertical component; converting the horizontal component and the vertical component into mechanical displacement based on a preset pixel-physical distance mapping proportion; The mechanical displacement is encoded into a motor control signal of the position adjusting mechanism and is output as a centering adjustment instruction.
  7. 7. The method of image detection-based light source centering of claim 1, further comprising an adaptive iterative correction procedure: Responding to the completion of the centering adjustment instruction executed by the position adjustment mechanism, and re-acquiring the current facula image; Repeating the steps 1 to 4, and calculating a residual deviation value; if the residual deviation value is larger than the preset precision threshold value, triggering a new centering adjustment instruction generation flow; if the residual deviation value is smaller than or equal to the preset precision threshold value, the centering is judged to be completed and the position is locked.
  8. 8. A light source centering system based on image detection, characterized in that the system is configured to perform the method of any one of claims 1-7, the system comprising: The image acquisition module is used for acquiring a light spot image projected by the light source to be detected and converting the light spot image into gray potential energy field data; The topology mapping module is used for extracting a plurality of groups of isokinetic closed contour lines from the gray potential energy field data based on a preset gray threshold sequence; the track analysis module is used for calculating the geometric centroid of each group of isokinetic closed contour lines and constructing centroid drifting track vectors; The core resolving module is used for resolving the virtual absolute center coordinates through a weighted extrapolation algorithm based on the centroid drifting track vector; the instruction generation module is used for calculating a deviation vector of the virtual absolute center coordinates and a preset image physical center and generating a center adjustment instruction.

Description

Light source centering system and method based on image detection Technical Field The invention relates to the technical field of machine vision and precise optical detection, in particular to a light source centering system based on image detection and a method thereof. Background In machine vision inspection and optical system calibration applications, the system typically locates the optical energy center by collecting images of the light spots projected by the light source to be measured; The traditional scheme generally adopts a traditional gray level gravity center method, namely a geometric center is directly calculated based on gray value distribution of full pixels, under the actual high signal-to-noise ratio or strong light working condition, the central area of a light source is extremely easy to reach the saturation threshold of a photosensitive chip, so that core pixel information is cut off and lost, meanwhile, the image edge is often accompanied by ghost images and stray light interference due to the influence of inclination of an optical axis or internal reflection of a lens, and the traditional method is highly dependent on the integrity and symmetry of data, so that calculation errors caused by data deletion cannot be effectively avoided when the overexposure and distortion images are processed, obvious numerical deviation and directional drift are caused to the calculation result, and the centering precision of a sub-pixel level is difficult to realize; Therefore, how to break through the physical limitation of pixel information loss under the extreme conditions that the center of the light source is severely saturated and optical noise interference exists, and to realize the accurate calculation and automatic alignment of the optical center coordinates becomes a technical problem to be solved. Disclosure of Invention The invention aims to provide a light source centering system and a method based on image detection, which avoid calculation deviation generated by data interception under the condition of light source center overexposure by the traditional gray level gravity center method, can effectively inhibit stray light and ghost interference, and realize sub-pixel level centering precision under a high signal-to-noise ratio strong light environment, and concretely adopts the following technical scheme: Acquiring a light spot image projected by a light source to be detected, mapping gray values of pixel points in the light spot image into topological height values, and constructing gray potential energy field data; Setting a preset gray threshold sequence avoiding the saturation value of the pixel, and executing layering slice processing in gray potential energy field data; step 1, based on a preset gray threshold sequence, extracting a plurality of groups of corresponding isokinetic closed contour lines from gray potential energy field data; Step 2, respectively calculating geometric centroids of each group of equal-energy closed contour lines, and connecting a plurality of geometric centroids according to the energy hierarchy order to construct a centroid drift track vector; step 3, calculating virtual absolute heart coordinates in a saturation interval through a weighted extrapolation algorithm based on geometric distribution characteristics of centroid drift trajectory vectors; Step 4, calculating a deviation vector of the virtual absolute center coordinates and a preset image physical center; And step 5, generating a centering adjustment instruction according to the deviation vector so as to drive the light source position adjustment mechanism to eliminate the deviation. Preferably, the preset gray threshold sequence includes: selecting a plurality of discrete values lower than the saturation value of the pixel in the effective gray scale range of the facula image; Arranging a plurality of discrete values in order from low to high to form a threshold set for hierarchical slicing; the value range of the threshold value set covers the gray value range from the gray value at the background noise edge of the facula image to the gray value range from 90% to 95% of the pixel saturation value. Preferably, constructing a centroid drift trajectory vector in step 2 includes: acquiring a pixel coordinate set of each level of equi-closeable contour lines; calculating a first moment of a pixel coordinate set, and determining geometric centroid coordinates of a current level; Establishing an analysis coordinate system with the physical center of the image as an origin; and performing spatial mapping on geometric centroid coordinates of different levels in an analysis coordinate system to generate centroid drift trajectory vectors describing asymmetry of light energy distribution. Preferably, the step 3 includes the steps of: Calculating the contour symmetry index of each group of contour lines which can be closed, wherein the contour symmetry index is defined as the standard deviation of Euclid