Optical nondestructive measurement method, system and equipment for parameters of micropore circle with large depth-diameter ratio

By employing a multi-threaded architecture and edge feature enhancement technology, the problem of non-destructive, dynamic, and high-precision measurement of the circular parameters of micro-holes with large aspect ratios was solved, enabling non-destructive, dynamic, and high-precision measurement of the circular parameters of micro-holes with large aspect ratios.

CN121366089APending Publication Date: 2026-01-20NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511506391.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-21
Publication Date
2026-01-20

AI Technical Summary

Technical Problem

Existing technologies cannot achieve non-destructive, dynamic, and high-precision measurement of the circular parameters of micro-holes with large aspect ratios.

Method used

By reading the original frame image from the target memory region, edge feature enhancement is performed using a multi-threaded architecture to generate a target enhancement gradient image, and a target measurement circle is drawn on the image. The pixel distance parameter is detected and converted to obtain a micrometer-level physical size measurement value.

Benefits of technology

It enables non-destructive, dynamic, and high-precision measurement of the circular parameters of micro-holes with large aspect ratios, improving image contrast and enhancing measurement accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121366089A_ABST
    Figure CN121366089A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of computer vision and precision measurement, and particularly discloses an optical nondestructive measurement method, system and equipment for parameters of a micropore circle with a large depth-diameter ratio. According to the invention, edge feature enhancement is carried out on an original frame image through a multi-thread architecture; according to the target enhanced gradient image, determining a micron-level to-be-measured depth-diameter ratio micropore, and drawing an adaptive target measurement circle on the original frame image; and the pixel distance parameter is converted by triggering the target size conversion module. Through the above mode, through the image acquisition thread, the Sobel gradient calculation thread and the pseudo-color enhancement thread which are separated by a multi-thread architecture, edge feature enhancement is carried out on an original frame image in the modes of Gaussian filtering noise reduction, gradient amplitude fusion and pseudo-color mapping, and a target measurement circle drawn by a dynamic calibration strategy is used for measurement. Therefore, lossless, dynamic and high-precision measurement of parameters of the micropore circle with the large depth-diameter ratio can be realized, and reliable technical support is provided for quality inspection of precise devices.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of computer vision and precision measurement, and more particularly, relates to an optical nondestructive measurement method, system and device for parameters of a large-depth-to-diameter micro-hole circle. BACKGROUND

[0002] A large-depth-to-diameter micro-hole refers to a type of micro-hole structure whose depth is relatively large (usually greater than 5:1) compared to its diameter. Due to its unique geometric characteristics, such micro-holes have important application value in precision manufacturing, electronic packaging, biomedical treatment and other fields. However, large-depth-to-diameter micro-holes have the characteristics of small size and large depth-to-diameter, making it impossible for traditional measurement methods to meet the requirements for accurate characterization. In recent years, with the development of micro-nano manufacturing technology, the demand for measurement of parameters of large-depth-to-diameter micro-hole circles is increasingly urgent. Current methods for measuring parameters of large-depth-to-diameter micro-hole circles are divided into contact measurement and non-contact measurement.

[0003] Contact measurement is a classic micro-hole measurement method, mainly including mechanical probe method and piezoelectric mechanics method. The advantage of this method is that it can directly obtain real physical contact signals, and is suitable for the measurement of shallow micro-holes. For micro-holes with large depth-to-diameter ratio, the probe is prone to produce large errors due to long path, and may even be damaged. Non-contact methods are more flexible and diverse. Non-contact measurement includes optical microscopy, laser confocal scanning microscopy and X-ray computed tomography. Among them, optical microscopy observes the morphology of the micro-hole opening through a high-power objective lens, but due to the limited depth of field, it is difficult to achieve continuous measurement in the full depth range; laser confocal scanning microscopy constructs a three-dimensional image of the micro-hole through point-by-point scanning, which can effectively overcome the problem of insufficient depth of field, but its time resolution is low and is not suitable for dynamic measurement scenarios. As a nondestructive testing technology, X-ray computed tomography can reconstruct the spatial distribution of micro-holes on a macro scale, but it has weak resolution for sub-micron structures.

[0004] In summary, the above methods cannot achieve nondestructive, dynamic and high-precision measurement of parameters of large-depth-to-diameter micro-hole circles. SUMMARY

[0005] In view of the defects of the prior art, the purpose of the present application is to provide an optical nondestructive measurement method, system and device for parameters of a large-depth-to-diameter micro-hole circle, aiming to solve the technical problem that the prior art cannot achieve nondestructive, dynamic and high-precision measurement of parameters of a large-depth-to-diameter micro-hole circle.

[0006] To achieve the above purpose, in a first aspect, the present application provides an optical nondestructive measurement method for parameters of a large-depth-to-diameter micro-hole circle, comprising: read an original frame image from a target memory area, and perform edge feature enhancement on the original frame image through a multi-thread architecture to obtain a target enhanced gradient image; determine a micron-level to-be-measured depth-diameter ratio micropore according to the target enhanced gradient image, and draw a target measurement circle on the original frame image, the target measurement circle being adapted to the to-be-measured depth-diameter ratio micropore; detect a pixel distance parameter of the target measurement circle, convert the pixel distance parameter through a target size conversion module, and obtain a micron-level physical size measurement value of a circle parameter of the to-be-measured depth-diameter ratio micropore.

