A high-precision image measurement method and system based on dynamic bottom light control
Patent Information
- Application Number
- CN202610908809.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-23
- Publication Date
- 2026-09-08
AI Technical Summary
但是LED漫反射光源的平行性很差,光线向各个角度发散
[0016]经由上述的技术方案可知,与现有技术相比,本发明公开提供了一种基于动态底光控制的高精度影像测量方法及系统,具有以下效果:
Smart Images

Figure CN122708643A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of precision measurement technology, and more specifically to a high-precision image measurement method and system based on dynamic bottom light control. Background Technology
[0002] Vision measuring instruments are key equipment in industrial production for obtaining the two-dimensional dimensions of workpieces, and their measurement accuracy is directly affected by the performance of the lighting system. Currently, the light sources of vision measuring instruments are mainly divided into two categories: parallel light sources and diffuse reflection light sources.
[0003] Traditional high-precision image measurement uses telecentric parallel bottom light, which requires extremely high parallelism and a single color, aiming to eliminate projection errors caused by beam divergence through parallel illumination. While parallel light performs excellently in geometric optics, it has inherent defects at the physical optics level. For workpieces with sharp edges (such as thin metal sheets, razor blades, and photomasks), parallel light produces significant unilateral diffraction at the edges. This wave-like optical effect causes an "overbright-to-dark" halo at the image edges, shifting the image's grayscale center or maximum gradient position (usually manifested as outward expansion). Experimental measurements show that this can lead to a systematic deviation of 2-3 μm in circle diameter measurement. Furthermore, the better the parallelism and the stronger the coherence of the light source, the more pronounced the diffraction effect becomes.
[0004] To overcome diffraction problems, some solutions employ LED diffuse reflective panel light sources. These light sources have almost no coherence, thus avoiding diffraction fringes. However, LED diffuse reflective light sources have poor parallelism, causing the light to diverge at various angles. This divergent light leads to blurred projected boundaries of workpiece edges (especially cylinders and holes with chamfers or height). For cylinder measurements, lateral divergence results in undersized measurements; for hole measurements, it results in oversized measurements. This error caused by the geometric optical divergence angle also limits the improvement of measurement accuracy.
[0005] Therefore, there is an urgent need for a new lighting control strategy that can avoid diffraction effects and divergence angle errors from a physical mechanism while ensuring sufficient brightness and contrast, thereby achieving high-precision submicron image measurement. Summary of the Invention
[0006] In view of the above problems, the present invention is proposed to provide a high-precision image measurement method and system based on dynamic bottom light control to overcome or at least partially solve the above problems. It not only retains the advantage of LED light source without diffraction, but also simulates the high contrast characteristics of parallel light through area restriction. Finally, it achieves metrological-grade accuracy improvement without adding expensive optical components (such as lasers or complex lens groups).
[0007] To achieve the above objectives, the present invention adopts the following technical solution:
[0008] In a first aspect, embodiments of the present invention provide a high-precision image measurement method based on dynamic bottom light control, comprising: S1: Obtain the approximate position of the edge of the workpiece being measured in the camera image, and calculate the actual position of the edge in the measurement coordinate system by combining the physical coordinates read by the grating ruler; map the actual position to the pixel coordinate system of the LCD bottom light to generate a dynamic lighting area covering the neighborhood of the edge, and set the remaining areas to the off state; S2: Send the parameters of the dynamic lighting area to the light source control board, which generates a corresponding HDMI video timing signal to drive the LCD bottom light to display a specific pattern and simultaneously outputs a camera trigger signal; S3: The LCD bottom light emits light only within the dynamic lighting area. The emitted diffuse light passes through the stage and illuminates the true geometric edge of the workpiece being measured. The camera receives the transmitted light and acquires the contour image. S4: Perform subpixel edge extraction on the contour image and calculate the workpiece size.
[0009] Preferably, the edge of the workpiece being measured includes a straight edge; In S1, the dynamic lighting area is generated as a rotating rectangular strip region that expands outward along its normal direction with a preset width based on the detected straight edge. In S2, the light source control board uses the CORDIC algorithm to calculate the pixel addresses covered by the dynamic lighting area and writes them into the frame buffer.
[0010] Preferably, the edge of the workpiece being measured includes a circular edge; In S1, the dynamic lighting area is generated as an annular region centered on the detected circle center and defined by two concentric circles with radii smaller than and larger than the workpiece circle radius within a certain range. In S2, the light source control board uses the CORDIC algorithm to calculate the pixels belonging to the lighting area within the dynamic lighting area and writes them into the frame buffer.
[0011] Preferably, S1 includes: Obtain the approximate position of the edge of the workpiece in the camera image, and simultaneously read the physical coordinates s=( sx , sy ); Based on rough location and physical coordinates s=( sx , sy Using the calibrated image-object mapping relationship, the actual coordinates of the edge in the measurement coordinate system are calculated as o=c+s; Based on the pixel magnification k of the LCD, the actual coordinates o are mapped to the pixel coordinates of the LCD bottom light. ; A dynamic lighting area covering the edge neighborhood is generated based on the pixel coordinates, while the remaining areas are set to an off state.
[0012] Preferably, S2 includes: The host computer sends the parameters of the dynamic lighting area to the motion controller via USB, and the motion controller transmits the parameters to the FPGA light source control board via RS-485 bus. The FPGA light source control board adopts a double-buffered pattern storage mechanism, uses the CORDIC algorithm to iteratively calculate the pixel address mapping of the dynamic lighting area in the LCD pixel coordinate system in real time, and writes the calculation results into the background buffer. During the vertical blanking period, the background buffer is switched to the front buffer. Based on the data in the front buffer, an HDMI video timing signal conforming to the HDMI standard is generated to drive the LCD bottom light to display a specific pattern; at the same time, a camera trigger signal is generated. The pulse output time of the camera trigger signal is phase-locked with the field synchronization signal of the HDMI video timing signal, and is configured to be emitted after the lighting pattern update is completed and after a preset pattern stabilization frame, so as to ensure that the lighting pattern of the LCD bottom light is in a stable state during the camera exposure.
[0013] Secondly, embodiments of the present invention provide a dynamic bottom light measurement system, comprising: The host computer is used to run the measurement software, obtain the rough position of the edge of the workpiece in the camera image, and calculate the actual position of the edge in the measurement coordinate system by combining the physical coordinates read by the grating ruler. The actual position is mapped to the pixel coordinate system of the LCD bottom light, a dynamic lighting area covering the neighborhood of the edge is generated, and sub-pixel edge extraction is performed on the contour image to calculate the workpiece size. The motion controller is connected to the host computer and the grating ruler respectively, and is used to receive parameters of the dynamic lighting area and perform command forwarding and coordinate feedback. LCD bottom light serves as a controllable incoherent surface light source; The light source control board, connected to the motion controller, is used to receive parameters of the dynamic lighting area, generate corresponding HDMI video timing signals to drive the LCD bottom light to display specific patterns, and synchronously output camera trigger signals. An industrial camera, vertically mounted above a glass stage, is used to receive camera trigger signals and acquire contour images; The LCD bottom light source faces upward and is positioned parallel to the glass stage, while the optical axis of the industrial camera is strictly perpendicular to the glass stage.
[0014] Preferably, the LCD bottom light uses a high-brightness LCD display, and the switching of specific areas is achieved by controlling the HDMI through the light source control board, thereby simulating the lighting effect of a controllable LED array.
[0015] Preferably, the host computer and the motion controller are connected via a USB or Ethernet interface; the motion controller and the light source control board are connected via an RS-485 bus; and the signal output terminal of the grating ruler is connected to the encoder interface of the motion controller.
[0016] As can be seen from the above technical solution, compared with the prior art, the present invention discloses a high-precision image measurement method and system based on dynamic bottom light control, which has the following effects: 1) This invention uses an LCD as an incoherent light source, illuminating only a small area adjacent to the edge. This localized diffuse light destroys the coherence of the light, completely avoiding the diffraction halo caused by parallel light, thus ensuring that the position of the maximum gradient of the brightness curve at the imaging edge is precisely aligned with the actual geometric position of the workpiece.
[0017] 2) Through dynamic area control, pixels in non-measurement areas are extinguished. Only the area near the edge directly facing the camera's field of view emits light, eliminating interference from lateral stray light. This allows for high-contrast contours even on workpieces with chamfers or height.
[0018] 3) This invention employs a double-buffering mechanism, ensuring that the camera trigger signal generated by the PGA is strictly synchronized with the HDMI refresh timing of the LCD (with a reserved stable frame). This means that during each camera exposure, the illumination pattern on the LCD is in a state of absolute stillness and stable brightness, eliminating motion blur and flicker noise. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of a high-precision image measurement method based on dynamic bottom light control provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of a high-precision image measurement system based on dynamic bottom light control provided in an embodiment of the present invention; Figure 3 This is a structural diagram of the image measuring instrument provided in an embodiment of the present invention; Figure 4These are schematic diagrams of straight edge measurement and circular edge measurement provided in embodiments of the present invention; Figure 5 The diagram shows the effect provided in the embodiment of the present invention. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] This invention discloses a high-precision image measurement method based on dynamic bottom light control, such as... Figure 1 As shown, it includes: S1: Obtain the approximate position of the edge of the workpiece in the camera image, and calculate the actual position of the edge in the measurement coordinate system by combining the physical coordinates read by the grating ruler; map the actual position to the pixel coordinate system of the LCD bottom light to generate a dynamic lighting area covering the edge neighborhood, and set the remaining areas to the off state; S2: Send the parameters of the dynamic lighting area to the light source control board, which generates the corresponding HDMI video timing signal to drive the LCD bottom light to display a specific pattern and simultaneously outputs the camera trigger signal; S3: The LCD bottom light emits light only in the dynamic illumination area. The emitted diffuse light passes through the stage and illuminates the true geometric edge of the workpiece being measured. The camera receives the transmitted light and acquires the contour image. S4: Extract subpixel edges from the acquired image and calculate the workpiece size.
[0023] This invention eliminates the divergence ambiguity caused by distant side lighting by emitting light only in the area immediately adjacent to the edge. Furthermore, by employing incoherent diffused light, it completely avoids the unilateral diffraction halo caused by parallel light. The location of the maximum gradient on the edge brightness curve precisely coincides with the actual geometric edge. After passing through the workpiece, the light enters the telecentric lens and industrial camera above. The camera exposes and captures a high-contrast, diffraction-free contour image under synchronous triggering. The image is transmitted back to the host computer for sub-pixel edge extraction and size calculation. Ultimately, the diameter measurement error can be controlled within 0.1μm (calibration error less than 0.1 pixels), completely solving the measurement problems of traditional parallel bottom lighting causing excessive diameter due to diffraction and ordinary LED panel light causing insufficient cylinder size due to divergence angle.
[0024] In this embodiment, as Figure 4 As shown in section (b), measurements for straight edges (such as blade cutting edges, rectangular part boundaries) include: S1: The host computer drives the camera to acquire a frame of image, and obtains the approximate position of the straight edge in the camera image through fast edge detection (such as Canny). More specifically, the host computer uses the detected straight line edge as a reference and expands outward along its normal direction by a preset width (e.g., 100μm), forming a roughly positioned rotating rectangular strip spanning the straight line. Simultaneously, it reads the current physical coordinates s=(…) from the motion controller. sx , sy Based on the established image-object mapping relationship, the image point coordinates are converted into the actual object measurement coordinates o=c+s (where c is the transformation vector from image point to object point).
[0025] S2: Convert actual coordinates to LCD pixel coordinates: , where k is the magnification from the object surface to the LCD.
[0026] Considering that straight lines may have an angle with the LCD pixel grid, the illumination area is defined as a rotated rectangle with a grayscale gradient at the boundary (to prevent sharp edges from introducing additional diffraction). Based on the pixel coordinates of the LCD bottom light, the approximate location of the rotated rectangle strip is generated into a rotated rectangle illumination area covering the edge neighborhood, including the center, length, width, tilt angle, and boundary gradient width. S3: The host computer packages the parameters of the rotating rectangular lighting area (center, length, width, tilt angle, and boundary gradient width) and sends them to the motion controller via USB. The motion controller then forwards them to the FPGA light source control board via RS-485.
[0027] S4: After receiving the parameters, the FPGA light source control board uses the CORDIC algorithm to calculate the addresses of all pixels covered by the rotating rectangular illumination area and writes them into the frame buffer (double buffering mechanism). At the same time, the FPGA light source control board locks the LCD refresh and camera exposure phase according to the camera trigger signal, ensuring that the pattern is stable for one frame before triggering the camera.
[0028] Generate a standard HDMI video timing signal to drive the LCD backlight to illuminate only the LED pixels in that strip area, while the rest of the area remains completely black.
[0029] S5: The incoherent diffuse light emitted by the LCD illuminates only the local area near the straight edge of the workpiece from above the glass stage.
[0030] LEDs far from the edge are completely turned off, eliminating the beam divergence and blurred light-dark boundary caused by the light source of ordinary LED panels due to the light from the distance.
[0031] The camera is exposed under the control of a synchronization signal to acquire edge images with no diffraction and realistic gradients. Since the illumination exists only in the edge neighborhood, the maximum gradient point on the brightness curve is precisely aligned with the actual geometric edge of the workpiece, and there is no unilateral diffraction spread caused by parallel light.
[0032] The host computer performs subpixel edge extraction on the image and calculates dimensions such as straight-line distance and position, significantly improving measurement repeatability.
[0033] In this embodiment, as Figure 4 As shown in section (a), measurements for circular edges (such as circular holes, the outer diameter of cylinders, and mask annexes) include: S1: The host computer captures an image and uses a circle detection algorithm (such as Hough transform) to quickly locate the center of the circle in the image and its approximate radius. That is, the host computer uses the actual coordinates of the circle's center. ocenter Centered on the workpiece circle, a rough position of an annular region covering the edge neighborhood is generated with two radius values slightly smaller and slightly larger than the workpiece circle radius. The width of the annular region is a specified margin for outward expansion from the edge, ensuring complete coverage of the chamfered portion of the tool edge sidewall. Similarly, the current physical coordinates of the grating ruler are obtained from the motion controller: s = ( sx , sy (This converts the coordinates of the center image point into the actual center coordinates in the measurement coordinate system.) ocenter = ccenter + s . ccenter The coordinates of the center of the circle within the camera's field of view. ocenter The actual coordinates of the center of the circle in the measured coordinate system.
[0034] S2:
[0035] Similarly, the actual center coordinates under the measured coordinate system are mapped to the LCD pixel coordinates, that is, according to the proportional transformation relationship between the physical measurement coordinate system and the pixel coordinates. This yields the set of circular pixels to be illuminated on the LCD. The inner and outer boundaries of the circular pixel ring are also subject to grayscale transitions.
[0036] S3: The host computer sends the circular pixel set parameters (center pixel coordinates, inner diameter, outer diameter, transition zone width) to the motion master controller, which then forwards them to the FPGA light source control board.
[0037] S4: After receiving the parameters, the FPGA light source control board uses the CORDIC algorithm to quickly calculate whether each pixel within the annular pixel set belongs to the illumination area and writes the pattern into the frame buffer. It also performs frame synchronization triggered by the camera to ensure a stable and tear-free illumination pattern. The LCD is driven via HDMI, illuminating only the LEDs in the annular area.
[0038] S5: The LCD emits diffused light only along the circumference of the measured circular hole, illuminating the hole boundary from below. The incoherent light source completely avoids diffraction rings caused by parallel light illuminating the circular edge, and the "overly bright then darkening" diffraction halo no longer appears at the circular edge. At the same time, only the light source near the circular ring is illuminated, minimizing the geometric error caused by the beam divergence angle—stray light at the top and bottom chamfers of the edge is greatly suppressed due to the limited illumination area, so the cylinder measurement is no longer "underestimated" and the circular hole measurement is no longer "overestimated".
[0039] After exposure, the camera produces a high-contrast, diffraction-free circular outline image.
[0040] The host computer performs subpixel circle fitting to calculate the diameter or radius. The calibration residual error can be controlled within 0.1 μm, and the repeatability of roundness measurement is improved by an order of magnitude.
[0041] The dynamic lighting mode can follow the workpiece in real time as it moves, always keeping the lighting ring concentric with the edge of the workpiece, making it suitable for rapid batch inspection.
[0042] like Figure 5 As shown, the controllable bottom light of this invention provides higher measurement accuracy and better controllability compared to traditional light sources.
[0043] This invention provides a dynamic bottom light measurement system, such as... Figure 2 and Figure 3 As shown, it includes: The host computer is used to run the measurement software, obtain the rough position of the edge of the workpiece in the camera image, and combine it with the physical coordinates read by the grating ruler to calculate the actual position of the edge in the measurement coordinate system. The actual position is then mapped to the pixel coordinate system of the LCD bottom light to generate a dynamic lighting area covering the edge neighborhood. The motion controller is connected to the host computer and the grating ruler respectively, and is used to receive parameters of the dynamic lighting area and forward commands and provide coordinate feedback; LCD bottom light 1 serves as a controllable incoherent surface light source; The light source control board, connected to the motion controller, is used to receive parameters of the dynamic lighting area, generate corresponding HDMI video timing signals to drive the LCD bottom light to display specific patterns, and synchronously output camera trigger signals. Industrial camera 2 is vertically mounted above the glass stage and connected to the host computer to receive camera trigger signals and acquire contour images; The LCD bottom light 1 has its light-emitting surface facing upwards and is placed parallel above the glass stage 3. The optical axis of the industrial camera is strictly perpendicular to the glass stage 3.
[0044] In addition to the structure described above, the system of this invention also includes the basic structure of a traditional image measuring instrument. No innovation is made regarding the structure of a traditional image measuring instrument; for example, it also includes: The glass stage (glass base plate) is placed parallel to the bottom light directly below to ensure uniform light output and no mechanical interference. The glass stage is used to support the workpiece being measured (such as metal sheets, photomasks, etc.).
[0045] The grating rulers are installed on the X-axis and Y-axis motion platforms of the image measuring instrument to detect the position of the stage (or camera) relative to the machine zero point in real time and provide physical coordinate feedback.
[0046] As for the other necessary structures, this invention will not elaborate on them. Furthermore, since the principle by which the system solves the problem is similar to the aforementioned method, the implementation of this system can refer to the implementation of the aforementioned method; repeated details will not be repeated.
[0047] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0048] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A high-precision image measurement method based on dynamic backlight control, characterized in that, include: S1: Obtain the approximate position of the edge of the workpiece being measured in the camera image, and calculate the actual position of the edge in the measurement coordinate system by combining the physical coordinates read by the grating ruler; map the actual position to the pixel coordinate system of the LCD bottom light to generate a dynamic lighting area covering the neighborhood of the edge, and set the remaining areas to the off state; S2: Send the parameters of the dynamic lighting area to the light source control board, which generates a corresponding HDMI video timing signal to drive the LCD bottom light to display a specific pattern and simultaneously outputs a camera trigger signal; S3: The LCD bottom light emits light only within the dynamic lighting area. The emitted diffuse light passes through the stage and illuminates the true geometric edge of the workpiece being measured. The camera receives the transmitted light and acquires the contour image. S4: Perform subpixel edge extraction on the contour image and calculate the workpiece size.
2. The method of claim 1, wherein, The edges of the workpiece being measured include straight edges; In S1, the dynamic lighting area is generated as a rotating rectangular strip region that expands outward along its normal direction with a preset width based on the detected straight edge. In S2, the light source control board uses the CORDIC algorithm to calculate the pixel addresses covered by the dynamic lighting area and writes them into the frame buffer.
3. The method as described in claim 1, characterized in that, The edges of the workpiece being measured include circular edges; In S1, the dynamic lighting area is generated as an annular region centered on the detected circle center and defined by two concentric circles with radii smaller than and larger than the workpiece circle radius within a certain range. In S2, the light source control board uses the CORDIC algorithm to calculate the pixels belonging to the lighting area within the dynamic lighting area and writes them into the frame buffer.
4. The method as described in claim 1, characterized in that, S1 includes: Obtain the approximate position of the edge of the workpiece in the camera image, and simultaneously read the physical coordinates s=( sx , sy ); Based on rough location and physical coordinates s=( sx , sy Using the calibrated image-object mapping relationship, the actual coordinates of the edge in the measurement coordinate system are calculated as o=c+s; Based on the pixel magnification k of the LCD, the actual coordinates o are mapped to the pixel coordinates of the LCD bottom light. ; A dynamic lighting area covering the edge neighborhood is generated based on the pixel coordinates of the LCD bottom light, while the remaining areas are set to an off state.
5. The method as described in claim 1, characterized in that, S2 includes: The host computer sends the parameters of the dynamic lighting area to the motion controller via USB, and the motion controller transmits the parameters to the FPGA light source control board via RS-485 bus. The FPGA light source control board adopts a double-buffered pattern storage mechanism, uses the CORDIC algorithm to iteratively calculate the pixel address mapping of the dynamic lighting area in the LCD pixel coordinate system in real time, and writes the calculation results into the background buffer. During the vertical blanking period, the background buffer is switched to the front buffer. Based on the data in the front buffer, an HDMI video timing signal conforming to the HDMI standard is generated to drive the LCD bottom light to display a specific pattern; at the same time, a camera trigger signal is generated. The pulse output time of the camera trigger signal is phase-locked with the field synchronization signal of the HDMI video timing signal, and is configured to be emitted after the lighting pattern update is completed and after a preset pattern stabilization frame, so as to ensure that the lighting pattern of the LCD bottom light is in a stable state during the camera exposure.
6. A dynamic bottom light measurement system for implementing the method as described in any one of claims 1-5, characterized in that, include: The host computer is used to run the measurement software, obtain the rough position of the edge of the workpiece in the camera image, and calculate the actual position of the edge in the measurement coordinate system by combining the physical coordinates read by the grating ruler. The actual position is mapped to the pixel coordinate system of the LCD bottom light, a dynamic lighting area covering the neighborhood of the edge is generated, and sub-pixel edge extraction is performed on the contour image to calculate the workpiece size. The motion controller is connected to the host computer and the grating ruler respectively, and is used to receive parameters of the dynamic lighting area and perform command forwarding and coordinate feedback. LCD bottom light serves as a controllable incoherent surface light source; The light source control board, connected to the motion controller, is used to receive parameters of the dynamic lighting area, generate corresponding HDMI video timing signals to drive the LCD bottom light to display specific patterns, and synchronously output camera trigger signals. An industrial camera, vertically mounted above a glass stage, is used to receive camera trigger signals and acquire contour images; The LCD bottom light source faces upward and is positioned parallel to the glass stage, while the optical axis of the industrial camera is strictly perpendicular to the glass stage.
7. The system as described in claim 6, characterized in that, The LCD backlight uses a high-brightness LCD display, and the switching of specific areas is achieved through the control of the HDMI via the light source control board, thereby simulating the lighting effect of a controllable LED array.
8. In the system as described in claim 6, the host computer and the motion controller are connected via a USB or Ethernet interface; the motion controller and the light source control board are connected via an RS-485 bus; and the signal output terminal of the grating ruler is connected to the encoder interface of the motion controller.