Video key frame extraction based quartz microscopic acquisition device and inclusion analysis method
Patent Information
- Application Number
- CN202610887232.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-18
- Publication Date
- 2026-10-13
AI Technical Summary
[0004]传统的显微镜载物台手动调节方式效率低下,难以实现大范围、高精度的连续扫描,虽然现有技术中已有采用步进电机驱动载物台的方案,但控制精度、抗干扰能力和自动化程度仍有待提高,由于显微镜视野有限,需要拍摄多幅图像并进行拼接才能获得完整的样品图像,现有图像拼接方法多基于特征点匹配,对于纹理特征不明显的显微图像,拼接效果不佳,且难以处理非规则移动模式下拍摄的图像序列
(1)本发明中载物台集成角度调节、Z轴升降、X/Y轴平移三维调节结构,通过蜗轮蜗杆配合弧形轨实现角位台精准转角、楔形斜面传动实现托台平稳升降、丝杆配合步进电机实现X/Y轴线性位移,替代传统手动调节方式,可完成大范围、高精度的连续扫描移动,解决了传统显微镜载物台调节效率低、无法连续高精度扫描的问题。
Smart Images

Figure CN122901169A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of microscope image acquisition technology, specifically relating to a device and method for analyzing inclusions based on video keyframe extraction and quartz microscopic acquisition. Background Technology
[0002] High-purity quartz, as an indispensable strategic material, occupies an important position in high-end technology fields such as semiconductors, optics, optical communications, solar energy, defense, and aerospace. However, impurities in these ordinary quartzes often exist in the main mineral in three states: gangue minerals, gas-liquid inclusions, and isomorphous inclusions. Among them, trace element impurities and gas and liquid impurities in gas-liquid inclusions are one of the main factors affecting the quality of high-purity quartz products. Current research and practice generally believe that the content of gas-liquid inclusions in high-quality high-purity quartz sand should be as low as possible, but the removal of gas-liquid inclusions is difficult. Therefore, selecting high-quality raw ore is the key to the preparation of high-purity quartz. Studies have shown that high-quality gangue quartz used to prepare high-purity quartz has a lower content of gas-liquid inclusions compared to ordinary gangue quartz.
[0003] Currently, the study of gas-liquid inclusions in high-purity quartz has attracted widespread attention. Researchers have conducted in-depth studies on the composition, structure and properties of gas-liquid inclusions using various testing instruments such as laser-microscope Raman spectroscopy (PL-Raman), scanning electron microscope-cathodic emission spectroscopy (SEM-CL), and laser ablation inductively coupled plasma mass spectrometry (LA-ICP-MS). However, in practical applications, the detection of gas-liquid inclusions in quartz is still mainly based on microscopic observation.
[0004] Traditional manual adjustment of microscope stages is inefficient and makes it difficult to achieve large-scale, high-precision continuous scanning. Although there are existing technologies that use stepper motors to drive the stage, the control accuracy, anti-interference ability, and automation level still need to be improved. Due to the limited field of view of microscopes, multiple images need to be captured and stitched together to obtain a complete sample image. Existing image stitching methods are mostly based on feature point matching, which results in poor stitching effects for microscopic images with indistinct texture features and makes it difficult to handle image sequences captured under irregular movement modes. Summary of the Invention
[0005] The purpose of this section is to outline some aspects of embodiments of the present invention and to briefly describe some preferred embodiments. Simplifications or omissions may be made in this section, as well as in the abstract and title of this application, to avoid obscuring the purpose of these documents; however, such simplifications or omissions should not be construed as limiting the scope of the invention.
[0006] To address the problems mentioned in the background section, the present invention adopts the following technical solution.
[0007] A device for extracting keyframes from video and acquiring data using quartz microscopy includes a mirror base, a mirror column mounted on the upper surface of the mirror base, a cylindrical base mounted on the upper end of the mirror column, a stage mounted on the upper surface of the mirror base, and the stage including at least a base. An angle stage is slidably connected to the base. Arc-shaped grooves are formed on both sides of the upper surface of the base, and arc-shaped rails are mounted on both sides of the lower surface of the angle stage. The arc-shaped rails and arc-shaped grooves are adapted to each other. The angle stage moves in a circular motion on the base through the cooperation of the arc-shaped rails and arc-shaped grooves, thereby achieving angle adjustment. A wedge stage is slidably connected to the upper surface of the angle stage, and a wedge block is slidably connected to the wedge stage. When the displacement wedge stage moves linearly, the wedge block is raised and lowered by using an inclined plane. A support is mounted on the upper surface of the wedge block, and a first adjusting plate is slidably connected to the support. The first adjusting plate moves along the X-axis on the support, and a second adjusting plate is slidably connected to the upper surface of the first adjusting plate. The second adjusting plate moves along the axial direction on the first adjusting plate, and a glass slide is placed on the second adjusting plate.
[0008] Preferably, a drive box is installed on both the support platform and the first adjusting plate, and a first lead screw is rotatably connected to the drive box through a bearing seat. A third stepper motor is installed on one end of the first lead screw. A screw sleeve is installed on one side of both the first adjusting plate and the second adjusting plate, and the screw sleeve is threadedly connected to the first lead screw.
[0009] Preferably, the inner side of the drive box has a waist hole for the threaded sleeve to extend into, and the bottom of the drive box has three photoelectric limit sensors arranged at equal intervals. The lower surface of the threaded sleeve has a trigger adapted to the photoelectric limit sensor, and the photoelectric limit sensor is connected to the output circuit of the third stepper motor. The photoelectric limit sensor limits the maximum movement path of the first adjustment plate and the second adjustment plate and the center point positioning through the photoelectric limit sensor.
[0010] Preferably, the upper surface of the second adjusting plate has a centrally located placement groove, and the two sides of the placement groove have symmetrically arranged arc-shaped mounting grooves. The mounting grooves are rotatably connected to the clamps via shafts, and torsion springs are sleeved on the shafts to abut against the clamps. The lower surface of the second adjusting plate has symmetrically arranged second slide bars, and the upper surface of the first adjusting plate has a corresponding fourth slide rail. The lower surface of the first adjusting plate has symmetrically arranged first slide bars, and the upper surface of the support has a corresponding third slide rail.
[0011] Preferably, the upper inclined surface of the wedge platform is provided with a second slide rail, and the lower inclined surface of the wedge block is provided with a linear slide groove. The wedge block is slidably connected to the second slide rail through the linear slide groove. A second stepper motor is installed on the front surface of the corner platform. The drive end of the second stepper motor is connected to a second lead screw. A screw hole is provided in the center of the front end of the wedge platform to match the second lead screw. The displacement of the wedge platform is controlled by driving the second lead screw through the second stepper motor. When the wedge platform is displaced, it abuts against the wedge block to realize the lifting and lowering of the support platform. The upper surface of the corner platform is symmetrically fitted with a first slide rail, and the lower surface of the wedge platform is slidably connected to the first slide rail.
[0012] Preferably, a first stepper motor is installed on the front surface of the base, the drive end of the first stepper motor is connected to a worm gear, and a worm wheel is connected in the center of the lower surface of the corner platform. The worm wheel meshes with the worm gear, and the center of the worm wheel coincides with the center of the arc of the arc rail. The first stepper motor drives the worm gear to rotate, thereby realizing the angle adjustment of the corner platform on the base.
[0013] Preferably, the front surface of the mirror mount is equipped with a touch screen, and the touch screen is externally connected to a fully isolated RS485 and an MCU main control board via wires. The fully isolated RS485 and the MCU main control board are connected to all electric drive components of the device for signal transmission. Commands are issued through the touch screen, and the fully isolated RS485 and the MCU main control board are used to control the specific electric drive components to execute commands.
[0014] Preferably, an eyepiece is mounted on the front surface of the base, a signal processor is mounted on the upper surface of the base, and an objective lens and an infrared scanner are mounted on the lower surface of the base, with the infrared scanner and the signal processor connected by signal.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) The stage of this invention integrates a three-dimensional adjustment structure for angle adjustment, Z-axis lifting, and X / Y-axis translation. The worm gear and arc rail achieve precise rotation of the corner stage, the wedge-shaped inclined plane transmission achieves smooth lifting of the stage, and the lead screw and stepper motor achieve linear displacement of the X / Y axis. This replaces the traditional manual adjustment method and can complete a wide range of high-precision continuous scanning movement, solving the problems of low adjustment efficiency and inability to perform continuous high-precision scanning in traditional microscope stages.
[0016] (2) In this invention, a fully isolated RS485 + MCU main control board is used to control all electric drive components in a unified manner. With the help of a touch screen, the visual command operation is realized, and the automation level of the device is significantly improved. The fully isolated RS485 communication can reduce industrial environment interference and solve the problems of weak anti-interference ability and low automation level of existing similar devices. Furthermore, photoelectric limit sensors are set in the drive box at equal intervals. With the trigger under the screw sleeve, the travel limit of the X / Y axis movement and the automatic positioning of the center point are realized. Combined with the transmission structure of the stepper motor and the lead screw, the displacement control accuracy is higher, which effectively improves the defect of insufficient control accuracy of the existing electric drive stage and ensures the position accuracy of image acquisition.
[0017] (3) In this invention, angle adjustment can eliminate the blind spot caused by sample placement deviation, so that gas-liquid inclusions with different orientations and burial depths are at the best imaging angle. Combined with fully automatic acquisition and analysis, it significantly improves detection efficiency and data integrity, and meets the high-precision detection requirements of high-purity quartz raw materials in high-end fields such as semiconductors and optics.
[0018] (4) The present invention adopts video continuous acquisition + key frame intelligent extraction technology. Through invalid region cropping, stable frame screening and frame deduplication, redundant video images and blurry interference frames are eliminated. Under the premise of ensuring the integrity of image information, the amount of data operation is greatly reduced, and the efficiency and accuracy of subsequent image processing are improved.
[0019] (5) The present invention adopts a hierarchical target recognition algorithm, first segmenting the quartz particle area and then targeting the inclusions to accurately distinguish between effective targets and interfering impurities. Combined with the pixel-physical size conversion model, it realizes fully automatic quantitative statistics of the number, size and distribution ratio of inclusions, replacing manual calculation, greatly improving detection accuracy and efficiency, and providing strong data traceability.
[0020] (6) This invention is compatible with multiple modes such as fixed-point detection, continuous scanning and region traversal, and supports the switching of line-by-line and Z-shaped dual scanning paths. It can simultaneously meet the scenarios of fine full-domain detection of single samples and high-throughput detection of batch samples, and has strong adaptability and versatility. Attached Figure Description
[0021] Figure 1 This is an assembly diagram of the video keyframe extraction and quartz microscopy acquisition device and microscope used in this invention.
[0022] Figure 2 This is a three-dimensional structural diagram of the video keyframe extraction and quartz microscopic acquisition device in this invention.
[0023] Figure 3 This invention relates to the disassembly of the base of a video keyframe extraction and quartz microscopic acquisition device. Figure 1 .
[0024] Figure 4 This invention relates to the disassembly of the base of a video keyframe extraction and quartz microscopic acquisition device. Figure 2 .
[0025] Figure 5 This invention relates to the stage splitting based on video keyframe extraction and quartz microscopic acquisition device. Figure 1 .
[0026] Figure 6 This invention relates to the stage splitting based on video keyframe extraction and quartz microscopic acquisition device. Figure 2 .
[0027] Figure 7 This invention relates to the disassembly of the adjustment plate based on video keyframe extraction and quartz microscopic acquisition device. Figure 1 .
[0028] Figure 8 This is a split diagram of the adjustment plate and drive assembly of the video keyframe extraction and quartz microscopic acquisition device in this invention.
[0029] Figure 9 This is a structural diagram of the driving component of the video keyframe extraction and quartz microscopic acquisition device of the present invention.
[0030] Figure 10 A flowchart of the method of the present invention.
[0031] Figure 11 This is a schematic diagram of the microscope slide displacement control system of the present invention.
[0032] Figure 12 This is a flowchart for extracting keyframes from video according to the present invention.
[0033] Figure 13 This is a flowchart of the intelligent image stitching process of the present invention.
[0034] Figure 14 This is a flowchart of the target identification and content calculation process of the present invention.
[0035] The correspondence between the labels and component names in the attached figures is as follows: 100. Lens mount; 100a. Touch screen; 101. Lens column; 102. Lens barrel; 102a. Eyepiece; 102b. Objective lens; 103. Signal processor; 103a. Infrared scanner; 200. Stage; 201. Base; 201a. Arc groove; 201b. Worm gear; 201c. First stepper motor; 202. Angular stage; 202a. Arc rail; 202b. Worm gear; 202c. Second stepper motor; 202d. First slide rail; 203. Wedge stage; 203a. Second... 204. Slide rail; 204a. Support platform; 204b. Wedge block; 204c. Linear slide groove; 204c. Third slide rail; 205. First adjusting plate; 205a. Fourth slide rail; 205b. First slide bar; 206. Second adjusting plate; 206a. Screw sleeve; 206b. Placement groove; 206c. Mounting groove; 206d. Clamping piece; 206e. Second slide bar; 207. Drive box; 207a. Waist hole; 207b. First lead screw; 207c. Third stepper motor; 207d. Photoelectric limit sensor. Detailed Implementation
[0036] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0037] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0038] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places throughout this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that mutually excludes other embodiments. The present invention provides the following embodiments.
[0039] See Figure 1 This embodiment discloses a quartz microscopic image acquisition device based on video keyframe extraction. The device is mounted on a mirror base 100. A mirror column 101 is vertically fixed to the upper surface of the mirror base 100, and a cylindrical base 102 is horizontally mounted on the upper end of the mirror column 101. The cylindrical base 102 serves as the support structure for the optical imaging components. A stage 200 is mounted on the upper surface of the mirror base 100 and on one side of the mirror column 101. The stage 200 and the optical components below the cylindrical base 102 cooperate to complete the microscopic image acquisition of the quartz sample. A touchscreen 100a is embedded in the front surface of the mirror base 100. The touchscreen 100a is externally connected to a fully isolated RS485 communication module and an MCU main control board via wires. The main control board establishes signal connections with all the stepper motors, photoelectric limit sensors, and other electric drive components within the device. Operators can input control commands through the touchscreen 100a, and the commands are transmitted via RS485 communication modules. RS485 communication transmits data to the MCU main control board, which then centrally schedules the actions of each electrically driven component. Fully isolated RS485 communication effectively suppresses electromagnetic interference on-site, improves the stability of control signal transmission, and enables visualized, automated, and centralized control of the device. Furthermore, an eyepiece 102a is mounted on the front surface of the base 102 for real-time manual observation. A signal processor 103 is mounted on the upper surface of the base 102, and an objective lens 102b and an infrared scanner 103a are mounted on the lower surface. The objective lens 102b performs optical magnification imaging of the quartz sample, while the infrared scanner 103a synchronously acquires the infrared scanning signal of the sample and transmits the signal to the signal processor 103 for processing. Combined with video keyframe extraction and intelligent stitching algorithms, the fully automated acquisition and analysis of the quartz sample's microscopic image is finally completed, meeting the high-efficiency detection requirements of high-purity quartz gas-liquid inclusions.
[0040] See Figure 2 , Figure 3 as well as Figure 4In this embodiment, the stage 200 uses a base 201 as its underlying support structure. A corner stage 202 is mounted on top of the base 201. Symmetrical arc-shaped grooves 201a are formed on both sides of the upper surface of the base 201. Arc-shaped rails 202a are correspondingly fixed on both sides of the lower surface of the corner stage 202. The outer dimensions of the arc-shaped rails 202a are perfectly matched with the arc-shaped grooves 201a, forming a sliding guide fit. This allows the corner stage 202 to perform stable circular motion on the base 201 along the trajectory of the arc-shaped grooves 201a, thereby achieving fine-tuning of the overall angle of the stage. A first stepper motor 201c is mounted on the front surface of the base 201, with its drive end connected to a worm gear 201b. A worm wheel 202b is connected at the center of the lower surface of the corner stage 202. The worm wheel 202b maintains stable meshing with the worm gear 201b, and the center of the worm wheel 202b is aligned with the center of the arc of the arc-shaped rail 202a. The overlapping ensures that the transmission center and the rotation center are aligned. The first stepper motor 201c drives the worm gear 201b to rotate, which in turn drives the worm wheel 202b and the angle stage 202 to rotate synchronously, realizing the electronic automation of angle adjustment. This angle adjustment mechanism relies on the large reduction ratio and self-locking characteristics of the worm gear pair, combined with the fitting guidance of the arc-shaped rail and arc-shaped groove. There is no backlash or axial movement during the adjustment process, and there is no slippage or deviation after positioning. The angle control accuracy is high and the stability is strong. It can adaptively adjust the tilt and azimuth angles of quartz samples within a small range and with high precision. It can ensure that gas-liquid inclusions with different orientations and burial depths in the sample are at the optimal imaging angle, effectively eliminating the observation blind zone and imaging blur caused by the deviation of the sample placement angle. It significantly improves the integrity and clarity of the microscopic image acquisition and better meets the needs of multi-directional and multi-angle detection of gas-liquid inclusions in high-purity quartz.
[0041] See Figure 5 and Figure 6In this embodiment, a wedge-shaped transmission structure is provided on the upper surface of the corner platform 202. The first slide rail 202d is symmetrically fitted on the upper surface of the corner platform 202, and the lower surface of the wedge platform 203 is slidably connected to the first slide rail 202d, so that the wedge platform 203 can make stable linear reciprocating movement along the corner platform 202. A second stepper motor 202c is installed on the front surface of the corner platform 202, and its driving end is connected to a second lead screw. A screw hole is opened in the center of the front end of the wedge platform 203. The screw hole is adapted to the thread of the second lead screw. The second stepper motor 202c drives the second lead screw to rotate, which can accurately control the linear displacement of the wedge platform 203. The upper inclined surface of the wedge stage 203 is provided with a second slide rail 203a, and the lower inclined surface of the wedge block 204a is provided with a linear slide groove 204b. The linear slide groove 204b slides in cooperation with the second slide rail 203a. When the wedge stage 203 moves linearly, the inclined surfaces abut against each other and drive the wedge block 204a to rise and fall in the vertical direction. The upper surface of the wedge block 204a is fixed to the support platform 204, thereby realizing the smooth lifting and lowering adjustment of the support platform 204 and completing the Z-axis focusing action required for microscopic observation. The entire lifting process is guided accurately and without lateral shaking. The focusing accuracy meets the requirements of quartz sample microscopic observation.
[0042] See Figure 7 , Figure 8 as well as Figure 9In this embodiment, a first adjusting plate 205 and a second adjusting plate 206 are sequentially mounted above the support platform 204, forming a bidirectional translation structure along the X and Y axes. A third slide rail 204c is correspondingly provided on the upper surface of the support platform 204, and a first slide bar 205b is symmetrically provided on the lower surface of the first adjusting plate 205. The first slide bar 205b slides in cooperation with the third slide rail 204c, allowing the first adjusting plate 205 to move stably along the X-axis on the support platform 204. A fourth slide rail 205a is correspondingly provided on the upper surface of the first adjusting plate 205, and a second slide bar 206e is symmetrically provided on the lower surface of the second adjusting plate 206. The second slide bar 206e slides in cooperation with the fourth slide rail 205a, allowing the second adjusting plate 206 to move stably along the Y-axis on the first adjusting plate 205. The multi-layer slide rail and slide bar cooperation reduces the frictional resistance of movement, ensuring the smoothness and positioning accuracy of bidirectional translation. The glass slide is directly placed on the second adjusting plate 205. On the 6th, the X and Y axes are scanned and moved in a full range along the adjustment plate. Furthermore, a drive box 207 is fixed on both the stage 204 and the first adjustment plate 205. The first lead screw 207b is rotatably mounted inside the drive box 207 through a bearing seat. One end of the first lead screw 207b is connected to the drive end of the third stepper motor 207c, which provides rotational power. A threaded sleeve 206a is fixed on one side of both the first adjustment plate 205 and the second adjustment plate 206. A waist hole 207a is opened on the inner side of the drive box 207. The threaded sleeve 206a passes through the waist hole 207a and is threadedly connected to the first lead screw 207b. When the third stepper motor 207c drives the first lead screw 207b to rotate, the threaded sleeve 206a moves along the lead screw axis, synchronously driving the first adjustment plate 205 and the second adjustment plate 206 to complete the translational movement. The lead screw drive has the advantages of high precision and low backlash, ensuring the positioning accuracy of the scanning movement. Three photoelectric limit sensors 207d are arranged at equal intervals on the inner bottom of the drive box 207. A trigger adapted to the limit sensor is provided on the lower surface of the screw sleeve 206a. The photoelectric limit sensor 207d is connected to the output circuit signal of the third stepper motor 207c. When the trigger moves to the sensor position with the screw sleeve, the sensor outputs a signal to control the motor to start and stop, thereby reliably limiting the maximum movement path of the first adjustment plate 205 and the second adjustment plate 206. At the same time, the center point is automatically positioned to avoid overtravel and improve the position consistency of continuous acquisition.
[0043] See Figure 8In this embodiment, a placement groove 206b is centrally located on the upper surface of the second adjusting plate 206 for positioning and placing the glass slide. A mounting groove 206c with an arc-shaped structure is symmetrically located on both sides of the placement groove 206b. A clamping piece 206d is rotatably connected within the mounting groove 206c via a rotating shaft. A torsion spring is sleeved on the rotating shaft, with both ends of the torsion spring abutting against the mounting groove 206c and the clamping piece 206d, respectively. Under the elastic force of the torsion spring, the clamping piece 206d can automatically press against the center of the placement groove 206b, achieving elastic clamping of the glass slide and effectively preventing the glass slide from shifting or shaking during scanning, thus ensuring the stability of image acquisition.
[0044] Example 2: Video Keyframe Extraction and Quartz Microscopic Acquisition Device and Inclusion Analysis System Specifically, it includes: The microscope slide displacement control module is designed with photoelectric isolation for acquiring position signals and full isolation RS485 human-machine interaction for anti-interference design. The MCU main control board drives the stepper motor by outputting pulse and direction signals, and works with the limit sensor to realize travel protection and origin calibration. The video recording module is used to record quartz samples under a microscope using video. A video keyframe extraction module is used to extract keyframes from a video and convert the video into an image sequence; the video keyframe extraction module includes: The cropping range detection submodule is used to analyze video frames and determine the valid image region; The frame extraction submodule is used to extract stable keyframes from the video; The deduplication submodule is used to remove duplicate frames and retain the most representative frames. The image sequence cropping module is used to perform a complete spatial range comparison of the image sequence, determine the range that is independent of the sample distribution range, and then crop it. The intelligent image stitching module is used to compare pixels of the cropped image sequence, find the best matching position, and stitch together images that do not overlap or repeat. The intelligent image stitching module supports two stitching modes: XY regular movement mode and XY irregular movement mode.
[0045] The target recognition module is used to identify quartz sample particles and liquid inclusions in quartz in the stitched complete image using a target recognition algorithm; The content calculation module is used to perform summation and ratio calculations based on the coordinate sequence of the identification results to obtain the proportion and total amount of inclusions in the quartz sample.
[0046] Example 3: The inclusion analysis method of the present invention, such as Figure 10 As shown, S1. Precise Displacement Control of Microscopic Slides: After the equipment powers on and completes its origin reset, the operator selects the detection mode via the touchscreen. They can switch between fixed-point positioning mode, continuous scanning mode, or area traversal mode as needed. The area traversal mode allows selection of line-by-line scanning or a Z-shaped scanning path. Control commands are transmitted to the MCU main control board via fully isolated RS485 communication. The MCU outputs pulse and direction signals to drive each stepper motor. The first stepper motor drives the worm gear mechanism to fine-tune the sample tilt and azimuth angles, eliminating blind spots. The second stepper motor drives the wedge transmission structure to achieve precise Z-axis focusing. The third stepper motor drives the lead screw transmission structure, driving the first and second adjustment plates to achieve smooth movement of the slide across the X and Y axes. A photoelectric limit sensor collects position signals in real time and transmits them to the MCU via photoelectric isolation, enabling travel limit protection and origin calibration, ensuring precise and controllable scanning path.
[0047] The system employs stepper motors as actuators, consisting of an X-axis left-right movement stepper motor and a Y-axis forward-backward movement stepper motor, each independently driving the microscope stage to complete linear movements in the left-right and forward-backward directions. It is equipped with a first lead screw 107b, a third slide rail 204c, and a fourth slide rail 205a to ensure smooth, jam-free, and backlash-free stage movement. It also supports a manual / electric fine-tuning mechanism for the Z-axis to adapt to different focal length observation requirements.
[0048] The high-performance MCU integrates signal acquisition, logic operation, pulse output, and communication functions. The motherboard is equipped with a fully isolated RS485 communication interface and opto-isolated input circuitry, which can stably acquire position signals and output high-precision pulse control signals to achieve precise position control and scanning logic execution of the motion platform.
[0049] The stepper motor driver receives pulse and direction signals from the MCU to achieve microstepping drive control, improving motor operation smoothness and positioning accuracy. The motion platform adopts a high-rigidity precision guide rail structure to ensure long-term accuracy and stability. Photoelectric limit sensors transmit position signals to the MCU through photoelectric isolation, enabling travel limit, origin calibration, and overtravel protection, ensuring platform operation safety.
[0050] The touchscreen communicates with the MCU main control board via a fully isolated RS485 and is equipped with functional modules such as scan mode selection, scan range setting, movement speed adjustment, origin reset, and emergency stop, enabling visualized parameter configuration and real-time display of equipment status.
[0051] S2. Continuous recording of sample microscopic video: As the stage moves at a constant speed along the preset scanning path, the objective lens performs continuous optical magnification imaging of the quartz sample, the infrared scanner synchronously collects the infrared feature signals of the sample and transmits them to the signal processor for preprocessing, and at the same time the microscope camera continuously records microscopic video, completely recording the microscopic details of the sample at different positions and angles throughout the entire sample area, generating original continuous video data containing all sample features.
[0052] S3. Intelligent Keyframe Extraction from Video: This process performs frame decomposition and optimization on raw, continuous video data. First, it statistically analyzes the pixel changes in rows and columns of each frame, marking invalid background areas with consistent pixel heights as areas to be cropped. Noise interference is removed through continuous region detection to determine precise cropping coordinates. Then, it calculates the pixel variance of adjacent frames, selecting stable and clear image frames with variances below a preset threshold for initial screening. Finally, stable frames are grouped based on image similarity and temporal proximity. The optimal frame in each group, best matching the image mean, is retained, while blurry, duplicate, and offset redundant frames are removed, resulting in a high-quality, effective image sequence.
[0053] S301: Determine the cutting range (1) Read the first N frames of the video (default N=100) and analyze the numerical changes of each pixel in all frames; (2) Calculate the variance of each column of pixels. Columns with variance less than the threshold (default threshold=10) are marked as columns to be cropped. (3) Calculate the variance of each row of pixels, and mark the rows with variance less than the threshold as rows to be cropped; (4) Use a continuous region detection algorithm to eliminate isolated interference regions (such as mouse pointers, fixed icons, etc.); (5) Output the cropping region coordinates (crop_x, crop_y, crop_width, crop_height).
[0054] S302: Extract stable frames (1) Set the stability threshold (default stability_threshold=0.05) and pixel variance threshold (default pixel_variance_threshold=10.0); (2) Traverse the video frames and calculate the pixel variance between the current frame and the previous frame; (3) If the variance is less than the pixel variance threshold and the number of consecutive stable frames reaches the minimum number of stable frames (default min_stable_frames=3), then it is determined to be a stable frame; (4) Apply cropping to the stable frame and save it to a temporary directory; (5) Record frame extraction statistics, including total number of frames, number of stable frames, extraction ratio, etc.
[0055] S303: Deduplication Processing (1) Set the duplicate frame detection threshold (default duplicate_threshold=0.9); (2) Calculate the frame similarity matrix and group the frames using the temporal proximity constraint (compare only frames that are temporally close). (3) For each group of similar frames, calculate the average value within the group and retain the frame that is closest to the average value; (4) Save the deduplicated frames for subsequent splicing; (5) Record deduplication statistics, including the number of frames before deduplication, the number of frames after deduplication, and the deduplication ratio.
[0056] S4. Unified and precise cropping of image sequences: The effective image sequence is compared between frames to calculate the relative offset of adjacent images. The absolute position coordinates of each frame are accumulated to accurately define the effective distribution area of the sample. Unified removal of edge-irrelevant background areas is performed. Standardized cropping is performed on all images to ensure that all images to be stitched are of uniform size and have consistent effective areas, and to completely remove invalid boundary interference.
[0057] S5. Adaptive Intelligent Image Stitching: The stitching mode is adaptively matched based on the actual movement path of the stage. Regular scanning paths use conventional grid stitching, while irregular movement paths activate an XY irregular stitching mode. An adaptive clustering algorithm dynamically optimizes the grid row and column ratio to ensure optimal grid arrangement. In case of clustering anomalies, grid allocation is forced through positional sorting. Within a preset search range, pixel differences in overlapping areas are compared to determine the optimal stitching position and offset parameters. Finally, a differential weighted fusion algorithm is used to process the overlapping areas, eliminating stitching gaps, brightness and color differences, and afterimages, generating a complete, clear, and seamless panoramic microscopic image of the quartz sample.
[0058] S501: Mode Selection Select the splicing mode based on the movement method of the platform: - Mode 1: XY rule movement (serpentine scan), suitable for rule paths; - Mode 2: XY Irregular Movement (Smart Layout), suitable for irregular paths.
[0059] S502: Location Calculation (Mode 2) (1) Calculate the relative position offset between adjacent frames: ``` offset_x = argmin(Σ|I1(x,y) - I2(x+dx,y)|) offset_y = argmin(Σ|I1(x,y) - I2(x,y+dy)|) ``` (2) Calculate the absolute position of all frames cumulatively: ``` pos_x[i] = pos_x[i-1] + offset_x[i] pos_y[i] = pos_y[i-1] + offset_y[i] ``` (3) Calculate the optimal number of grid rows and columns: Objective: Minimize cols × rows ≥ n_images and minimize |cols - rows|. For example: 16 images → 4×4 grid (4) Adaptive clustering: Try different clustering thresholds (0.1 to 2.0 times the image size); Scoring criteria: Difference from the target number of rows and columns + Degree of row and column imbalance; Select the clustering result that is closest to the target number of rows and columns; (5) Forced grid assignment (alternative): When adaptive clustering is not ideal, forced allocation is performed based on positional sorting. Distribute the image evenly across the target grid; S503: Pixel Contrast Stitching (1) Set the search range (default search_range=50 pixels); (2) Set the pixel matching threshold (default pixel_match_threshold=0.95); (3) For each image to be stitched, calculate the pixel difference in the overlapping area within the search range: ``` match_score(dx, dy) = Σ(I1(x,y) × I2(x+dx, y+dy)) / sqrt(ΣI1² ×ΣI2²) ``` (4) Find the position with the highest pixel matching degree as the best stitching position; (5) Calculate the splicing offset (offset_x, offset_y) and the size of the overlapping area; (6) Perform weighted fusion on overlapping regions: ``` I_blend(x,y) = w1(x,y) × I1(x,y) + w2(x,y) × I2(x,y) ``` w1 and w2 are linear weights that gradually change from 1 to 0 in the overlapping region.
[0060] S504: Image Fusion (1) Determine the size of the splicing canvas based on the calculated position offset; (2) Place each frame image in its corresponding position; (3) Weighted fusion of overlapping areas to eliminate splicing gaps; (4) Save the spliced image.
[0061] S6. Precise Target Identification and Localization: For the stitched panoramic image, a color space threshold segmentation algorithm is used to accurately separate the quartz particle region and distinguish the quartz matrix from the background region; within the effective area of the quartz particles, tiny gas-liquid inclusions are specifically identified, and interfering impurities such as dust and noise are filtered out; the pixel coordinates, bounding box size and morphology information of each quartz particle and each liquid inclusion are accurately extracted to construct a complete target coordinate dataset, providing data support for subsequent quantitative calculations.
[0062] S601: Quartz Particle Segmentation (1) Color space conversion: Convert the RGB image to the YCbCr color space; (2) Threshold segmentation: Segmentation is performed based on the characteristic range of quartz particles in the Cb and Cr channels: ``` mask_quartz = (Cb > Cb_min) & (Cb < Cb_max) & (Cr > Cr_min) & (Cr <Cr_max) ``` (3) Morphological processing: noise removal and hole filling are performed using opening and closing operations; (4) Connected domain analysis: Extract independent quartz particle regions and record the bounding box and area of each particle.
[0063] S602: Liquid Inclusion Recognition (1) Identify the liquid inclusions within the quartz particle region based on their grayscale characteristics; (2) Set the grayscale threshold and extract the dark areas (liquid inclusions): ``` mask_inclusion = (gray < inclusion_threshold) & mask_quartz ``` (3) Morphological processing: Remove small-area noise and retain the effective inclusion area; (4) Connected component analysis: Extract independent bounding box regions and record the bounding box, area and center coordinates of each bounding box.
[0064] S7. Quantitative Calculation of Inclusion Content: Based on pre-calibrated microscopic image pixel-physical size conversion parameters, the image pixel area is converted into the actual physical area. The total area of quartz particles and the total area of liquid inclusions are calculated separately to obtain the inclusion area ratio. At the same time, the total number of inclusions, the size of individual particles and the size distribution range are automatically counted to complete the fully automatic and high-precision quantitative detection of gas and liquid inclusions in quartz samples and output standardized detection results.
[0065] S701: Content Calculation (1) Calculate the total area of the quartz grains: ``` area_quartz_total = Σarea_quartz[i] ``` (2) Calculate the total area of the liquid inclusion: ``` area_inclusion_total = Σarea_inclusion[j] ``` (3) Calculate the percentage of the package: ``` ratio = area_inclusion_total / area_quartz_total × 100% ``` (4) Statistical analysis of the number and size distribution of packages: Total number of inclusions; Average package area; Histogram of area distribution of inclusions; Maximum / minimum area of the encapsulated material.
[0066] Discussion on the credibility of the results: To verify the reliability of the method of this invention, standard sand from Uniming IOTA-STA in the United States was used as a reference sample for testing. The test results are as follows: 1. Repeatability test: Ten independent tests were performed on the same quartz sample. The relative standard deviation (RSD) of the inclusion percentage was less than 5%, indicating that the method has good repeatability.
[0067] 2. Accuracy verification: Compared with the results of manual microscopic counting, the recognition accuracy of this method reaches over 95%, and avoids the subjectivity of manual interpretation.
[0068] 3. Efficiency comparison: Traditional manual testing of a sample takes 2-3 hours, while this method, with its fully automated process, only takes 10-15 minutes, improving efficiency by more than 10 times.
[0069] 4. Image stitching quality: Using a pixel contrast stitching algorithm, the stitching gaps are invisible to the naked eye, the overlapping areas transition naturally, and the stitching success rate reaches over 98%.
[0070] 5. Keyframe extraction results: Keyframes are extracted from a 10-minute video, reducing the data volume by more than 90% while retaining all effective information.
[0071] The above test results show that the method of the present invention has good accuracy, repeatability and efficiency, and can meet the actual needs of quantitative detection of gas-liquid inclusions in high-purity quartz sand.
[0072] Typical application cases Case 1: Evaluation of High-Purity Quartz Raw Materials from Pegmatite Quartz samples from different sampling locations within the LD-5 vein, a pegmatite-type high-purity quartz vein in the eastern Qinling Mountains of Henan Province, were analyzed. The stage moved in a serpentine scanning mode, with a scanning range of 50mm × 50mm and a field-of-view overlap of 20%. After video recording, 120 keyframes were extracted, and 98 remained after deduplication. Image stitching was performed using mode 1 to generate a complete sample image. Based on target identification and content calculation, the average fluid inclusion index of the quartz in this vein was 93.09. The fluid inclusion index of the entire vein is close to that of Unimin standard sand and exhibits relatively small fluctuations, providing valuable reference and guidance for further optimization of prospecting targets.
[0073] Case 2: Rapid Screening of Quartz Sand Inclusions Batch testing was conducted on products from a quartz sand production company. A continuous scanning mode was used, with a single scan taking 5 minutes, automatically generating an inclusion content report. Compared to traditional manual testing, the testing efficiency was increased by 15 times, and the results were objective and consistent. By setting inclusion content thresholds, qualified and unqualified products could be quickly screened, achieving automated control of product quality.
[0074] Case 3: Detection of Irregular Samples For irregularly shaped quartz samples, the stage movement path is difficult to plan in advance. Using Mode 2 (intelligent layout mode), the system automatically analyzes the inter-frame positional relationships and adaptively determines the optimal grid layout, successfully completing image stitching. The stitched image clearly shows the entire sample, providing high-quality image data for subsequent inclusion analysis.
[0075] The above description, in conjunction with specific embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, several simple deductions or substitutions can be made without departing from the concept of the present invention, and all such deductions or substitutions should be considered to fall within the scope of protection defined by the claims submitted herein.
Claims
1. A device for extracting keyframes from videos and acquiring data using quartz microscopy, comprising a mirror base (100), a mirror column (101) mounted on the upper surface of the mirror base (100), a cylindrical base (102) mounted on the upper end of the mirror column (101), and a stage (200) mounted on the upper surface of the mirror base (100), characterized in that: The stage (200) includes at least a base (201), on which a corner stage (202) is slidably connected. Arc-shaped grooves (201a) are formed on both sides of the upper surface of the base (201), and arc-shaped rails (202a) are installed on both sides of the lower surface of the corner stage (202). The arc-shaped rails (202a) are adapted to the arc-shaped grooves (201a). The corner stage (202) moves in a circular motion on the base (201) through the cooperation of the arc-shaped rails (202a) and the arc-shaped grooves (201a), thereby achieving angle adjustment. A wedge-shaped stage (203) is slidably connected to the upper surface of the corner stage (202). 03) A wedge block (204a) is slidably connected to the upper part. When the displacement wedge stage (203) makes linear movement, the wedge block (204a) is raised and lowered by the inclined plane. A support platform (204) is installed on the upper surface of the wedge block (204a). A first adjusting plate (205) is slidably connected to the support platform (204). The first adjusting plate (205) moves along the X-axis direction on the support platform (204). A second adjusting plate (206) is slidably connected to the upper surface of the first adjusting plate (205). The second adjusting plate (206) moves along the Y-axis direction on the first adjusting plate (205). The glass slide is placed on the second adjusting plate (206).
2. The device for video keyframe extraction and quartz microscopic acquisition according to claim 1, characterized in that: Both the support platform (204) and the first adjusting plate (205) are equipped with drive boxes (207), and the drive box (207) is rotatably connected to the first lead screw (207b) through a bearing seat. A third stepper motor (207c) is installed at one end of the first lead screw (207b). Both the first adjusting plate (205) and the second adjusting plate (206) are equipped with threaded sleeves (206a) on one side, and the threaded sleeves (206a) are threadedly connected to the first lead screw (207b).
3. The device for video keyframe extraction and quartz microscopic acquisition according to claim 2, characterized in that: The drive box (207) has a waist hole (207a) on its inner side for the threaded sleeve (206a) to extend into. The inner bottom of the drive box (207) is provided with three photoelectric limit sensors (207d), which are arranged at equal intervals. The lower surface of the threaded sleeve (206a) is provided with a trigger adapted to the photoelectric limit sensor (207d). The photoelectric limit sensor (207d) is connected to the output circuit of the third stepper motor (207c) for signal connection. The photoelectric limit sensor (207d) limits the maximum movement path and center point positioning of the first adjustment plate (205) and the second adjustment plate (206).
4. The device for video keyframe extraction and quartz microscopic acquisition according to claim 1, characterized in that: The upper surface of the second adjusting plate (206) is provided with a placement groove (206b) in the center, and the two sides of the placement groove (206b) are provided with arc-shaped mounting grooves (206c). The mounting groove (206c) is connected to a clamp (206d) by a shaft. A torsion spring is sleeved on the shaft and abuts against the clamp (206d). The lower surface of the second adjusting plate (206) is provided with a second slide bar (206e) symmetrically. The upper surface of the first adjusting plate (205) is provided with a fourth slide rail (205a) corresponding to it. The lower surface of the first adjusting plate (205) is provided with a first slide bar (205b) symmetrically. The upper surface of the support (204) is provided with a third slide rail (204c) corresponding to it.
5. The device for video keyframe extraction and quartz microscopic acquisition according to claim 1, characterized in that: The upper inclined surface of the wedge-shaped platform (203) is provided with a second slide rail (203a), and the lower inclined surface of the wedge-shaped block (204a) is provided with a linear slide groove (204b). The wedge-shaped block (204a) is slidably connected to the second slide rail (203a) through the linear slide groove (204b). The front surface of the corner platform (202) is equipped with a second stepper motor (202c). The drive end of the second stepper motor (202c) is connected to a second lead screw, and the wedge-shaped platform (203a) is provided with a second slide rail (203a). The front end of 03) has a screw hole in the center to match the second lead screw. The second lead screw is driven by the second stepper motor (202c) to control the displacement of the wedge stage (203). When the wedge stage (203) is displaced, it abuts against the wedge block (204a) to realize the lifting and lowering of the support platform (204). The upper surface of the corner stage (202) is symmetrically fitted with the first slide rail (202d), and the lower surface of the wedge stage (203) is slidably connected to the first slide rail (202d).
6. The device for video keyframe extraction and quartz microscopic acquisition according to claim 1, characterized in that: The front surface of the base (201) is equipped with a first stepper motor (201c). The drive end of the first stepper motor (201c) is connected to a worm gear (201b), and a worm wheel (202b) is centrally connected to the lower surface of the corner platform (202). The worm wheel (202b) meshes with the worm gear (201b), and the center of the worm wheel (202b) coincides with the center of the arc of the arc rail (202a). The first stepper motor (201c) drives the worm gear (201b) to rotate, thereby realizing the angle adjustment of the corner platform (202) on the base (201).
7. The device for video keyframe extraction and quartz microscopic acquisition according to claim 1, characterized in that: The front surface of the mirror mount (100) is fitted with a touch screen (100a). The touch screen (100a) is connected to the MCU main control board through a fully isolated RS485 communication module. The MCU main control board is connected to the stepper motors and photoelectric limit sensors in the device. It issues commands through the touch screen (100a) and uses the fully isolated RS485 to control the specific electric drive components to execute commands through the MCU main control board.
8. The device for video keyframe extraction and quartz microscopic acquisition according to claim 1, characterized in that: An eyepiece (102a) is mounted on the front surface of the barrel base (102), a signal processor (103) is mounted on the upper surface of the barrel base (102), and an objective lens (102b) and an infrared scanner (103a) are mounted on the lower surface of the barrel base (102). The infrared scanner (103a) is connected to the signal processor (103).
9. The inclusion analysis method based on video keyframe extraction and quartz microscopic acquisition device according to any one of claims 1-8, characterized in that, Includes the following steps; S1. Precise Displacement Control of Microscopic Slides: Operators input control commands via touchscreen. These commands are transmitted to the MCU main control board via a fully isolated RS485 communication module. The MCU main control board outputs pulses and direction signals to drive each stepper motor. The worm gear angle adjustment mechanism enables adaptive fine-tuning of the quartz sample's tilt and azimuth angles. A wedge-shaped transmission structure enables precise focusing of the Z-axis of the stage. A lead screw transmission structure drives the first and second adjustment plates to move the slide bidirectionally along the X and Y axes. Photoelectric limit sensors provide overtravel protection and automatic origin calibration. Switching between fixed-point positioning mode, continuous scanning mode, or area traversal mode allows for precise control of the quartz sample's position and scanning path planning across the entire area. S2. Continuous recording of sample microscopic video: During the process of the stage moving the quartz sample slide smoothly along the preset path, the objective lens mounted on the cylinder completes the optical magnification imaging of the sample. The infrared scanner simultaneously collects the infrared scanning signal of the sample and transmits it to the signal processor. At the same time, the microscope camera continuously captures microscopic video, recording the complete microscopic image information of the quartz sample at different positions and imaging angles in real time, forming the original microscopic video data. S3. Intelligent Keyframe Extraction from Video: This involves frame processing of the raw microscopic video data acquired in S2, converting continuous video into a discrete image sequence. Specifically, this includes: S31. Cropping Range Location: Analyze the pixel values of the video image frame by frame, count the value changes of each row and column of pixels, determine the area with a pixel consistency ratio exceeding the preset threshold as an invalid cropping area, combine with the continuous region detection algorithm to remove interfering pixel areas, and accurately output the coordinates of the effective image cropping area. S32. Stable frame selection: Calculate the pixel variance between consecutive adjacent image frames. When the pixel variance is less than the preset stability threshold, the corresponding image frame is determined to be a stable and valid frame. Based on the cropping area obtained in S31, the stable frame is preprocessed and saved. S33. Image Frame Deduplication: Calculate the image similarity of each stable frame, group the image frames according to the temporal proximity constraint, retain the best frame that is closest to the image mean in each group of repeated image frames, remove redundant repeated frames, and obtain the effective image sequence after deduplication. S4. Unified and precise cropping of image sequences: Spatial range comparison and cropping are performed on the effective image sequences obtained from S3 processing, specifically including: S41. Match adjacent image frames and calculate the relative position offset between frames. S42. Calculate the absolute position coordinates of all image frames based on the cumulative inter-frame offset; S43. Based on the actual distribution range of the samples, eliminate invalid boundary areas in the image sequence that are irrelevant to the observation of quartz samples and gas-liquid inclusions, and determine a unified and valid image area; S44. Based on the unified valid image region, perform standardized cropping processing on all image frames to obtain a sequence of images to be stitched together with uniform size and no invalid boundaries. S5. Image Adaptive Intelligent Stitching: Pixel matching and seamless stitching are performed on the image sequence to be stitched after cropping in S4. The corresponding stitching mode is matched according to the actual movement path of the stage, and the images are integrated to form a complete panoramic microscopic image of the quartz sample. Specifically, this includes: S51. Path adaptation determination: Identify the scanning and movement path of the stage. If it is an irregular movement path, start the XY irregular movement stitching mode; if it is a regular traversal path, start the regular grid stitching mode. S52. Adaptive Grid Matching: For irregular XY movement scenarios, an adaptive clustering algorithm is used to dynamically adjust the clustering threshold and optimize the grid row and column number allocation to meet the optimal grid condition of cols×rows≥n_images and |cols-rows| is minimized. When the clustering effect is not good, grid allocation is forced by sorting the image positions. S53, Pixel Precise Matching: Calculate the pixel difference value of the overlapping area of each image within the preset search range, select the position with the highest pixel matching degree as the optimal stitching position, and accurately calculate the stitching offset and the size of the overlapping area. S54. Overlapping Area Fusion: The overlapping areas of the image stitching are processed by a weighted fusion algorithm to eliminate stitching gaps and color differences, resulting in a complete microscopic panoramic image of the quartz sample without overlap, omissions, or gaps. S6. Precise Target Identification and Localization: A target identification algorithm is used to perform feature recognition on the complete microscopic panoramic image obtained in S5, accurately extracting target information and generating a coordinate sequence. Specifically, this includes: S61. Quartz Particle Segmentation: A color space threshold segmentation algorithm is used to accurately extract the contour region and range of quartz particles in the image. S62. Inclusion Targeting Identification: Accurately identify liquid inclusion targets within the segmented quartz particle area, and distinguish effective inclusions from image interference impurities. S63. Coordinate Information Extraction: Record the pixel coordinates, bounding box size and morphological features of each quartz particle and liquid inclusion to construct a target object coordinate sequence dataset; S7. Quantitative Calculation of Inclusion Content: Based on the target object coordinate sequence dataset obtained in S6, the inclusion parameters of the quartz sample are quantitatively analyzed through pixel area conversion and statistical calculations, specifically including: S71. Calculate the total pixel area of all quartz particles in the image and convert it to the actual total area of the quartz particles. S72. Calculate the total pixel area of all liquid inclusions and convert it to the actual total area of the liquid inclusions. S73. Calculate the inclusion percentage parameter: Inclusion percentage = Total area of liquid inclusions / Total area of quartz particles; S74. Count the total number of liquid inclusions, the size of individual inclusions and the size distribution range to complete the comprehensive quantitative detection of gas-liquid inclusions in quartz samples.
10. The inclusion analysis method based on video keyframe extraction and quartz microscopic acquisition device according to claim 9, characterized in that: In step S1, the region traversal mode supports switching between line-by-line scanning and Z-scanning modes, adapting to different application scenarios such as fine global observation of a single sample and high-throughput detection of batch samples.