[0007] In an embodiment, the step of reading an original frame image from a target memory area, and performing edge feature enhancement on the original frame image through a multi-thread architecture to obtain a target enhanced gradient image comprises: determining an image acquisition thread, a Sobel gradient calculation thread, and a pseudo-color enhancement thread according to the multi-thread architecture; continuously reading an original frame image from a target memory area through the image acquisition thread and a double-buffering mechanism, and converting the original frame image into a target image matrix; performing spatial domain filtering on the target image matrix through the Sobel gradient calculation thread; performing gradient calculation on the filtered target image matrix according to a separable Sobel operator, and generating a comprehensive gradient amplitude image according to the gradient calculation result; performing normalization processing on the comprehensive gradient amplitude image through the pseudo-color enhancement thread, and performing color spectrum mapping on the processed comprehensive gradient amplitude image to obtain a target enhanced gradient image.

[0008] In an embodiment, before the step of reading an original frame image from a target memory area, the method further comprises: performing hardware initialization through an initialization function to establish a bottom-layer communication environment; performing device enumeration through an enumeration function, and generating a target device information list according to information of each available device enumerated; determining a target camera device according to the target device information list, and calling a creation function to create a device handle corresponding to the target camera device, and establishing a hardware connection channel through the device handle; starting the target camera device according to the bottom-layer communication environment and the hardware connection channel, and configuring a preset transmission bandwidth and a dynamically set target parameter set for the started target camera device; controlling the target camera device configured with the parameters to acquire an original frame image, and writing the original frame image into a target memory area through a zero-copy mechanism.

[0009] In an embodiment, the step of determining the micrometer-level deep-diameter ratio micro-hole to be measured according to the target enhanced gradient image comprises: A dual-view display framework is constructed through an OpenCV window system and an automatic recognition trigger interface; wherein the dual-view display framework comprises a first window and a second window; The original frame image is rendered in the first window, and the target enhanced gradient image is displayed in the second window; A deep-diameter ratio micro-hole selection instruction of the user is determined according to the original frame image and the target enhanced gradient image; The micrometer-level deep-diameter ratio micro-hole to be measured is located according to the deep-diameter ratio micro-hole selection instruction.

[0010] In an embodiment, the step of drawing a target measurement circle adapted to the deep-diameter ratio micro-hole to be measured on the original frame image comprises: The slide bar control in the parameter panel is initialized, and operation information of the user on the initialized slide bar control is obtained; The current calibration parameter and the current space transformation parameter are determined according to the operation information; The target measurement circle adapted to the deep-diameter ratio micro-hole to be measured is drawn on the original frame image according to the current calibration parameter and the current space transformation parameter.

[0011] In an embodiment, after the step of converting the pixel distance parameter to obtain the micrometer-level physical size measurement value of the circular parameter of the deep-diameter ratio micro-hole to be measured through the target size conversion module, the method further comprises: The micrometer-level physical size measurement value of the circular parameter of the deep-diameter ratio micro-hole to be measured is written into a log file in real time; The key information of the user is obtained, and the key information is recognized; When the recognized key feature information is first feature information, the image is saved; When the recognized key feature information is second feature information, an atomic flag bit is set, and the image acquisition thread, the Sobel gradient calculation thread, and the pseudo-color enhancement thread are controlled to exit the loop; The reading of the original frame image from the target memory area, the release of the device handle corresponding to the target camera device, the destruction of the dual-view display framework, and the release of the target memory area are stopped.

[0012] In a second aspect, the present application provides an optical nondestructive measurement system for circular parameters of a deep-diameter ratio micro-hole, comprising: A parallel processing module is configured to read an original frame image from a target memory area, and to perform edge feature enhancement on the original frame image through a multi-thread architecture to obtain a target enhanced gradient image; An interactive application module is configured to determine a micron-level deep-diameter ratio micro-hole to be measured according to the target gradient image, and draw a target measurement circle on the original frame image, the target measurement circle being adapted to the deep-diameter ratio micro-hole to be measured. A conversion module is configured to detect a pixel distance parameter of the target measurement circle, and convert the pixel distance parameter by triggering a target size conversion module to obtain a micron-level physical size measurement value of a circle parameter of the deep-diameter ratio micro-hole to be measured.

[0013] In a third aspect, the present application provides an electronic device, comprising: at least one memory configured to store a program; and at least one processor configured to execute the program stored in the memory, and when the program stored in the memory is executed, the processor is configured to execute the method described in the first aspect or any possible implementation manner of the first aspect.

[0014] In a fourth aspect, the present application provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and when the computer program is run on a processor, the processor is caused to execute the method described in the first aspect or any possible implementation manner of the first aspect.

[0015] In a fifth aspect, the present application provides a computer program product, and when the computer program product is run on a processor, the processor is caused to execute the method described in the first aspect or any possible implementation manner of the first aspect.

[0016] It can be understood that the beneficial effects of the above-mentioned second aspect to fifth aspect can be referred to the related description in the first aspect, and will not be repeated here.

[0017] Overall, compared with the prior art, the above technical solutions conceived by the present application have the following beneficial effects: (1) The original frame image is written into a shared target memory area through a zero-copy mechanism, the area adopts a ring buffer design, and combines atomic operations and mutexes to ensure that 30fps high frame rate data is transmitted without blocking. Through a multi-thread architecture, image acquisition threads, Sobel gradient calculation threads and pseudo-color enhancement threads are separated, three layers of threads are decoupled through a task queue, and are bound to independent CPU cores (thread affinity) to maximize the use of computing resources. Through the multi-thread zero-copy mechanism and multiple threads for edge feature enhancement, the limitations of traditional contact measurement (probe method) and static optical measurement (confocal microscope) are broken through, the bottom edge of a large deep-diameter ratio micro-hole can be clearly imaged, and the image contrast is significantly improved.

[0018] (2) Using dynamic calibration technology, the interactive parameter adjustment based on the sliding bar control and the real-time physical size output form a closed-loop feedback. According to the operation information of the user on the initialized sliding bar control, the measuring circle is redrawn and the conversion result is updated, so as to realize the "what you see is what you get" accurate calibration and improve the detection efficiency of the closed-loop workflow. A closed-loop feedback type measurement workflow is constructed, and the accurate conversion from optical imaging to physical size is realized through the cooperation of multiple modules.

