A narrow- air-gap adaptive focusing imaging method, device, equipment, storage medium and program product for a generator
Patent Information
- Application Number
- CN202610650448.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-12
- Publication Date
- 2026-08-18
AI Technical Summary
[0002]由于成像头与被测表面距离接近且波动频繁,固定焦距方案容易出现局部模糊,即便具备可调焦镜头,若缺少距离/清晰度反馈的闭环控制,仍难在移动过程中保持持续清晰
[0018]本公开实施例提供的技术方案与现有技术相比具有如下优点:
Smart Images

Figure CN122601975A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of machine vision technology, and in particular to a method, apparatus, device, storage medium, and program product for narrow air gap adaptive focusing imaging of generators. Background Technology
[0002] Because the distance between the imaging head and the measured surface is close and fluctuates frequently, fixed-focus solutions are prone to local blurring. Even with an adjustable-focus lens, without closed-loop control for distance / sharpness feedback, it is difficult to maintain continuous sharpness during movement. Furthermore, distance-surface drift can occur when the robot moves close to the surface, leading to a superposition of focus drift and distortion changes, directly affecting image stitching, defect identification, and the quality of the evidence chain. Traditional methods cannot simultaneously ensure ranging reliability, distance-surface control safety, and real-time focusing under narrow air gap conditions. Summary of the Invention
[0003] In order to solve the above-mentioned technical problems, or at least partially solve the above-mentioned technical problems, this disclosure provides a method, apparatus, device, storage medium and program product for narrow air gap adaptive focusing imaging of generators.
[0004] This disclosure provides an embodiment of an adaptive focusing imaging method for a generator with a narrow air gap, the method comprising: The first distance-to-surface value between the imaging end and the measured surface of the generator is obtained based on the first ranging channel, and the second distance-to-surface value between the imaging end and the landing point of the light spot on the measured surface of the generator is obtained based on the second ranging channel. Based on the preset consistency discrimination rule and fusion rule, the fused distance-to-surface value is calculated according to the first distance-to-surface value and the second distance-to-surface value. The filtering intensity is determined based on the current operating state of the imaging end, the fused distance-to-surface value is filtered to obtain the filtered distance-to-surface value, the target distance of the detected surface is obtained, the distance-to-surface error is calculated based on the filtered distance-to-surface value and the target distance, and the control output of the imaging end is determined based on the distance-to-surface error. Based on the filter distance value, the feedforward focus position is determined from the preset lookup table curve. Based on the feedforward focus position and the control output, the test surface image set is obtained through bidirectional progressive search within the preset fine-tuning window. The overall sharpness of the test surface image set in the preset maintenance effective area is calculated to determine the actual focus position. The reliability of the actual focus position is determined, and if the determination result is reliable, the imaging result is output.
[0005] The method provided in this disclosure, based on a first ranging channel, acquires a first distance-to-surface value between the imaging end and the measured surface of the generator; based on a second ranging channel, acquires a second distance-to-surface value between the imaging end and the landing point of the light spot on the measured surface of the generator; and based on preset consistency discrimination rules and fusion rules, calculates a fused distance-to-surface value according to the first and second distance-to-surface values, including: The first ranging channel is determined according to the electrical correlation method, and the first distance-surface value between the imaging end and the measured surface of the generator is obtained based on the first ranging channel. The electrical correlation method includes the eddy current method and the capacitance method. The second ranging channel is determined according to the optical correlation method, and the second distance-surface value between the imaging end and the landing point of the light spot on the measured surface of the generator is obtained based on the second ranging channel. The optical correlation method is a point-line light projection imaging method. Calculate the absolute value of the deviation between the first distance value and the second distance value, and compare the absolute value of the deviation with the consistency threshold in the preset consistency discrimination rule; If the absolute value of the deviation is less than or equal to the consistency threshold, the first distance-to-surface value and the second distance-to-surface value are weighted and summed according to the preset weight in the fusion rule, and the fused distance-to-surface value is output. If the absolute value of the deviation is greater than the consistency threshold, it is determined that there is a ranging anomaly, an alarm is triggered and a degradation strategy is executed. According to the degradation strategy, the first ranging channel and the second ranging channel are self-checked, and the distance-to-surface value of the corresponding ranging channel with a normal self-check result is output as the fused distance-to-surface value.
[0006] The method provided in this disclosure, based on the current operating state of the imaging end, determines the filtering intensity, filters the fused distance-to-surface value to obtain a filtered distance-to-surface value, acquires the target distance of the detected surface, calculates the distance-to-surface error based on the filtered distance-to-surface value and the target distance, and determines the control output of the imaging end based on the distance-to-surface error, including: Based on the current operating status of the imaging end, the filtering intensity is determined from the filtering table, and the fused distance-surface value is filtered according to the filtering intensity to obtain the filtered distance-surface value. The target distance to the surface being measured is obtained, and the target distance is preset with several distance levels according to the current operating state of the imaging end; The distance-to-surface error and the rate of change of the distance-to-surface error are calculated based on the filtered distance-to-surface value and the target distance. A feedback term is determined based on the distance-to-surface error and the rate of change of the distance-to-surface error. A feedforward term is determined based on relevant data of the current operating status of the imaging end. The relevant data includes the imaging end velocity, acceleration, and estimated curvature change. The control output of the imaging end is determined based on the feedforward term and the feedback term.
[0007] The method provided in this disclosure, which determines the feedforward focus position from a preset lookup table curve based on the filtered distance value, acquires a set of images of the tested surface through a bidirectional progressive search within a preset fine-tuning window based on the feedforward focus position and the control output, calculates the overall sharpness of the set of images of the tested surface in a preset maintenance effective area, and determines the actual focus position, includes: The preset lookup table curve is generated by calibrating different distance points and corresponding sharpest focus positions under experimental conditions, and is a fixed version according to the lens model and camera serial number of the imaging end; The feedforward focus position is determined from the preset lookup table curve based on the filter distance value, and the preset fine-tuning window position is determined based on the control output in the neighborhood of the feedforward focus position. The focus end is moved in the preset fine-tuning window according to the bidirectional progressive control. The first test image is obtained at each sampling position according to the preset first step long scan. Image analysis is performed on the first test image, and the direction of the sharpness increase trend is determined according to the image analysis results. Based on the direction of the increase in clarity, a scan is performed according to a preset second step length to obtain the second image under test; The first and second test images are combined to form a test surface image set. Each test surface image in the test surface image set is divided into regions according to the preset maintenance effective area to obtain saturated regions and unsaturated regions. The saturated regions are shielded, and the overall clarity is calculated based on the unsaturated regions of the test surface images. Compare the overall sharpness of all the measured surface images, determine the maximum overall sharpness, and determine the actual focus position based on the focus position corresponding to the maximum overall sharpness.
[0008] The method provided in this disclosure, which determines a preset fine-tuning window position based on the control output in the neighborhood of the feedforward focus position, includes: Extract the state features of the control output, determine the distance-to-surface stability level based on the state features, and calculate the position offset of the window center of the preset fine-tuning window relative to the feedforward focus position based on the distance-to-surface stability level. The feedforward focus position is superimposed with the position offset to determine the center position of the preset fine-tuning window. The half-width of the window is determined according to the distance-to-surface stability level. The preset fine-tuning window position is determined based on the half-width of the window and the center position of the window.
[0009] The method provided in this disclosure embodiment performs a reliability judgment on the actual focus position, and outputs an imaging result if the judgment result is reliable, including: The reliability of the actual focus position is judged. If the maximum value of the overall sharpness is greater than or equal to the preset sharpness threshold, and the drift amount within several consecutive frames acquired at the actual focus position is less than or equal to the preset drift amount, and the saturation pixel ratio of the measured surface image is less than or equal to the preset ratio threshold, then the judgment result is that the actual focus position is reliable. The imaging end is triggered to acquire the final image of the measured surface in a hard trigger mode and output the imaging result. If the following conditions are not met simultaneously: the maximum value of the overall sharpness is greater than or equal to the preset sharpness threshold, the drift amount within several consecutive frames obtained at the actual focus position is less than or equal to the preset drift amount, and the saturation pixel ratio of the measured surface image is less than or equal to the preset ratio threshold, then the actual focus position is deemed unreliable, and a resetting strategy is executed.
[0010] This disclosure also provides an adaptive focusing imaging device for a generator with a narrow air gap, the device comprising: The acquisition module is used to acquire a first distance-to-surface value between the imaging end and the measured surface of the generator based on a first ranging channel, acquire a second distance-to-surface value between the imaging end and the landing point of the light spot on the measured surface of the generator based on a second ranging channel, and calculate a fused distance-to-surface value based on a preset consistency discrimination rule and a fusion rule, according to the first distance-to-surface value and the second distance-to-surface value. The first determining module is used to determine the filtering intensity based on the current operating state of the imaging end, filter the fused distance-to-surface value to obtain the filtered distance-to-surface value, obtain the target distance of the detected surface, calculate the distance-to-surface error based on the filtered distance-to-surface value and the target distance, and determine the control output of the imaging end based on the distance-to-surface error. The second determining module is used to determine the feedforward focus position from the preset lookup table curve according to the filter distance value, and to obtain the image set of the tested surface in a bidirectional progressive search within the preset fine-tuning window based on the feedforward focus position and the control output, and to calculate the comprehensive sharpness of the image set of the tested surface in the preset maintenance effective area to determine the actual focus position. The judgment module is used to judge the reliability of the actual focus position. If the judgment result is reliable, the imaging result is output.
[0011] The apparatus provided in this disclosure, wherein the acquisition module is specifically used for: The first ranging channel is determined according to the electrical correlation method, and the first distance-surface value between the imaging end and the measured surface of the generator is obtained based on the first ranging channel. The electrical correlation method includes the eddy current method and the capacitance method. The second ranging channel is determined according to the optical correlation method, and the second distance-surface value between the imaging end and the landing point of the light spot on the measured surface of the generator is obtained based on the second ranging channel. The optical correlation method is a point-line light projection imaging method. Calculate the absolute value of the deviation between the first distance value and the second distance value, and compare the absolute value of the deviation with the consistency threshold in the preset consistency discrimination rule; If the absolute value of the deviation is less than or equal to the consistency threshold, the first distance-to-surface value and the second distance-to-surface value are weighted and summed according to the preset weight in the fusion rule, and the fused distance-to-surface value is output. If the absolute value of the deviation is greater than the consistency threshold, it is determined that there is a ranging anomaly, an alarm is triggered and a degradation strategy is executed. According to the degradation strategy, the first ranging channel and the second ranging channel are self-checked, and the distance-to-surface value of the corresponding ranging channel with a normal self-check result is output as the fused distance-to-surface value.
[0012] The apparatus provided in this disclosure embodiment, wherein the first determining module is specifically used for: Based on the current operating status of the imaging end, the filtering intensity is determined from the filtering table, and the fused distance-surface value is filtered according to the filtering intensity to obtain the filtered distance-surface value. The target distance to the surface being measured is obtained, and the target distance is preset with several distance levels according to the current operating state of the imaging end; The distance-to-surface error and the rate of change of the distance-to-surface error are calculated based on the filtered distance-to-surface value and the target distance. A feedback term is determined based on the distance-to-surface error and the rate of change of the distance-to-surface error. A feedforward term is determined based on relevant data of the current operating status of the imaging end. The relevant data includes the imaging end velocity, acceleration, and estimated curvature change. The control output of the imaging end is determined based on the feedforward term and the feedback term.
[0013] The apparatus provided in this disclosure embodiment, wherein the second determining module is specifically used for: The preset lookup table curve is generated by calibrating different distance points and corresponding sharpest focus positions under experimental conditions, and is a fixed version according to the lens model and camera serial number of the imaging end; The feedforward focus position is determined from the preset lookup table curve based on the filter distance value, and the preset fine-tuning window position is determined based on the control output in the neighborhood of the feedforward focus position. The focus end is moved in the preset fine-tuning window according to the bidirectional progressive control. The first test image is obtained at each sampling position according to the preset first step long scan. Image analysis is performed on the first test image, and the direction of the sharpness increase trend is determined according to the image analysis results. Based on the direction of the increase in clarity, a scan is performed according to a preset second step length to obtain the second image under test; The first and second test images are combined to form a test surface image set. Each test surface image in the test surface image set is divided into regions according to the preset maintenance effective area to obtain saturated regions and unsaturated regions. The saturated regions are shielded, and the overall clarity is calculated based on the unsaturated regions of the test surface images. Compare the overall sharpness of all the measured surface images, determine the maximum overall sharpness, and determine the actual focus position based on the focus position corresponding to the maximum overall sharpness.
[0014] The apparatus provided in this disclosure embodiment, wherein the second determining module is specifically used for: Extract the state features of the control output, determine the distance-to-surface stability level based on the state features, and calculate the position offset of the window center of the preset fine-tuning window relative to the feedforward focus position based on the distance-to-surface stability level. The feedforward focus position is superimposed with the position offset to determine the center position of the preset fine-tuning window. The half-width of the window is determined according to the distance-to-surface stability level. The preset fine-tuning window position is determined based on the half-width of the window and the center position of the window.
[0015] The apparatus provided in this disclosure, wherein the determining module is specifically used for: The reliability of the actual focus position is judged. If the maximum value of the overall sharpness is greater than or equal to the preset sharpness threshold, and the drift amount within several consecutive frames acquired at the actual focus position is less than or equal to the preset drift amount, and the saturation pixel ratio of the measured surface image is less than or equal to the preset ratio threshold, then the judgment result is that the actual focus position is reliable. The imaging end is triggered to acquire the final image of the measured surface in a hard trigger mode and output the imaging result. If the following conditions are not met simultaneously: the maximum value of the overall sharpness is greater than or equal to the preset sharpness threshold, the drift amount within several consecutive frames obtained at the actual focus position is less than or equal to the preset drift amount, and the saturation pixel ratio of the measured surface image is less than or equal to the preset ratio threshold, then the actual focus position is deemed unreliable, and a resetting strategy is executed.
[0016] This disclosure also provides an electronic device, the electronic device comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the instructions to implement the generator narrow air gap adaptive focusing imaging method provided in this disclosure.
[0017] This disclosure also provides a computer-readable storage medium storing a computer program for performing the generator narrow air gap adaptive focusing imaging method provided in this disclosure.
[0018] The technical solution provided in this disclosure has the following advantages compared with the prior art: The adaptive focusing imaging method for generators with narrow air gaps provided in this disclosure acquires a first distance-to-surface value and a second distance-to-surface value through a first ranging channel and a second ranging channel, respectively. A fused distance-to-surface value is calculated based on preset consistency discrimination rules and fusion rules. The filtering intensity is determined according to the current operating state of the imaging end, and the fused distance-to-surface value is filtered to obtain a filtered distance-to-surface value. The distance to the target surface is obtained, and the distance-to-surface error is calculated to determine the control output of the imaging end. The filtered distance-to-surface value is used to look up the feedforward focusing position in a table. Combined with the control output, a bidirectional progressive search is performed within a fine-tuning window to acquire the image set of the measured surface. The comprehensive sharpness of the effective maintenance area is calculated to determine the actual focusing position. After reliability judgment, the imaging result is output or a resetting strategy is executed. Redundant ranging fusion improves the reliability of narrow air gap ranging, feedforward feedback composite control ensures distance-to-surface safety, table lookup feedforward and control constraints accelerate focusing convergence, and saturation shielding and resetting strategies ensure imaging quality, achieving safe, clear, and efficient automated detection in confined spaces. Attached Figure Description
[0019] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0020] Figure 1 This is a schematic flowchart of a generator narrow air gap adaptive focusing imaging method provided in an embodiment of this disclosure; Figure 2 This is a schematic diagram of the structure of a generator narrow air gap adaptive focusing imaging device provided in an embodiment of the present disclosure; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0021] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0022] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0023] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0024] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0025] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0026] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0027] To address the aforementioned issues, this disclosure provides a method for adaptive focusing imaging of generators with narrow air gaps. The method will be described below with reference to specific embodiments.
[0028] Figure 1 This is a flowchart illustrating a method for adaptive focusing imaging of a generator with a narrow air gap, provided by an embodiment of this disclosure. This method can be executed by a device for adaptive focusing imaging of a generator with a narrow air gap, wherein the device can be implemented in software and / or hardware, and is generally integrated into an electronic device.
[0029] Example 1: This embodiment of the present disclosure provides a method for adaptive focusing imaging of generators with narrow air gaps, such as... Figure 1 As shown, it includes: S101: Based on the first ranging channel, obtain the first distance-to-surface value between the imaging end and the measured surface of the generator; based on the second ranging channel, obtain the second distance-to-surface value between the imaging end and the landing point of the light spot on the measured surface of the generator; based on the preset consistency discrimination rule and fusion rule, calculate the fused distance-to-surface value according to the first distance-to-surface value and the second distance-to-surface value. S102: Determine the filtering intensity based on the current operating state of the imaging end, filter the fused distance-to-surface value to obtain the filtered distance-to-surface value, obtain the target distance of the detected surface, calculate the distance-to-surface error based on the filtered distance-to-surface value and the target distance, and determine the control output of the imaging end based on the distance-to-surface error; S103: Determine the feedforward focus position from the preset lookup table curve according to the filter distance value, and obtain the test surface image set by bidirectional progressive search within the preset fine-tuning window based on the feedforward focus position and the control output, calculate the comprehensive sharpness of the test surface image set in the preset maintenance effective area, and determine the actual focus position. S104: Determine the reliability of the actual focus position. If the determination result is reliable, output the imaging result.
[0030] In this embodiment, the imaging end refers to the integrated vision inspection module mounted on the robot's end effector, which includes a global shutter industrial camera, an electric focusing lens, an eddy current or capacitive first ranging probe, a point-line light projector, and a miniature linear distance-to-surface execution unit. It is the end effector that performs narrow air gap image acquisition and distance-to-surface adjustment.
[0031] In this embodiment, the first ranging channel is a hardware path that uses the principle of eddy current or capacitance sensing. It is installed at the front end of the imaging module and directly measures the physical gap between the probe end face and the surface of the metal substrate of the generator through electromagnetic induction or electric field coupling effect. It outputs a distance-to-surface signal that is not affected by ambient light, surface texture and oil stains.
[0032] In this embodiment, the first distance value is the raw distance data output by the first ranging channel, representing the normal physical distance between the front end face of the imaging end and the surface of the measured metal substrate of the generator, in millimeters.
[0033] In this embodiment, the second ranging channel is an optical ranging path that uses a point light or line light projector in conjunction with an imaging camera. The projector emits a light spot or light stripe onto the surface being measured, and the camera captures the position offset of the light spot in the image, which is then converted into a distance value using a triangulation calibration table.
[0034] In this embodiment, the second distance-to-surface value is visual reference distance data output by the second ranging channel, representing the normal distance between the front surface of the imaging end and the surface where the light spot lands. This value depends on the diffuse reflection optical characteristics of the measured surface and is affected by surface reflection, color, and dirt, and is used for redundancy verification with the first distance-to-surface value.
[0035] In this embodiment, the consistency threshold in the preset consistency discrimination rule is a pre-set upper limit for deviation tolerance. When the absolute value of the deviation is less than or equal to the consistency threshold, the ranging results of the two channels are determined to be consistent, and weighted fusion can be performed; when the absolute value of the deviation is greater than the consistency threshold, a ranging anomaly is determined to exist, an alarm is triggered, and the process is switched to a degradation strategy.
[0036] In this embodiment, the fusion rule is a distance-to-surface value synthesis strategy executed when the absolute value of the deviation does not exceed the consistency threshold. The first and second distance-to-surface values are weighted and summed according to preset weight coefficients, with the sum of the weights equal to one. The fusion rule aims to combine the stability of the electrical correlation channel with the coaxiality advantage of the optical correlation channel.
[0037] In this embodiment, the fused distance-plane value is the comprehensive distance-plane value output after consistency discrimination and fusion rule processing. Under normal operating conditions, it is the weighted sum of the two channels; under abnormal operating conditions, it is downgraded to the original output of the self-test normal channel. This value serves as the unified distance-plane input reference for subsequent filtering, control, and focusing processes.
[0038] In this embodiment, the current operating status of the imaging end is an identifier of the current operating mode of the imaging end's distance-to-surface control system, which is divided into four categories: stable movement, docking and acquisition, turning transition, and abnormal approach. The operating status is comprehensively determined by the distance-to-surface error and its rate of change, combined with the robot's motion commands, and is used to determine the switching of filter intensity, target distance level, and control gain.
[0039] In this embodiment, the filtering intensity is a parameter representing the degree of suppression when performing low-delay filtering on the fused distance-surface values. Strong vibration suppression filtering is used in the docked acquisition state to ensure distance-surface stability; low-delay filtering is used in the constant-speed travel state to ensure real-time response; and balanced filtering is used in turning transitions and abnormal approach states to balance stability and rapid following.
[0040] In this embodiment, the target distance is the ideal working distance setting value that the imaging end-to-surface control is expected to maintain. Multiple preset gears are configured according to the generator slot or axial segment, automatically switching when entering different areas, and a stability range is defined by an allowable fluctuation band.
[0041] In this embodiment, the distance-to-surface error is the difference between the filtered distance-to-surface value and the target distance. The calculation formula is that the distance-to-surface error equals the filtered distance-to-surface value minus the target distance. The distance-to-surface error reflects the instantaneous deviation between the current physical position of the imaging end and the desired position. It is the core input variable for feedback control, and the positive or negative sign indicates the direction of deviation towards or away from the target.
[0042] In this embodiment, the control output is the final control command generated by superimposing the feedforward and feedback terms. It can be converted into actuator displacement or velocity commands, which, after being limited by output amplitude and slope, drive the miniature linear actuator. The control output includes distance-to-surface control, focus control, camera triggering, light source linkage, and data recording. The imaging control unit establishes communication with the main controller, receives pose, velocity, acceleration, acquisition cycle, and safety commands, and outputs docking, deceleration, and retreat requests to the main controller.
[0043] In this embodiment, the feedforward focus position is the initial target position of the focusing actuator obtained by looking up a preset lookup table curve based on the filter distance value. The feedforward focus position corresponds to the theoretically clearest focus position at this object distance in the experimental calibration. It is used to drive the focusing motor to quickly bypass the invalid stroke and directly land near the optimal imaging plane, serving as the starting point for subsequent fine-tuning searches.
[0044] In this embodiment, the image set of the tested surface is an image sequence composed of a first image and a second image. Each frame in the image set corresponds to a sampling position of a focusing actuator and contains complete imaging information of the generator's tested surface.
[0045] In this embodiment, the preset maintenance effective area is a region of interest pre-defined in the image coordinate system. The preset maintenance effective area corresponds to key inspection parts within the generator slots, such as stator slot wedges and ventilation groove edges. Sharpness calculations are performed only within this area, eliminating interference from the background and non-maintenance areas, thus improving the targeting and computational efficiency of sharpness evaluation.
[0046] In this embodiment, the overall sharpness is a comprehensive image sharpness index calculated within the unsaturated region. It is composed of a weighted superposition of gradient energy and high-frequency energy, where gradient energy reflects the sharpness of image edges and high-frequency energy reflects the richness of image details. A higher overall sharpness value indicates a sharper image of the measured surface.
[0047] In this embodiment, the actual focus position is the position of the focusing actuator corresponding to the maximum overall sharpness after comparing the overall sharpness of all images in the image set of the measured surface. The actual focus position is the optimal solution for optical focusing under the current distance from the surface and operating conditions. After passing reliability verification, it is locked and used as the target coordinate of the focusing motor during the final acquisition.
[0048] In this embodiment, the feedforward focus position is determined from the preset lookup table curve by filtering the distance to the surface value. The control output determines the fine-tuning window in the neighborhood of the feedforward focus position. The first and second test images are obtained by bidirectional progressive scanning to form a test surface image set. The saturated area is divided and shielded according to the preset maintenance effective area. The comprehensive sharpness is calculated to determine the actual focus position corresponding to the maximum value.
[0049] In this embodiment, the bidirectional progressive search refers to the focusing end first scanning along the forward and reverse directions with a first step length within a preset fine-tuning window to acquire the first image under test, analyzing the changes in sharpness to determine the upward trend direction, and then finely scanning along that direction with a second step length smaller than the first step length to acquire the second image under test. This is a focus search strategy that quickly locks the sharpness peak position through bidirectional exploration with variable step length.
[0050] In this embodiment, reliability judgment is a multi-dimensional verification process to determine whether the actual focus position is usable. It comprehensively examines whether the maximum overall sharpness meets the standard, whether the focus position drift exceeds limits across several consecutive frames, and whether the saturation pixel ratio is too high. If all three conditions are met simultaneously, the system is deemed reliable; otherwise, it is deemed unreliable and a resetting process is triggered.
[0051] In this embodiment, the imaging result is a data packet with the final image of the measured surface as the core and attached binding fields. The binding fields include filter distance from the surface, actuator position, actual focus position, overall sharpness, saturation pixel ratio, timestamp, robot pose, and running status identifier.
[0052] In this embodiment, the imaging end consists of an industrial camera and a lens. The camera preferentially uses a global shutter to suppress motion artifacts. The lens has a structure with motorized focusing capability, and the focal length is selected according to the air gap distance and field of view requirements.
[0053] In this embodiment, each image frame is bound to and recorded with the following fields: filter distance to plane value, actuator position, actual focus position, exposure time, gain, light source parameters, timestamp, robot pose, slot number axial coordinate, maximum overall sharpness, saturation ratio, operating status indicator, and output quality report, which at least includes the mean and standard deviation of the distance to plane error statistics; sharpness statistics and focus lock success rate; number of abnormal approach and retreat times; and number of degradation times and reason code statistics. If re-acquisition occurs, the re-acquisition trigger reason, parameter adjustment trajectory, and final valid frame index are recorded to ensure a closed-loop and auditable evidence chain.
[0054] In this embodiment, the robot enters a docking and data acquisition state after reaching the target slot. Distance-to-surface control first stabilizes the filtered distance-to-surface value to the target distance and maintains this stability for a period of time, then performs focus feedforward and fine-tuning lock, followed by triggering data acquisition. The filtered distance-to-surface value, actuator position, actual focus position, and maximum overall sharpness are recorded before and after acquisition. The robot carrying the imaging end moves at a constant speed, and distance-to-surface control uses low-gain tracking to prioritize stability and prevent oscillations. Focusing primarily uses feedforward, and sharpness feedback is updated at a low frequency. Short exposures and light source linkage are used when triggering acquisition to reduce motion blur. Data acquisition can be triggered by distance or by time interval.
[0055] In this embodiment, the robot is responsible for positioning over a wide area, controlling the output to direct the actuator to drive the imaging end to perform precision position compensation, and after the imaging end stabilizes, the focusing end independently drives the lens to rotate to complete clear focusing.
[0056] The working principle and beneficial effects of this embodiment are as follows: First and second distance-to-surface values are obtained through the first and second ranging channels, respectively. A fused distance-to-surface value is calculated based on preset consistency discrimination rules and fusion rules. The filtering intensity is determined according to the current operating state of the imaging end, and the fused distance-to-surface value is filtered to obtain the filtered distance-to-surface value. The target distance on the surface being inspected is obtained, and the distance-to-surface error is calculated to determine the control output of the imaging end. The filtered distance-to-surface value is used to look up the table to obtain the feedforward focusing position. Combined with the control output, a bidirectional progressive search is performed within the fine-tuning window to obtain the image set of the surface being inspected. The comprehensive sharpness of the effective inspection area is calculated to determine the actual focusing position. After reliability judgment, the imaging result is output or a reshaping strategy is executed. Redundant ranging fusion improves the reliability of narrow air gap ranging, feedforward feedback composite control ensures distance-to-surface safety, lookup table feedforward and control constraints accelerate focusing convergence, and saturation shielding and reshaping strategies ensure imaging quality, achieving safe, clear, and efficient automated inspection in confined spaces.
[0057] Example 2: The method provided in this embodiment of the present disclosure acquires a first distance-to-surface value between the imaging end and the measured surface of the generator based on a first ranging channel, acquires a second distance-to-surface value between the imaging end and the landing point of the light spot on the measured surface of the generator based on a second ranging channel, and calculates a fused distance-to-surface value based on a preset consistency discrimination rule and a fusion rule, including: The first ranging channel is determined according to the electrical correlation method, and the first distance-surface value between the imaging end and the measured surface of the generator is obtained based on the first ranging channel. The electrical correlation method includes the eddy current method and the capacitance method. The second ranging channel is determined according to the optical correlation method, and the second distance-surface value between the imaging end and the landing point of the light spot on the measured surface of the generator is obtained based on the second ranging channel. The optical correlation method is a point-line light projection imaging method. Calculate the absolute value of the deviation between the first distance value and the second distance value, and compare the absolute value of the deviation with the consistency threshold in the preset consistency discrimination rule; If the absolute value of the deviation is less than or equal to the consistency threshold, the first distance-to-surface value and the second distance-to-surface value are weighted and summed according to the preset weight in the fusion rule, and the fused distance-to-surface value is output. If the absolute value of the deviation is greater than the consistency threshold, it is determined that there is a ranging anomaly, an alarm is triggered and a degradation strategy is executed. According to the degradation strategy, the first ranging channel and the second ranging channel are self-checked, and the distance-to-surface value of the corresponding ranging channel with a normal self-check result is output as the fused distance-to-surface value.
[0058] In this embodiment, the first distance between the measured surfaces specifically refers to the gap distance between the imaging end of the first ranging channel and the measured metal substrate surface of the generator. The measured surface refers to the inner wall of the generator stator core or the outer circular surface of the rotor body, and the first distance reflects the actual spatial margin between the sensor probe and the metal substrate.
[0059] In this embodiment, the eddy current method and the capacitive method differ in that the eddy current method uses a high-frequency alternating magnetic field to generate induced eddy currents on the metal surface, and the distance is calculated by converting eddy current losses; the capacitive method uses the characteristic that the capacitance between the probe and the metal surface changes with the gap to calculate the distance. Both are insensitive to light and texture, and are suitable for narrow-gap metal environments.
[0060] In this embodiment, the point-line light projection imaging method is the ranging principle of the second ranging channel. A point or line light projector emits a structured light spot onto the surface being measured, and an imaging camera captures an image of the light spot at a fixed angle. The pixel coordinates of the light spot in the image shift as the object distance changes, and the coordinate shift is converted into a distance value through a pre-calibrated mapping table.
[0061] In this embodiment, the absolute value of the deviation is the absolute value of the difference between the first distance measurement value and the second distance measurement value, which is equal to the absolute value of the first distance measurement value minus the absolute value of the second distance measurement value. This is used to quantify the consistency of the outputs from the two ranging channels. The corresponding formula is: ,in Indicates the absolute value of the deviation; Indicates the first distance from the surface; This represents the second distance from the surface.
[0062] In this embodiment, the preset weights are weighting coefficients assigned to the first and second distance values in the fusion rules. The weight values are preset based on the confidence levels of the two channels under specific operating conditions and can be dynamically adjusted according to the operating status or region. The corresponding fusion formula is as follows: Where r represents the fusion distance from the surface; This represents the preset weighting coefficient for the first distance from the surface value; This represents the preset weighting coefficient for the second distance from the surface value.
[0063] In this embodiment, ranging anomaly is an abnormal state determined when the absolute value of the deviation exceeds the consistency threshold. This indicates that at least one ranging channel is interfered with or malfunctioning, causing inaccurate output. Possible causes include damage to the electrical correlation channel probe, blinding of the optical correlation channel by strong reflections, or obstruction by dirt on the measured surface.
[0064] In this embodiment, the degradation strategy is a fault-tolerant processing procedure after a ranging anomaly is triggered. A self-check is performed on the first and second ranging channels. Based on the self-check status, a normal channel is selected, and the distance-to-surface value of that channel is directly output as the fused distance-to-surface value. The degradation reason code is recorded for subsequent auditing and tracing.
[0065] In this embodiment, the self-test is a procedure for detecting the hardware status and signal validity of the first and second ranging channels. The detection includes checking the sensor power supply voltage, communication link status, whether the signal amplitude falls within the valid range, and whether short-term fluctuations exceed thresholds. The self-test results determine the channel selection for the degradation strategy.
[0066] In this embodiment, the self-test result is a channel status identifier output after the self-test program is executed. A "normal" identifier indicates that the channel hardware is intact and the signal is valid, while an "abnormal" identifier indicates that the channel is faulty or disturbed. The degradation strategy selects the output of the normal channel as the fusion distance value based on the self-test result.
[0067] The working principle and beneficial effects of this embodiment are as follows: First distance-to-surface value and second distance-to-surface value are obtained through electrical correlation and optical correlation methods respectively. The absolute value of the deviation is calculated and compared with the consistency threshold. If the deviation does not exceed the threshold, the fused distance-to-surface value is output by weighted summation according to preset weights. If the deviation exceeds the threshold, an alarm is triggered and a degradation strategy is executed. The distance-to-surface value of the self-tested normal channel is output as the fused distance-to-surface value. The redundant electrical correlation and optical correlation ranging channels automatically switch the reliable source when a single channel is interfered with by reflection or oil stains through consistency discrimination and degradation strategy, so as to avoid collision caused by distance-to-surface jump. Weighted fusion and self-test screening improve the reliability of narrow air gap ranging and ensure the data foundation for subsequent control and focusing.
[0068] Example 3: The method provided in this embodiment of the present disclosure determines the filtering intensity based on the current operating state of the imaging end, filters the fused distance-to-surface value to obtain a filtered distance-to-surface value, obtains the target distance of the detected surface, calculates the distance-to-surface error based on the filtered distance-to-surface value and the target distance, and determines the control output of the imaging end based on the distance-to-surface error, including: Based on the current operating status of the imaging end, the filtering intensity is determined from the filtering table, and the fused distance-surface value is filtered according to the filtering intensity to obtain the filtered distance-surface value. The target distance to the surface being measured is obtained, and the target distance is preset with several distance levels according to the current operating state of the imaging end; The distance-to-surface error and the rate of change of the distance-to-surface error are calculated based on the filtered distance-to-surface value and the target distance. A feedback term is determined based on the distance-to-surface error and the rate of change of the distance-to-surface error. A feedforward term is determined based on relevant data of the current operating status of the imaging end. The relevant data includes the imaging end velocity, acceleration, and estimated curvature change. The control output of the imaging end is determined based on the feedforward term and the feedback term.
[0069] In this embodiment, the filtering table is a pre-established mapping table between operating states and filtering intensities. The table configures corresponding filtering parameter groups for four states: stable travel, docked acquisition, turning transition, and abnormal approach. The system looks up and calls the table in real time according to the current operating state of the imaging end to achieve adaptive switching of filtering strategies.
[0070] In this embodiment, the filtered distance-to-surface value is the distance-to-surface signal output after the fused distance-to-surface value has been processed with a filtering intensity matched to the current operating state of the imaging end. The filtered distance-to-surface value filters out vibration noise in the narrow air gap of the generator and high-frequency glitches in the ranging channel, serving as a unified input benchmark for distance-to-surface error calculation, control solution, and focus lookup.
[0071] In this embodiment, the rate of change of the distance-to-surface error is the amount of change of the distance-to-surface error per unit time, i.e., the derivative of the distance-to-surface error with respect to time. The rate of change of the distance-to-surface error reflects the speed of relative motion between the imaging end and the measured surface, and is used in the differential term calculation of PID control to suppress oscillations, while also serving as a trigger criterion for abnormal proximity states.
[0072] In this embodiment, the feedback term is a control component generated by performing proportional-integral-differential operations on the distance-to-plane error. It is a weighted superposition of the proportional term of the distance-to-plane error, the integral term of the accumulated distance-to-plane error, and the differential term of the rate of change of the distance-to-plane error. It is used to eliminate the current distance-to-plane deviation, causing the imaging end to converge to the target distance. The corresponding specific formula is as follows: ,in, Indicates feedback items; Indicates the proportional gain coefficient; Indicates the integral gain coefficient; Indicates distance from surface error; This indicates the rate of change of distance-to-surface error; Represents the differential gain coefficient; This indicates the cumulative distance-to-surface error.
[0073] In this embodiment, the feedforward term is a control component pre-calculated from relevant data of the current operating state of the imaging end. Compensation commands are generated in advance based on the imaging end's velocity, acceleration, and estimated curvature changes. The feedforward term is used to counteract the disturbance of the distance plane by the robot's motion, actively adjusting the actuator before the distance plane error changes significantly.
[0074] In this embodiment, the imaging end velocity refers to the instantaneous linear velocity of the imaging module driven by the robot; acceleration refers to the rate of change of velocity; and the estimated curvature change refers to the change in the path curvature calculated in advance based on the robot trajectory. These three parameters are obtained from the robot's main control communication and used as input parameters for feedforward term calculation.
[0075] The working principle and beneficial effects of this embodiment are as follows: The filtering intensity is determined from the filtering table based on the current operating state of the imaging end; the fused distance-to-surface value is filtered to obtain the filtered distance-to-surface value; the target distance at a preset level according to the operating state is obtained; the distance-to-surface error and rate of change are calculated to determine the feedback term; the feedforward term is determined based on the velocity acceleration and estimated curvature change; the feedforward term and the feedback term are superimposed to determine the control output. The filtering intensity is matched with the operating state to balance distance-to-surface signal stability and real-time response. The target distance level is switched according to the state to adapt to different detection areas. The feedforward term compensates for motion disturbances in advance, the feedback term eliminates steady-state errors, and the composite control improves the accuracy of narrow air gap distance-to-surface tracking and vibration resistance, reducing the risk of collision.
[0076] Example 4: The method provided in this embodiment of the present disclosure determines the feedforward focus position from a preset lookup table curve based on the filter distance surface value, acquires a set of images of the tested surface through a bidirectional progressive search within a preset fine-tuning window based on the feedforward focus position and the control output, calculates the overall sharpness of the set of images of the tested surface in a preset maintenance effective area, and determines the actual focus position, including: The preset lookup table curve is generated by calibrating different distance points and corresponding sharpest focus positions under experimental conditions, and is a fixed version according to the lens model and camera serial number of the imaging end; The feedforward focus position is determined from the preset lookup table curve based on the filter distance value, and the preset fine-tuning window position is determined based on the control output in the neighborhood of the feedforward focus position. The focus end is moved in the preset fine-tuning window according to the bidirectional progressive control. The first test image is obtained at each sampling position according to the preset first step long scan. Image analysis is performed on the first test image, and the direction of the sharpness increase trend is determined according to the image analysis results. Based on the direction of the increase in clarity, a scan is performed according to a preset second step length to obtain the second image under test; The first and second test images are combined to form a test surface image set. Each test surface image in the test surface image set is divided into regions according to the preset maintenance effective area to obtain saturated regions and unsaturated regions. The saturated regions are shielded, and the overall clarity is calculated based on the unsaturated regions of the test surface images. Compare the overall sharpness of all the measured surface images, determine the maximum overall sharpness, and determine the actual focus position based on the focus position corresponding to the maximum overall sharpness.
[0077] In this embodiment, the preset lookup table curve is a mapping function between pre-calibrated distance points and the sharpest focus position under experimental conditions. The focus actuator positions with the highest sharpness are obtained at multiple discrete physical distances, forming a one-to-one correspondence data table.
[0078] In this embodiment, the lens model and camera serial number are fixed versions using a preset lookup table curve as the version identifier. Since different lens models have different optical back focal lengths and different cameras have tolerances in flange distance, the lookup table curve needs to be bound to a specific lens model and camera serial number. After being fixed, it serves as the unique calibration data for the imaging module and is automatically matched and called during on-site loading.
[0079] In this embodiment, the preset fine-tuning window position is a local search range boundary adaptively determined based on the control output state characteristics within the neighborhood of the feedforward focus position. The window position is defined by the window center position and the window half-width. The window center can shift with the stability of the distance from the surface, and the window size is dynamically adjusted with the control output amplitude.
[0080] In this embodiment, the neighborhood of the feedforward focus position is a local area surrounding the feedforward focus position. This area represents the spatial range for fine-tuning the focus, within which movement of the focus actuator will not cause severe defocusing of the image. The size of the neighborhood is determined by a combination of the depth-of-field range of the focusing system and the residual error of the distance-plane control.
[0081] In this embodiment, the preset first step length is a relatively large movement step used in the first stage of bidirectional progressive scanning. It is used to quickly traverse sampling positions within a preset fine-tuning window to acquire the first image under test. By comparing the sharpness changes at adjacent positions, the direction of the sharpness increase trend is confirmed, invalid sampling points are reduced, and search convergence is accelerated.
[0082] In this embodiment, the sampling positions are discrete points where the focusing actuator stops sequentially within a preset fine-tuning window according to a preset step size. Each sampling position corresponds to a specific travel coordinate of the focusing actuator, and the camera is triggered to acquire an image of the measured surface at the sampling position. The sequence of sampling positions constitutes a spatial sampling grid for focus search.
[0083] In this embodiment, the first image under test is an image of the surface under test captured by the camera at various sampling positions within the fine-tuning window with a preset step length. The sparse sampling points covered by the first image under test within the window are used to quickly assess the overall trend of sharpness change with focus position and determine the movement direction of subsequent fine scanning.
[0084] In this embodiment, image analysis is a pre-evaluation of the sharpness of the first image under test. Within a preset inspection area, image gradients or frequency domain features are statistically analyzed to calculate a simplified sharpness index. The purpose of image analysis is to quickly determine the trend of sharpness increase or decrease with changes in focus position, without needing to achieve the accuracy required for the final comprehensive sharpness calculation.
[0085] In this embodiment, the image analysis result is a conclusion regarding the trend of sharpness change output by the image analysis. It is typically represented as an indicator of the increasing or decreasing direction of sharpness value as the sampling position moves. The image analysis result directly determines the direction of movement for the second step scan, ensuring that the fine scan is performed along the direction of increasing sharpness and avoiding invalid reverse searches.
[0086] In this embodiment, the direction of the sharpness increase trend is the direction in which the overall sharpness increases with the change of focus position, as indicated by the image analysis results. Continuing to move the focusing actuator along this direction of sharpness increase is expected to continuously improve the sharpness of the measured surface image. The second long scan is performed only along this direction to narrow the search range and accelerate peak localization.
[0087] In this embodiment, the preset second step size is a smaller step size than the first step size used when performing fine scanning along the direction of increasing sharpness. The second step size is used to densely sample within a local interval along the direction of increasing sharpness to acquire the second image under test, thereby approximating the focus position corresponding to the maximum overall sharpness with higher spatial resolution.
[0088] In this embodiment, the second image under test is a surface image of the test surface captured by the camera at various sampling positions along the direction of increasing sharpness with a preset second step size. The second image under test covers dense sampling points along the trend direction to finely distinguish the position of sharpness peaks, and together with the first image under test, constitutes the surface image set under test.
[0089] In this embodiment, region division involves dividing the surface image under test into effective and invalid regions according to a preset effective inspection area boundary. Within the effective region, it is further divided into saturated and unsaturated regions based on a grayscale threshold. Region division allows the sharpness calculation to focus on meaningful image content, avoiding interference from invalid pixels in the evaluation results.
[0090] In this embodiment, the saturated region refers to the overexposed area in the image of the tested surface where the pixel grayscale value exceeds a preset threshold, usually caused by strong reflection from the metal surface; the unsaturated region refers to the normal imaging area where the grayscale value is within the effective dynamic range. The saturated region is masked before the sharpness calculation, and the calculation is based only on the unsaturated region.
[0091] The working principle and beneficial effects of this embodiment are as follows: the feedforward focus position is determined from a preset lookup table curve by filtering the surface value; the control output determines a fine-tuning window in the neighborhood of the feedforward focus position; bidirectional progressive scanning acquires a set of the first and second tested images to form a set of tested surface images; the surface is divided according to a preset maintenance effective area and saturated areas are shielded; and the comprehensive sharpness is calculated to determine the actual focus position corresponding to the maximum value. This achieves a combination of rapid focus feedforward positioning and control output constraint fine-tuning under narrow air gap conditions; bidirectional progressive variable step size scanning accelerates sharpness peak search; saturated shielding of the maintenance effective area eliminates metal reflection interference; and locking the maximum comprehensive sharpness improves the accuracy and anti-interference capability of determining the actual focus position.
[0092] Example 5: The method provided in this embodiment of the present disclosure, which determines the position of a preset fine-tuning window based on the control output in the neighborhood of the feedforward focus position, includes: Extract the state features of the control output, determine the distance-to-surface stability level based on the state features, and calculate the position offset of the window center of the preset fine-tuning window relative to the feedforward focus position based on the distance-to-surface stability level. The feedforward focus position is superimposed with the position offset to determine the center position of the preset fine-tuning window. The half-width of the window is determined according to the distance-to-surface stability level. The preset fine-tuning window position is determined based on the half-width of the window and the center position of the window.
[0093] In this embodiment, the state features are a set of quantitative indicators extracted from the control output, including the current amplitude of the control output, the peak-to-peak fluctuation range within the preset observation window, and the rate of change. The state features are used to objectively describe the instantaneous intensity and stability of the imaging end-plane control.
[0094] In this embodiment, the distance-to-surface stability level is determined by comparing state characteristics with a preset threshold, classifying the smoothness of distance-to-surface control. It is divided into three levels: highly stable, moderately stable, and understability. High stability indicates small control output amplitude and low fluctuation, while understability indicates large control output amplitude or severe fluctuation. The level determines subsequent window parameters.
[0095] In this embodiment, the window center is the geometric center position of the preset fine-tuning window, which is determined by the superposition of the feedforward focus position and the position offset. The window center is a symmetrical reference point for the bidirectional progressive scanning of focus, and its position is dynamically adjusted according to the stability of the distance plane. When stable, it coincides with the feedforward focus position, and when fluctuating, it is pre-biased in the direction indicated by the control output.
[0096] In this embodiment, the position offset is the offset distance and direction of the window center relative to the feedforward focus position. It is calculated based on the surface stability level. When highly stable, the offset is zero; when generally stable, a unidirectional offset is generated according to the control output amplitude direction; and when understability, a symmetrical extended offset is generated.
[0097] In this embodiment, the center position of the window is the absolute coordinate value obtained by superimposing the feedforward focus position and the position offset, which serves as the symmetry center of the preset fine-tuning window.
[0098] In this embodiment, the window half-width is the radius of the search range extending from the center of the window to both sides. It is determined by the stability level of the surface; a smaller half-width is used for finer searching when the surface is highly stable, and a larger half-width is used to cover focus shifts when the surface is less stable. The window half-width and the window center position together define the complete boundary of the fine-tuning window.
[0099] The working principle and beneficial effects of this embodiment are as follows: The control output state features are extracted to determine the stability level of the distance-plane, the position offset is calculated, and the position is superimposed with the feedforward focus position to determine the window center position. The half-width of the window is determined according to the level, and a preset fine-tuning window position is determined. This enables the fine-tuning window position and size to adaptively adjust with the stability level of the distance-plane; when stable, the window is reduced for fine searching; when fluctuating, the window is expanded to cover the focus offset, thus improving focusing robustness.
[0100] Example 6: The method provided in this embodiment of the present disclosure performs a reliability judgment on the actual focus position, and outputs an imaging result if the judgment result is reliable, including: The reliability of the actual focus position is judged. If the maximum value of the overall sharpness is greater than or equal to the preset sharpness threshold, and the drift amount within several consecutive frames acquired at the actual focus position is less than or equal to the preset drift amount, and the saturation pixel ratio of the measured surface image is less than or equal to the preset ratio threshold, then the judgment result is that the actual focus position is reliable. The imaging end is triggered to acquire the final image of the measured surface in a hard trigger mode and output the imaging result. If the following conditions are not met simultaneously: the maximum value of the overall sharpness is greater than or equal to the preset sharpness threshold, the drift amount within several consecutive frames obtained at the actual focus position is less than or equal to the preset drift amount, and the saturation pixel ratio of the measured surface image is less than or equal to the preset ratio threshold, then the actual focus position is deemed unreliable, and a resetting strategy is executed.
[0101] In this embodiment, the preset sharpness threshold is a pre-defined minimum acceptable value for overall sharpness. It is determined by statistical analysis of sharpness under normal imaging conditions in the experiment. When the maximum value of overall sharpness is greater than or equal to this threshold, it indicates that the edge sharpness and detail richness of the tested surface image meet the detection requirements, and the focusing result is usable.
[0102] In this embodiment, "drift amount less than or equal to preset drift amount within several consecutive frames" refers to a sequence of multiple image frames continuously acquired after focus lock; drift amount refers to the actual range of focus position change corresponding to each frame; preset drift amount refers to the maximum allowable position fluctuation limit. This condition is used to verify the temporal stability of the focus position and prevent focus drift caused by vibration.
[0103] In this embodiment, the saturated pixel ratio is the percentage of pixels in the tested surface image whose grayscale value exceeds a preset saturation threshold relative to the total number of pixels in the effective inspection area. Saturated pixels are caused by strong reflections or overexposure on the metal surface. An excessively high saturation ratio indicates a severe loss of effective image information, affecting the accuracy of sharpness evaluation and the reliability of detection.
[0104] In this embodiment, the preset ratio threshold is a pre-defined maximum allowable value for the saturated pixel ratio. It is determined by the minimum requirement of the detection task for effective image information. When the saturated pixel ratio is less than or equal to this threshold, there are sufficient unsaturated pixels in the effective inspection area, providing a reliable data foundation for sharpness calculation and defect identification.
[0105] In this embodiment, the hard triggering method is a trigger mode in which camera exposure and light source illumination are directly synchronized via hardware signal lines. The trigger signal is issued by the controller and simultaneously reaches the camera and light source through physical circuitry, ensuring strict alignment between the exposure time and the light source illumination time. The hard triggering method eliminates software delay jitter and guarantees brightness consistency across multiple frames.
[0106] In this embodiment, the final image of the tested surface is a single frame or a specified number of frames of the generator's tested surface acquired using a hard-trigger method while the actual focus position is locked, after passing a reliability assessment. The final image of the tested surface serves as the original evidence for the inspection task, and is output and archived after being bound with fields such as distance from the surface, focus position, and sharpness.
[0107] In this embodiment, the refocusing strategy is a set of recovery procedures executed after a reliability assessment failure. These procedures, in order of priority, include adjusting the target distance to bring the imaging end into a better depth-of-field range, entering a docked acquisition state to suppress vibration and then refocusing, and adjusting the exposure time or light source parameters to reduce reflection interference and then refocusing. After refocusing, the focusing process is repeated until a reliable or abnormal exit occurs.
[0108] The working principle and beneficial effects of this embodiment are as follows: A comprehensive comparison is made between the maximum sharpness value and a preset sharpness threshold, between the drift amount of several consecutive frames and a preset drift amount, and between the saturation pixel ratio and a preset ratio threshold. If all these conditions are met, the image is deemed reliable, and a hard-triggered acquisition is performed to output the imaging result. Otherwise, the image is deemed unreliable, and a reshaping strategy is executed. This achieves multi-dimensional reliability verification of the actual focus position. When reliable, hard-triggered acquisition ensures consistent image quality; when unreliable, a reshaping strategy is executed to avoid invalid acquisition, thereby improving the detection success rate and data reliability.
[0109] To achieve the above embodiments, this disclosure also proposes a narrow-gap adaptive focusing imaging device for generators.
[0110] Figure 2 This is a schematic diagram of the structure of a narrow air gap adaptive focusing imaging device for a generator provided in an embodiment of this disclosure. The device 200 can be implemented by software and / or hardware, and is generally integrated into an electronic device. For example... Figure 2 As shown, the device 200 includes: an acquisition module 201, a first determination module 202, a second determination module 203, and a judgment module 204, wherein, The acquisition module 201 is used to acquire a first distance-to-surface value between the imaging end and the measured surface of the generator based on a first ranging channel, acquire a second distance-to-surface value between the imaging end and the landing point of the light spot on the measured surface of the generator based on a second ranging channel, and calculate a fused distance-to-surface value based on a preset consistency discrimination rule and a fusion rule, according to the first distance-to-surface value and the second distance-to-surface value. The first determining module 202 is used to determine the filtering intensity based on the current operating state of the imaging end, filter the fused distance-to-surface value to obtain the filtered distance-to-surface value, obtain the target distance of the detected surface, calculate the distance-to-surface error based on the filtered distance-to-surface value and the target distance, and determine the control output of the imaging end based on the distance-to-surface error. The second determining module 203 is used to determine the feedforward focus position from the preset lookup table curve according to the filter distance value, and to obtain the test surface image set by bidirectional progressive search within the preset fine-tuning window based on the feedforward focus position and the control output, and to calculate the comprehensive sharpness of the test surface image set in the preset maintenance effective area to determine the actual focus position. The judgment module 204 is used to judge the reliability of the actual focus position. If the judgment result is reliable, the imaging result is output.
[0111] The apparatus provided in this disclosure embodiment, wherein the acquisition module 201 is specifically used for: The first ranging channel is determined according to the electrical correlation method, and the first distance-surface value between the imaging end and the measured surface of the generator is obtained based on the first ranging channel. The electrical correlation method includes the eddy current method and the capacitance method. The second ranging channel is determined according to the optical correlation method, and the second distance-surface value between the imaging end and the landing point of the light spot on the measured surface of the generator is obtained based on the second ranging channel. The optical correlation method is a point-line light projection imaging method. Calculate the absolute value of the deviation between the first distance value and the second distance value, and compare the absolute value of the deviation with the consistency threshold in the preset consistency discrimination rule; If the absolute value of the deviation is less than or equal to the consistency threshold, the first distance-to-surface value and the second distance-to-surface value are weighted and summed according to the preset weight in the fusion rule, and the fused distance-to-surface value is output. If the absolute value of the deviation is greater than the consistency threshold, it is determined that there is a ranging anomaly, an alarm is triggered and a degradation strategy is executed. According to the degradation strategy, the first ranging channel and the second ranging channel are self-checked, and the distance-to-surface value of the corresponding ranging channel with a normal self-check result is output as the fused distance-to-surface value.
[0112] The apparatus provided in this embodiment of the present disclosure, wherein the first determining module 202 is specifically used for: Based on the current operating status of the imaging end, the filtering intensity is determined from the filtering table, and the fused distance-surface value is filtered according to the filtering intensity to obtain the filtered distance-surface value. The target distance to the surface being measured is obtained, and the target distance is preset with several distance levels according to the current operating state of the imaging end; The distance-to-surface error and the rate of change of the distance-to-surface error are calculated based on the filtered distance-to-surface value and the target distance. A feedback term is determined based on the distance-to-surface error and the rate of change of the distance-to-surface error. A feedforward term is determined based on relevant data of the current operating status of the imaging end. The relevant data includes the imaging end velocity, acceleration, and estimated curvature change. The control output of the imaging end is determined based on the feedforward term and the feedback term.
[0113] The apparatus provided in this disclosure embodiment, wherein the second determining module 203 is specifically used for: The preset lookup table curve is generated by calibrating different distance points and corresponding sharpest focus positions under experimental conditions, and is a fixed version according to the lens model and camera serial number of the imaging end; The feedforward focus position is determined from the preset lookup table curve based on the filter distance value, and the preset fine-tuning window position is determined based on the control output in the neighborhood of the feedforward focus position. The focus end is moved in the preset fine-tuning window according to the bidirectional progressive control. The first test image is obtained at each sampling position according to the preset first step long scan. Image analysis is performed on the first test image, and the direction of the sharpness increase trend is determined according to the image analysis results. Based on the direction of the increase in clarity, a scan is performed according to a preset second step length to obtain the second image under test; The first and second test images are combined to form a test surface image set. Each test surface image in the test surface image set is divided into regions according to the preset maintenance effective area to obtain saturated regions and unsaturated regions. The saturated regions are shielded, and the overall clarity is calculated based on the unsaturated regions of the test surface images. Compare the overall sharpness of all the measured surface images, determine the maximum overall sharpness, and determine the actual focus position based on the focus position corresponding to the maximum overall sharpness.
[0114] The apparatus provided in this disclosure embodiment, wherein the second determining module 203 is specifically used for: Extract the state features of the control output, determine the distance-to-surface stability level based on the state features, and calculate the position offset of the window center of the preset fine-tuning window relative to the feedforward focus position based on the distance-to-surface stability level. The feedforward focus position is superimposed with the position offset to determine the center position of the preset fine-tuning window. The half-width of the window is determined according to the distance-to-surface stability level. The preset fine-tuning window position is determined based on the half-width of the window and the center position of the window.
[0115] The apparatus provided in this disclosure embodiment, wherein the determining module 204 is specifically used for: The reliability of the actual focus position is judged. If the maximum value of the overall sharpness is greater than or equal to the preset sharpness threshold, and the drift amount within several consecutive frames acquired at the actual focus position is less than or equal to the preset drift amount, and the saturation pixel ratio of the measured surface image is less than or equal to the preset ratio threshold, then the judgment result is that the actual focus position is reliable. The imaging end is triggered to acquire the final image of the measured surface in a hard trigger mode and output the imaging result. If the following conditions are not met simultaneously: the maximum value of the overall sharpness is greater than or equal to the preset sharpness threshold, the drift amount within several consecutive frames obtained at the actual focus position is less than or equal to the preset drift amount, and the saturation pixel ratio of the measured surface image is less than or equal to the preset ratio threshold, then the actual focus position is deemed unreliable, and a resetting strategy is executed.
[0116] The generator narrow air gap adaptive focusing imaging device provided in this disclosure can execute the generator narrow air gap adaptive focusing imaging method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of executing the method.
[0117] To implement the above embodiments, this disclosure also proposes a computer program product, including a computer program / instructions that, when executed by a processor, implement the generator narrow air gap adaptive focusing imaging method described in the above embodiments.
[0118] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure.
[0119] The following is a detailed reference. Figure 3The diagram illustrates a structural schematic suitable for implementing the electronic device in the embodiments of this disclosure. The electronic device in the embodiments of this disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 3 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0120] like Figure 3 As shown, the electronic device may include a processor (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 302 or a program loaded from memory 308 into random access memory (RAM) 303. The RAM 303 also stores various programs and data required for the operation of the electronic device. The processor 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0121] Typically, the following devices can be connected to I / O interface 305: input devices 306 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 307 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 308 including, for example, magnetic tapes, hard disks, etc.; and communication devices 309. Communication device 309 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0122] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 309, or installed from memory 308, or installed from ROM 302. When the computer program is executed by processor 301, it performs the functions defined in the generator narrow air gap adaptive focusing imaging method of embodiments of this disclosure.
[0123] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0124] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0125] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0126] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the aforementioned method for adaptive focusing imaging of a generator with a narrow air gap.
[0127] Electronic devices can be programmed with computer program code in one or more programming languages or combinations thereof to perform the operations of this disclosure. These programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as "C" or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0128] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0129] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units are not, in some cases, intended to limit the specific unit.
[0130] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.
[0131] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0132] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0133] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0134] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for adaptive focusing imaging in narrow air gaps of generators, characterized in that, include: The first distance-to-surface value between the imaging end and the measured surface of the generator is obtained based on the first ranging channel, and the second distance-to-surface value between the imaging end and the landing point of the light spot on the measured surface of the generator is obtained based on the second ranging channel. Based on the preset consistency discrimination rule and fusion rule, the fused distance-to-surface value is calculated according to the first distance-to-surface value and the second distance-to-surface value. The filtering intensity is determined based on the current operating state of the imaging end, the fused distance-to-surface value is filtered to obtain the filtered distance-to-surface value, the target distance of the detected surface is obtained, the distance-to-surface error is calculated based on the filtered distance-to-surface value and the target distance, and the control output of the imaging end is determined based on the distance-to-surface error. Based on the filter distance value, the feedforward focus position is determined from the preset lookup table curve. Based on the feedforward focus position and the control output, the test surface image set is obtained through bidirectional progressive search within the preset fine-tuning window. The overall sharpness of the test surface image set in the preset maintenance effective area is calculated to determine the actual focus position. The reliability of the actual focus position is determined, and if the determination result is reliable, the imaging result is output.
2. The method according to claim 1, characterized in that, Based on the first ranging channel, a first distance-to-surface value is obtained between the imaging end and the measured surface of the generator. Based on the second ranging channel, a second distance-to-surface value is obtained between the imaging end and the point where the light spot falls on the measured surface of the generator. Based on preset consistency discrimination rules and fusion rules, a fused distance-to-surface value is calculated according to the first distance-to-surface value and the second distance-to-surface value, including: The first ranging channel is determined according to the electrical correlation method, and the first distance-surface value between the imaging end and the measured surface of the generator is obtained based on the first ranging channel. The electrical correlation method includes the eddy current method and the capacitance method. The second ranging channel is determined according to the optical correlation method, and the second distance-surface value between the imaging end and the landing point of the light spot on the measured surface of the generator is obtained based on the second ranging channel. The optical correlation method is a point-line light projection imaging method. Calculate the absolute value of the deviation between the first distance value and the second distance value, and compare the absolute value of the deviation with the consistency threshold in the preset consistency discrimination rule; If the absolute value of the deviation is less than or equal to the consistency threshold, the first distance-to-surface value and the second distance-to-surface value are weighted and summed according to the preset weight in the fusion rule, and the fused distance-to-surface value is output. If the absolute value of the deviation is greater than the consistency threshold, it is determined that there is a ranging anomaly, an alarm is triggered and a degradation strategy is executed. According to the degradation strategy, the first ranging channel and the second ranging channel are self-checked, and the distance-to-surface value of the corresponding ranging channel with a normal self-check result is output as the fused distance-to-surface value.
3. The method according to claim 2, characterized in that, The filtering intensity is determined based on the current operating state of the imaging end. The fused distance-to-surface value is filtered to obtain a filtered distance-to-surface value. The target distance of the detected surface is obtained. The distance-to-surface error is calculated based on the filtered distance-to-surface value and the target distance. The control output of the imaging end is determined based on the distance-to-surface error, including: Based on the current operating status of the imaging end, the filtering intensity is determined from the filtering table, and the fused distance-surface value is filtered according to the filtering intensity to obtain the filtered distance-surface value. The target distance to the surface being measured is obtained, and the target distance is preset with several distance levels according to the current operating state of the imaging end; The distance-to-surface error and the rate of change of the distance-to-surface error are calculated based on the filtered distance-to-surface value and the target distance. A feedback term is determined based on the distance-to-surface error and the rate of change of the distance-to-surface error. A feedforward term is determined based on relevant data of the current operating status of the imaging end. The relevant data includes the imaging end velocity, acceleration, and estimated curvature change. The control output of the imaging end is determined based on the feedforward term and the feedback term.
4. The method according to claim 1, characterized in that, The feedforward focus position is determined from a preset lookup table curve based on the filter distance value. Based on the feedforward focus position and the control output, a bidirectional progressive search is performed within a preset fine-tuning window to acquire a set of images of the tested surface. The overall sharpness of the tested surface image set within a preset maintenance effective area is calculated to determine the actual focus position, including: The preset lookup table curve is generated by calibrating different distance points and corresponding sharpest focus positions under experimental conditions, and is a fixed version according to the lens model and camera serial number of the imaging end; The feedforward focus position is determined from the preset lookup table curve based on the filter distance value, and the preset fine-tuning window position is determined based on the control output in the neighborhood of the feedforward focus position. The focus end is moved in the preset fine-tuning window according to the bidirectional progressive control. The first test image is obtained at each sampling position according to the preset first step long scan. Image analysis is performed on the first test image, and the direction of the sharpness increase trend is determined according to the image analysis results. Based on the direction of the increase in clarity, a scan is performed according to a preset second step length to obtain the second image under test; The first and second test images are combined to form a test surface image set. Each test surface image in the test surface image set is divided into regions according to the preset maintenance effective area to obtain saturated regions and unsaturated regions. The saturated regions are shielded, and the overall clarity is calculated based on the unsaturated regions of the test surface images. Compare the overall sharpness of all the measured surface images, determine the maximum overall sharpness, and determine the actual focus position based on the focus position corresponding to the maximum overall sharpness.
5. The method according to claim 4, characterized in that, Determining the preset fine-tuning window position based on the control output in the neighborhood of the feedforward focus position includes: Extract the state features of the control output, determine the distance-to-surface stability level based on the state features, and calculate the position offset of the window center of the preset fine-tuning window relative to the feedforward focus position based on the distance-to-surface stability level. The feedforward focus position is superimposed with the position offset to determine the center position of the preset fine-tuning window. The half-width of the window is determined according to the distance-to-surface stability level. The preset fine-tuning window position is determined based on the half-width of the window and the center position of the window.
6. The method according to claim 1, characterized in that, The reliability of the actual focus position is determined. If the determination result is reliable, the imaging result is output, including: The reliability of the actual focus position is judged. If the maximum value of the overall sharpness is greater than or equal to the preset sharpness threshold, and the drift amount within several consecutive frames acquired at the actual focus position is less than or equal to the preset drift amount, and the saturation pixel ratio of the measured surface image is less than or equal to the preset ratio threshold, then the judgment result is that the actual focus position is reliable. The imaging end is triggered to acquire the final image of the measured surface in a hard trigger mode and output the imaging result. If the following conditions are not met simultaneously: the maximum value of the overall sharpness is greater than or equal to the preset sharpness threshold, the drift amount within several consecutive frames obtained at the actual focus position is less than or equal to the preset drift amount, and the saturation pixel ratio of the measured surface image is less than or equal to the preset ratio threshold, then the actual focus position is deemed unreliable, and a resetting strategy is executed.
7. A narrow-gap adaptive focusing imaging device for generators, the device comprising: The acquisition module is used to acquire a first distance-to-surface value between the imaging end and the measured surface of the generator based on a first ranging channel, acquire a second distance-to-surface value between the imaging end and the landing point of the light spot on the measured surface of the generator based on a second ranging channel, and calculate a fused distance-to-surface value based on a preset consistency discrimination rule and a fusion rule, according to the first distance-to-surface value and the second distance-to-surface value. The first determining module is used to determine the filtering intensity based on the current operating state of the imaging end, filter the fused distance-to-surface value to obtain the filtered distance-to-surface value, obtain the target distance of the detected surface, calculate the distance-to-surface error based on the filtered distance-to-surface value and the target distance, and determine the control output of the imaging end based on the distance-to-surface error. The second determining module is used to determine the feedforward focus position from the preset lookup table curve according to the filter distance value, and to obtain the image set of the tested surface in a bidirectional progressive search within the preset fine-tuning window based on the feedforward focus position and the control output, and to calculate the comprehensive sharpness of the image set of the tested surface in the preset maintenance effective area to determine the actual focus position. The judgment module is used to judge the reliability of the actual focus position. If the judgment result is reliable, the imaging result is output.
8. An electronic device, characterized in that, include: Memory; processor; as well as Computer programs; The computer program is stored in the memory and configured to be executed by the processor to implement the steps of the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, It stores a computer program / instruction thereon, which, when executed by a processor, implements the steps of the method described in any one of claims 1-6.
10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1-6.