[0019] To sum up, the original frame image is read from the target memory area, and the original frame image is enhanced in edge features through a multi-thread architecture to obtain a target enhanced gradient image; a micrometer-level to-be-measured deep-diameter ratio micro-hole is determined according to the target enhanced gradient image, and a target measurement circle corresponding to the to-be-measured deep-diameter ratio micro-hole is drawn on the original frame image; a pixel distance parameter of the target measurement circle is detected, the pixel distance parameter is converted by triggering a target size conversion module, and a micrometer-level physical size measurement value of the circular parameter of the to-be-measured deep-diameter ratio micro-hole is obtained. In the above manner, the original frame image is enhanced in edge features through a multi-thread architecture including an image acquisition thread, a Sobel gradient calculation thread and a pseudo-color enhancement thread in a manner of Gaussian filter denoising, gradient amplitude fusion and pseudo-color mapping, and the target measurement circle drawn by using a dynamic calibration strategy is used for measurement, so that lossless, dynamic and high-precision measurement of the circular parameter of the large deep-diameter ratio micro-hole can be realized, and reliable technical support is provided for precision device quality inspection. BRIEF DESCRIPTION OF DRAWINGS

[0020] Figure 1 is one of flowcharts of the optical lossless measurement method of the circular parameter of the large deep-diameter ratio micro-hole provided by the embodiments of the present application; Figure 2 is a measurement result visualization schematic diagram provided by the embodiments of the present application; Figure 3 is another flowchart of the optical lossless measurement method of the circular parameter of the large deep-diameter ratio micro-hole provided by the embodiments of the present application; Figure 4 is a module structure schematic diagram of the optical lossless measurement system of the circular parameter of the large deep-diameter ratio micro-hole provided by the embodiments of the present application; Figure 5 is a structure schematic diagram of an electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not to limit the present application.

[0022] The term “and / or” used in the present document is used to describe an associated relationship between objects, which means that there can be three relationships, for example, A and / or B can represent the following three cases: A exists alone, A and B exist simultaneously, and B exists alone. The symbol “ / ” in the present document represents an or relationship between associated objects, for example, A / B represents A or B.

[0023] The terms “first” and “second” and the like in the description and claims of the present document are used to distinguish different objects, rather than to describe a specific order of the objects. For example, the first response message and the second response message are used to distinguish different response messages, rather than to describe a specific order of the response messages.

[0024] In the embodiments of the present application, the words “exemplary” or “for example” are used to mean serving as an example, instance, or illustration. Any embodiment or design presented as “exemplary” or “for example” in the embodiments of the present application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Rather, the use of “exemplary” or “for example” is intended to present concepts in a concrete manner.

[0025] Based on this, the embodiments of the present application provide an optical nondestructive measurement method of parameters of a large-depth-to-diameter micro-hole circle, which refers to Figure 1 , Figure 1 is one of the flowcharts of the optical nondestructive measurement method of parameters of a large-depth-to-diameter micro-hole circle provided by the embodiments of the present application. In the embodiments, the optical nondestructive measurement method of parameters of a large-depth-to-diameter micro-hole circle includes steps S10 to S30: Step S10, reading an original frame image from a target memory area, and performing edge feature enhancement on the original frame image through a multi-thread architecture to obtain a target enhanced gradient image.

[0026] It should be noted that the target memory area can be a shared memory area, which adopts a ring buffer design and contains two 5120*3840*3 RGB image slot positions. The read-write separation is realized through a ping-pong switching strategy, and the target memory area serves as a system data hub, which exhibits a high-throughput cache and a concurrent safety mechanism. The thread-safe data exchange is realized through atomic operations and mutex locks, so as to ensure that the 5120*3840 resolution image of 30 frames per second can be transmitted without blocking. The frame counter of the target memory area realizes the accurate alignment of the acquisition / processing threads. The data protection layer adopts a three-level lock mechanism: an atomic flag (std::atomic <bool>) control buffer switching, spin lock (spin_lock) manages metadata access, mutex (std::mutex) guarantees complete copy of data block. In addition, memory mapping technology aligns buffer address space to 4K page boundary, combined with madvise (MADV_SEQUENTI AL) optimization pre-read strategy, improves data transmission rate, fully releases the theoretical bandwidth of 5Gbps of USB3.0 interface. The exception handling module monitors the buffer overflow in real time, and automatically triggers the frame discarding strategy to ensure the real-time performance of the system It should be understood that the multi-thread architecture is used to decouple the computationally intensive tasks into three parallel execution threads, i.e., the image acquisition thread, the Sobel gradient calculation thread and the pseudo-color enhancement thread, and the above-mentioned pipeline parallel processing significantly reduces the image processing delay and meets the real-time requirement.

[0027] Further, before the step of reading the original frame image from the target memory area, the method further comprises: performing hardware initialization by calling an initialization function to establish a bottom communication environment; performing device enumeration by calling an enumeration function, and generating a target device information list according to the information of each available device enumerated; determining a target camera device according to the target device information list, and calling a creation function to create a device handle corresponding to the target camera device, and establishing a hardware connection channel through the device handle; starting the target camera device according to the bottom communication environment and the hardware connection channel, and configuring a preset transmission bandwidth and a dynamically set target parameter set for the started target camera device; controlling the target camera device configured with the parameters to acquire the original frame image, and writing the original frame image into the target memory area through a zero-copy mechanism.

[0028] It can be understood that before reading the original frame image from the target memory area, the original frame image needs to be acquired and written into the target memory area. The optical nondestructive measurement system of the large-depth-diameter ratio microporous circle parameter further comprises an industrial camera control module in addition to the parallel processing module, the interactive application module and the conversion module. The industrial camera control module serves as a physical perception entrance of the system and realizes high-resolution image acquisition based on MvCameraControlSDK. The high resolution can be 5120×3840. Hardware initialization can be performed by calling an initialization function, i.e., initializing MvCameraControl SDK to establish a bottom communication environment. The initialization function can be a MV_CC_Initialize() function.

[0029] It should be noted that in order to facilitate the determination of the target camera device, the embodiment also performs device enumeration by calling an enumeration function, and generates a target device information list according to the information of each available device enumerated, and determines the target camera device according to the target device information list, wherein the enumeration function can be the M-V_CC_EnumDevices() function, the target device information includes but is not limited to IP address, device model, etc., and the target camera device can be an industrial camera. After determining the target camera device, a creation function can be called to create a device handle corresponding to the target camera device, establish a hardware connection channel, the creation function can be the MV_CC_CreateHandle() function, at this time the target camera device can also be started by executing the MV_CC_OpenDevice() function, and the started target camera device is configured with a preset transmission bandwidth, and the preset transmission bandwidth can be a 5Gbps transmission bandwidth of a USB3.0 interface. The target parameter set includes exposure parameters, gamma correction, etc., specifically: the exposure time is dynamically adjusted (the sliding bar range is 0-70, corresponding to 0-7000us) by MV_CC_SetFloatValue(Exposure-Time, pos*100.0f), the gamma correction is activated by calling the MV_CC_SetBoolValue(GammaEnable, true) function, and the correction coefficient is set by the MV_CC_SetFloatValue(Gamma, pos / 100.0f) function (the sliding bar range is 0-500, corresponding to 0-5.0).

[0030] It should be understood that after the high-resolution original frame image is collected, the original frame image is written into the target memory area through the zero-copy mechanism, specifically: a ring-shaped shared memory area is created, and the original frame image is written into the ring-shaped shared memory area through std::atomic <bool>Atomic_flag control ping-pong switching strategy, for example, write buffer A, process buffer B (atomic_flag realizes switching), use madvise (MADV_SEQUENTIAL) to optimize memory pre-read, ensure 30fps high-resolution image without blocking write.

[0031] In step S20, the micrometer-level micro-hole to be measured for the depth-diameter ratio is determined according to the target reinforced gradient image, and a target measurement circle corresponding to the micro-hole to be measured for the depth-diameter ratio is drawn on the original frame image.

[0032] It can be understood that the micro-hole to be measured for the depth-diameter ratio refers to a micro-hole with a large depth-diameter ratio on the original frame image that needs to be measured for the circle parameter, in the embodiment, the micro-hole to be measured for the depth-diameter ratio can be manually selected by a user, or can be intelligently and automatically positioned, for example, the micrometer-level micro-hole to be measured for the depth-diameter ratio is positioned according to the depth-diameter ratio selection instruction of the user. The target measurement circle refers to a circle for measuring the circle parameter of the micro-hole to be measured for the depth-diameter ratio, the line width of the target measurement circle can be 5 pixels, and the center position and the radius are updated in real time by a sliding bar control.

[0033] Further, the step of determining the micrometer-level micro-hole to be measured for the depth-diameter ratio according to the target reinforced gradient image comprises: constructing a double-view display framework through an OpenCV window system and an automatic recognition triggering interface; the double-view display framework comprises a first window and a second window; the original frame image is rendered in the first window, and the target reinforced gradient image is displayed in the second window; the depth-diameter ratio selection instruction of the user is determined according to the original frame image and the target reinforced gradient image; and the micrometer-level micro-hole to be measured for the depth-diameter ratio is positioned according to the depth-diameter ratio selection instruction.

[0034] It should be noted that the OpenCV window system refers to a system for constructing a view display framework, at this time, a double-view display framework can be constructed in combination with an automatic recognition triggering interface, the double-view display framework comprises a first window and a second window, the contents displayed by the first window and the second window are the original frame image and the target reinforced gradient image respectively, for example, the original frame image is rendered in the first window, and the target reinforced gradient image is displayed in the second window, or the target reinforced gradient image is displayed in the first window, and the original frame image is rendered in the second window. The first window can be a Canvas view window, the second window can be a Grad view window, and an OpenGL acceleration is adopted for a double-view rendering engine.

[0035] It can be understood that the deep diameter ratio micropore selection instruction refers to an instruction for selecting a micrometer level deep diameter ratio micropore to be measured, and the deep diameter ratio micropore selection instruction can be a voice type selection instruction or an operation type selection instruction. At this time, the micrometer level deep diameter ratio micropore to be measured can be located according to the deep diameter ratio micropore selection instruction.

[0036] Further, the step of drawing the target measurement circle adapted to the deep diameter ratio micropore to be measured on the original frame image comprises: initializing a sliding bar control in a parameter panel and obtaining operation information of the user on the initialized sliding bar control; determining a current calibration parameter and a current space transformation parameter according to the operation information; and drawing the target measurement circle adapted to the deep diameter ratio micropore to be measured on the original frame image according to the current calibration parameter and the current space transformation parameter.

[0037] It should be understood that before drawing the target measurement circle adapted to the deep diameter ratio micropore to be measured, the sliding bar control in the parameter panel needs to be initialized to prepare to dynamically bind the current calibration parameter and the current space transformation parameter, and the sliding bar control can be represented as cv::createTrackbar and embedded in the parameter panel. The user can trigger a closed-loop feedback workflow by operating the initialized sliding bar control. The current calibration parameter includes but is not limited to the center coordinates of the circle, the radius, etc. For example, dragging the Circle X / Y slider (0-5120 pixels) to update the center coordinates of the circle in real time, adjusting the Radius slider (0-2000 pixels) to control the size of the measurement circle, and triggering the onTrackbar() callback function.

[0038] It should be noted that the current space transformation parameter includes but is not limited to the scaling parameter and the offset parameter. For the scaling parameter, the imageScale parameter (40%-1000%) can be used to control the display ratio, and the cv::resize() function dynamically adjusts the image size. For the offset parameter, the sliding Offset X / Y controls the image translation (±800 pixels). The specific formula can be represented as: Actual offset X = offsetX (interactive interface offset X) - 2600 (center calibration value) Actual offset Y = offsetY (interactive interface offset Y) - 1920 (center calibration value) It can be understood that a four-dimensional parameter panel is superimposed on the upper left corner of the view, which includes: a physical diameter formula diameter (μm) = 2 x radius / 7.225, a scaling ratio (40%-100%), a view offset (X / Y Cartesian coordinates), and a center position (image coordinate system). The control interactive event response delay forms a perception closed loop of "user operation-visual feedback-parameter adjustment".

[0039] It should be understood that the present embodiment can also determine the current calibration parameter and the current spatial transformation parameter by triggering the automatic recognition module, specifically: after generating the comprehensive gradient amplitude image by executing the Sobel gradient calculation thread, applying a high gradient threshold for filtering to retain significant edge structure, and using morphological operations for connection and denoising, specifically: first using the dilation operation to connect the edge breakpoints, then using the erosion operation to smooth the profile, then using the Canny edge detection algorithm to extract the accurate continuous hole profile, and then using a large size morphological dilation (kernel size 183x183) to ensure the closure of the inner profile; finally, by finding the profile and filtering the inner profile with the parent profile, the minimum circumscribed circle algorithm is used to fit the most possible micro-hole center and radius, and the fitting result is automatically fed back to the initialized slider control, forming an automatic pipeline of "one-key recognition-parameter self-update-measurement result output", which greatly improves the efficiency and accuracy of drawing the target measurement circle.

[0040] Step S30, detecting the pixel distance parameter of the target measurement circle, triggering the target size conversion module to convert the pixel distance parameter to obtain the micron-level physical size measurement value of the circular parameter of the deep-diameter ratio micro-hole to be measured.

[0041] It should be understood that the target size conversion module can be a pixel-micron conversion module, and the core feature is calibration traceability and real-time conversion. The target size conversion module has a built-in double-precision floating-point conversion engine, and the basic conversion formula can be expressed as: Physical diameter = 2 x radius / calibration coefficient Wherein, the calibration coefficient can be obtained by calibration of NIST traceable standard parts.

[0042] It should be noted that after detecting the pixel distance parameter of the target measurement circle, the radius slider can be adjusted to trigger the real-time operation of the target size conversion module, i.e. to convert the pixel distance parameter of the target measurement circle into the micron-level physical size measurement value of the circular parameter of the deep-diameter ratio micro-hole to be measured, and the conversion result is displayed in real time through the floating window and written into the log file to ensure that the data can be traced back to the NIST standard.

[0043] It is also necessary to emphasize that after obtaining the micron-level physical size measurement value of the circular parameter of the deep-diameter ratio micro-hole to be measured, the micron-level physical size measurement value can be used to guide the user to further adjust the measurement parameters. The real-time interactive observation of high-resolution images can also be realized through the offset calibration of the Cartesian coordinate system and the ROI cropping method protection mechanism of the boundary safety. The ROI cropping method can first obtain the original offset parameter through the sliding bar input, perform coordinate space transformation, and the center calibration value is derived from the geometric center (2560, 1920) of the 5120×3840 resolution image. Through the preset 800 pixel translation margin, a dynamic observation range of ±800 pixels is realized. In the rendering stage, the boundary constraint algorithm is adopted to ensure the effectiveness of the display area, specifically: drawStartX = std::clamp(std::max(0, -startX), 0, scaledImage.cols) drawEndX = std::clamp(std::min(scaledImage.cols, canvasWidth -startX) Wherein, drawStartX represents the starting point of the X coordinate after multiple protection calculations, the output range is [0, scaledImage.cols], to prevent accessing non-existent images, drawEndX represents the end point of the X coordinate after multiple protection calculations, the output range is [drawStartX, scaledImage.cols], to ensure that it will not exceed the right boundary of the canvas, -startX is the negative value of startX, representing the pixel value of the image left side being moved out of the left boundary of the canvas, scaledImage.cols represents the actual width of the scaled image, canvasWidth represents the fixed width of the canvas, both of which are used to judge whether the ROI is out of bounds.

[0044] It should be understood that the triple security protection can be achieved by the above boundary constraint algorithm, which are: negative overflow protection, negative coordinate is forced to zero by std::max(0, -startX), eliminating the left blank area caused by excessive left shift; positive boundary constraint protection, using std::min(scaledImage.cols, canvasWidth - startX) to strictly limit the display area not to exceed the right boundary of the canvas, to prevent the image from being truncated on the right; coordinate space constraint protection, applying std::clamp to strictly limit the coordinate value in the closed interval [0, width], forming a coordinate space safety zone, wherein width represents the width. This multiple security protection mechanism ensures that the display area is always in the safe mapping space of the image data matrix and the canvas view when the user adjusts the ±800 pixel offset range arbitrarily, completely eliminates the memory access exception caused by coordinate out-of-bounds, while maintaining the high frame rate rendering performance of 30fps.

[0045] It can be understood that the above "physical-digital-physical" closed loop logic makes the whole system have both automatic processing capability and human-computer collaborative intelligence, and finally realizes the ±0.1 μm precision measurement of the deep-diameter ratio>5:1 micro-hole. Through strict timing synchronization (thread start-stop control) and spatial isolation (shared memory protection), the stability of the system under high load is ensured.

[0046] Further, after step S30, further comprising: writing the micron-level physical size measurement value of the circle parameter of the micro-hole to be measured in real time into a log file; obtaining the key information of the user, and identifying the key information; when the identified key feature information is first feature information, saving the image; when the identified key feature information is second feature information, setting an atomic flag bit, and controlling the image acquisition thread, the Sobel gradient calculation thread and the pseudo-color enhancement thread to exit the loop; stop reading the original frame image from the target memory area, release the device handle corresponding to the target camera device, destroy the double view display framework and release the target memory area.

[0047] It should be noted that, in order to ensure that the data is traceable to the NIST standard, after obtaining the micron-level physical size measurement value of the circular parameter of the deep-diameter ratio micro-hole to be measured, the micron-level physical size measurement value of the circular parameter of the deep-diameter ratio micro-hole to be measured can be written into a log file in real time. The first feature information can be the feature information of the save key, and the second feature information can be the feature information of the exit key. The save key can be an "S" key, and the exit key can be an "ESC" key. When the identified key feature information is the first feature information, the current canvas image is saved. When the identified key feature information is the second feature information, the safe exit is performed. The atomic flag bit running is set to false, all threads are notified to exit the loop, the MV_CC_StopGrabbing() function is called to stop reading the original frame image, the MV_CC_DestroyHandle() function is called to release the device handle corresponding to the target camera device, the double-view display framework is destroyed, and the target memory area is released, thereby completing resource recycling.

[0048] It should be understood that, with reference to Figure 2 , Figure 2 For the measurement result visualization diagram, specifically, after obtaining the micron-level physical size measurement value of the circular parameter of the deep-diameter ratio micro-hole to be measured, the micron-level physical size measurement value is visually displayed on the Canvas view window, for example, the diameter Diameter is 243.598618. In addition, the Grad view window displays a target enhanced gradient image superimposed with a target measurement circle, and supports measurement result labeling and canvas image saving functions.

[0049] The embodiment reads an original frame image from a target memory area, and performs edge feature enhancement on the original frame image through a multi-thread architecture to obtain a target enhanced gradient image. A deep-diameter ratio micro-hole to be measured at a micron level is determined according to the target enhanced gradient image, and a target measurement circle corresponding to the deep-diameter ratio micro-hole to be measured is drawn on the original frame image. A pixel distance parameter of the target measurement circle is detected, and the pixel distance parameter is converted through a triggered target size conversion module to obtain a micron-level physical size measurement value of a circular parameter of the deep-diameter ratio micro-hole to be measured. In the above manner, the original frame image is subjected to edge feature enhancement in a manner of Gaussian filter denoising, gradient amplitude fusion and pseudo-color mapping through an image acquisition thread, a Sobel gradient calculation thread and a pseudo-color enhancement thread separated by the multi-thread architecture, and the target measurement circle drawn by using a dynamic calibration strategy is used for measurement, so that lossless, dynamic and high-precision measurement of a circular parameter of a deep-diameter ratio micro-hole can be realized, thereby providing reliable technical support for precision device quality inspection.

[0050] In a specific embodiment, the present application provides a step of obtaining a target enhanced gradient image. Please refer to Figure 3 , Figure 3 Figure 2 is a flowchart of a second embodiment of the method for optically and nondestructively measuring parameters of a micro-hole with a large depth-to-diameter ratio. Step S10 includes steps S101-S105. Step S101 determines image acquisition threads, Sobel gradient calculation threads, and pseudo-color enhancement threads according to a multi-thread architecture.

[0051] It should be noted that the multi-thread architecture is used to decouple the computationally intensive task into three parallel execution threads, i.e., the image acquisition threads, the Sobel gradient calculation threads, and the pseudo-color enhancement threads. The three threads are decoupled through a task queue and are bound to independent CPU cores (thread affinity), thereby maximizing the use of computing resources.

[0052] Step S102 continuously reads raw frame images from a target memory area through the image acquisition threads and a double buffering mechanism, and converts the raw frame images into a target image matrix.

[0058] It can be understood that, in order to ensure stable frame rate, the raw frame images are continuously read from the target memory area through the image acquisition threads and the double buffering mechanism. When reading, the MV_CC_GetOneFrameTimeout() function can be called, and the raw frame images are converted into a target image matrix, which can be an OpenCV matrix (cv::Mat). The target image matrix is stored in the global variables getMat (single-channel grayscale image) and originalImage (three-channel BGR image).

[0054] Step S103 performs spatial filtering on the target image matrix through the Sobel gradient calculation threads.

[0055] It should be understood that, in order to eliminate photon shot noise in the target image matrix, the Sobel gradient calculation threads are used to apply a Gaussian kernel to the target image matrix for spatial filtering through an algorithm fusion strategy. The size of the Gaussian kernel is 3x3, and σ=1.5.

[0056] Step S104 performs gradient calculation on the filtered target image matrix according to a separate Sobel operator, and generates a comprehensive gradient amplitude image according to the gradient calculation result.

[0057] It can be understood that, after obtaining the filtered target image matrix, gradient calculation can be performed on the filtered target image matrix according to a separate Sobel operator. The gradient calculation result can be X / Y direction gradient. The separate Sobel operator can be represented as cv::Sobel, with a kernel size of 3, and is processed in parallel using SIMD instructions. Then, a comprehensive gradient amplitude image is generated through weighted fusion, which can be represented as cv::addWeighted, α=0.5, and β=0.5.

[0058] In step S105, the pseudo-color enhancement thread is used to normalize the integrated gradient amplitude image, and the color spectrum mapping is performed on the processed integrated gradient amplitude image to obtain the target enhanced gradient image.

[0059] It should be understood that after the integrated gradient amplitude image is obtained, the integrated gradient amplitude image can be normalized by the pseudo-color enhancement thread, that is, the gradient is normalized to the range of 0-255. The pseudo-color enhancement thread introduces visual perception optimization. In order to effectively improve the contrast of the edge of the micro-hole with a large depth-diameter ratio, after the integrated gradient amplitude image is normalized by the pseudo-color enhancement thread, the color spectrum mapping needs to be performed on the processed integrated gradient amplitude image, that is, the low gradient is mapped to blue, and the high gradient is mapped to red.

[0060] In the embodiment, the image acquisition thread, the Sobel gradient calculation thread, and the pseudo-color enhancement thread are determined according to the multi-thread architecture. The original frame image is continuously read from the target memory area by the image acquisition thread and the double-buffering mechanism, and the original frame image is converted into a target image matrix. The target image matrix is filtered by the Sobel gradient calculation thread. The gradient calculation is performed on the filtered target image matrix according to the separated Sobel operator, and the integrated gradient amplitude image is generated according to the gradient calculation result. The integrated gradient amplitude image is normalized by the pseudo-color enhancement thread, and the color spectrum mapping is performed on the processed integrated gradient amplitude image to obtain the target enhanced gradient image. In the above manner, after the image acquisition thread, the Sobel gradient calculation thread, and the pseudo-color enhancement thread are separated according to the multi-thread architecture, the continuously read original frame image is converted into a target image matrix by the image acquisition thread, the integrated gradient amplitude image is generated by the Sobel gradient calculation thread, and the target enhanced gradient image is color spectrum mapped by the pseudo-color enhancement thread. Therefore, the accuracy of the target enhanced gradient image can be effectively improved.

[0061] The optical nondestructive measurement system for the parameters of the micro-hole circle with a large depth-diameter ratio provided in the present application is described below. The optical nondestructive measurement system for the parameters of the micro-hole circle with a large depth-diameter ratio described below can be mutually referred to the optical nondestructive measurement method for the parameters of the micro-hole circle with a large depth-diameter ratio described above. Please refer to Figure 4 , Figure 4 FIG. 1 is a schematic diagram of the module structure of the optical nondestructive measurement system for the parameters of the micro-hole circle with a large depth-diameter ratio provided in the embodiment of the present application, which comprises: The parallel processing module T10 is used to read the original frame image from the target memory area, and the edge feature of the original frame image is enhanced by the multi-thread architecture to obtain the target enhanced gradient image.

[0062] An interaction application module T20 is configured to determine a micro-level deep-diameter ratio micro-hole to be measured according to the target reinforcement gradient image, and draw a target measurement circle on the original frame image, the target measurement circle being adapted to the deep-diameter ratio micro-hole to be measured.

[0063] A conversion module T30 is configured to detect a pixel distance parameter of the target measurement circle, convert the pixel distance parameter by triggering a target size conversion module, and obtain a micro-level physical size measurement value of a circle parameter of the deep-diameter ratio micro-hole to be measured.

[0064] In the embodiment, the original frame image is read from a target memory area, and the original frame image is subjected to edge feature reinforcement through a multi-thread architecture to obtain a target reinforcement gradient image; a micro-level deep-diameter ratio micro-hole to be measured is determined according to the target reinforcement gradient image, and a target measurement circle is drawn on the original frame image, the target measurement circle being adapted to the deep-diameter ratio micro-hole to be measured; a pixel distance parameter of the target measurement circle is detected, and the pixel distance parameter is converted by triggering a target size conversion module to obtain a micro-level physical size measurement value of a circle parameter of the deep-diameter ratio micro-hole to be measured. In the foregoing manner, the original frame image is subjected to edge feature reinforcement through a multi-thread architecture including an image acquisition thread, a Sobel gradient calculation thread, and a pseudo-color enhancement thread in a manner of Gaussian filter denoising, gradient amplitude fusion, and pseudo-color mapping, and the target measurement circle drawn by using a dynamic calibration strategy is used for measurement, so that lossless, dynamic, and high-precision measurement of a deep-diameter ratio micro-hole circle parameter can be achieved, and reliable technical support can be provided for precision device quality inspection.

[0065] It can be understood that the detailed function implementation of each module can be referred to the foregoing description in the method embodiment, and will not be described herein.

[0066] It should be understood that the above device is used to execute the method in the above embodiment, and the corresponding program module in the device has similar implementation principles and technical effects to the description in the above method, and the working process of the device can be referred to the corresponding process in the above method, which will not be described herein.

[0067] Based on the method in the above embodiment, an electronic device is provided in the embodiment of the present application, which can be referred to Figure 5 , Figure 5 is a structural schematic diagram of the electronic device provided in the embodiment of the present application.

[0068] It should be noted that the processor (Processor) 10, the communication interface (Communications Interface) 20, the memory (Memory) 30 can be communicated through the communication bus 40. The processor 10 can call the logic instructions in the memory 30 to execute the method in the above embodiment.

[0069] In addition, the logic instructions in the memory 30 described above can be realized in the form of a software function unit and sold or used as an independent product, which can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in the embodiments of the present application.

[0070] Based on the method in the above embodiment, the embodiment of the present application provides a computer readable storage medium, which stores a computer program. When the computer program runs on the processor, the processor executes the method in the above embodiment.

[0071] Based on the method in the above embodiment, the embodiment of the present application provides a computer program product. When the computer program product runs on the processor, the processor executes the method in the above embodiment.

[0072] It can be understood that the processor in the embodiment of the present application can be a central processing unit, and can also be other general-purpose processors, digital signal processors, application-specific integrated circuits, field programmable gate arrays or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor can be a microprocessor, or any conventional processor.

[0073] The method steps in the embodiment of the present application can be realized by hardware or by the processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, a register, a hard disk, a mobile hard disk or any other form of storage medium well known in the art. An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor.

[0074] It can be understood that various digital numbers involved in the embodiments of the present application are only distinguished for convenience of description, and are not used to limit the scope of the embodiments of the present application. It is easy for those skilled in the art to understand that the above is only the preferred embodiments of the present application, and is not used to limit the present application, and any modification, equivalent replacement and improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.< / bool> < / bool>

Claims

1. A method for optical non-destructive measurement of large depth-to-diameter ratio microporous circle parameters, characterized in that, The method comprises the following steps: reading a raw frame image from a target memory area, and performing edge feature enhancement on the raw frame image through a multi-thread architecture to obtain a target enhanced gradient image; determining a micron-level to-be-measured deep-diameter ratio micropore according to the target enhanced gradient image, and drawing a target measurement circle on the raw frame image, the target measurement circle being adapted to the to-be-measured deep-diameter ratio micropore; detecting a pixel distance parameter of the target measurement circle, converting the pixel distance parameter through a target size conversion module to obtain a micron-level physical size measurement value of a circle parameter of the to-be-measured deep-diameter ratio micropore.

2. The method of claim 1, wherein, The step of reading a raw frame image from a target memory area and performing edge feature enhancement on the raw frame image through a multi-thread architecture to obtain a target enhanced gradient image comprises the following steps: determining an image acquisition thread, a Sobel gradient calculation thread and a pseudo-color enhancement thread according to the multi-thread architecture; continuously reading a raw frame image from a target memory area through the image acquisition thread and a double-buffering mechanism, and converting the raw frame image into a target image matrix; performing spatial filtering on the target image matrix through the Sobel gradient calculation thread; performing gradient calculation on the filtered target image matrix according to a separated Sobel operator, and generating a comprehensive gradient amplitude image according to the gradient calculation result; performing normalization processing on the comprehensive gradient amplitude image through the pseudo-color enhancement thread, and performing color spectrum mapping on the processed comprehensive gradient amplitude image to obtain a target enhanced gradient image.

3. The method of claim 1, wherein, Before the step of reading a raw frame image from a target memory area, the method further comprises the following steps: performing hardware initialization through an initialization function to establish a bottom-layer communication environment; performing device enumeration through an enumeration function, and generating a target device information list according to the information of each available device enumerated; determining a target camera device according to the target device information list, and creating a device handle corresponding to the target camera device through a creation function to establish a hardware connection channel through the device handle; starting the target camera device according to the bottom-layer communication environment and the hardware connection channel, and configuring a preset transmission bandwidth and a dynamically set target parameter set for the started target camera device; controlling the target camera device configured with the parameters to acquire a raw frame image, and writing the raw frame image into a target memory area through a zero-copy mechanism.

4. The method of claim 1, wherein, The step of determining a micron-level to-be-measured deep-diameter ratio micropore according to the target enhanced gradient image comprises the following steps: constructing a dual-view display framework through an OpenCV window system and an automated recognition trigger interface; wherein the dual-view display framework comprises a first window and a second window; rendering a raw frame image in the first window, and displaying the target enhanced gradient image in the second window; determining a user's deep-diameter ratio micropore selection instruction according to the raw frame image and the target enhanced gradient image; locating a micron-level to-be-measured deep-diameter ratio micropore according to the deep-diameter ratio micropore selection instruction.

5. The method of claim 1, wherein, The step of drawing a target measurement circle on the raw frame image, the target measurement circle being adapted to the to-be-measured deep-diameter ratio micropore, comprises the following steps: Initialize a sliding bar control in a parameter panel, and obtain operation information of the initialized sliding bar control by a user; Determine a current calibration parameter and a current spatial transformation parameter according to the operation information; Draw a target measurement circle corresponding to the to-be-measured deep-ratio micro-hole on the original frame image according to the current calibration parameter and the current spatial transformation parameter.

6. The method of any one of claims 1 to 5, wherein, After the step of converting the pixel distance parameter of the target measurement circle by triggering the target size conversion module to obtain the micron-level physical size measurement value of the circular parameter of the to-be-measured deep-ratio micro-hole, the method further includes: Real-time writing the micron-level physical size measurement value of the circular parameter of the to-be-measured deep-ratio micro-hole into a log file; Obtaining key information of a user and identifying the key information; When the identified key feature information is first feature information, saving an image; When the identified key feature information is second feature information, setting an atomic flag bit and controlling an image acquisition thread, a Sobel gradient calculation thread, and a pseudo-color enhancement thread to exit a loop; Stopping reading an original frame image from a target memory area, releasing a device handle corresponding to a target camera device, destroying a dual-view display framework, and releasing the target memory area.

7. A system for optical non-destructive measurement of large aspect ratio microporous circular parameters, characterized in that, The system is applied to the method of any one of claims 1-6, and includes: A parallel processing module configured to read an original frame image from a target memory area and perform edge feature enhancement on the original frame image through a multi-thread architecture to obtain a target enhanced gradient image; An interactive application module configured to determine a micron-level to-be-measured deep-ratio micro-hole according to the target enhanced gradient image and draw a target measurement circle corresponding to the to-be-measured deep-ratio micro-hole on the original frame image; A conversion module configured to detect a pixel distance parameter of the target measurement circle, convert the pixel distance parameter by triggering a target size conversion module, and obtain a micron-level physical size measurement value of a circular parameter of the to-be-measured deep-ratio micro-hole.

8. An electronic device, comprising: including: At least one memory configured to store a computer program; At least one processor configured to execute the program stored in the memory, and when the program stored in the memory is executed, the processor is configured to execute the method of any one of claims 1-6.

9. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 8. When the computer program runs on the processor, the processor is caused to execute the method of any one of claims 1-6.

10. A computer program product, characterised in that, When the computer program product runs on the processor, the processor is caused to execute the method of any one of claims 1-6.