Method and system for converting orthogonally polarized video of rock slice into picture based on video tracking
The CoTracker deep learning video tracking algorithm solves the problem of rotation adjustment of polarizing microscopes when observing rock slices, generates multi-angle rock slice images, and meets the intelligent needs of rock and mineral identification.
Patent Information
- Application Number
- CN202410314112.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-19
- Publication Date
- 2025-09-19
AI Technical Summary
When observing rock slices, existing polarizing microscopes need to rotate the sample to adjust the angle between the sample and the polarizer, causing the observed rock sample to continuously rotate in the field of view, making it difficult to obtain sequential images of rock slices under multiple angles and multiple light sources.
The CoTracker deep learning video tracking algorithm is used to collect rotation polarization video data of rock thin section samples. Video tracking technology is used to build a rotation correction algorithm to generate multi-angle orthogonal polarization images, including acquisition, tracking, fitting and calculation of rotation angle values, and finally generate key angle polarization maps.
It has realized the conversion of rock thin section polarizing microscope inspection videos into rock thin section sequence images under multi-angle and multi-light source conditions, providing rich data support for rock and mineral identification and improving the intelligence level of rock thin section identification.
Smart Images

Figure CN120672790A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the cross-technical field of thin-section identification and computer vision, and in particular to a method and system for converting orthogonal polarization videos of rock thin sections into images based on video tracking. Background Art
[0002] The application of deep learning in computer vision continues to evolve, with one key application being video tracking. Video tracking refers to the ability to track the position, trajectory, and motion of an object in a video sequence in real time. Deep learning methods have made significant progress in this field, leveraging vast amounts of data and powerful computing power to achieve more accurate, stable, and efficient video tracking.
[0003] Optical flow estimation is a common task in video tracking, used to analyze motion and dynamic changes in images. Optical flow estimation estimates motion information in an image by tracking the movement of pixels in the image over time.
[0004] There are two main types of motion tracking methods: optical flow, which directly estimates the instantaneous velocity of all points in a video frame, but has difficulty estimating long-term motion (especially when encountering occlusions and low camera frame rates). The other is tracking, which directly tracks a limited number of points over continuous time, but does not exploit the interactions between different points on the same object.
[0005] Common optical flow estimation algorithms include the Lucas-Kanade method and the Farneback method. The Lucas-Kanade method assumes that the motion of pixels in an image within a small time window is the translation of a rigid body. Using dense optical flow, the optical flow field for the entire image can be obtained. The Farneback method calculates the temporal motion of pixels by performing multi-scale image processing. Using dense optical flow, the optical flow field for the entire image can be obtained.
[0006] Common tracking algorithms include Mean Shift and Kalman Filter. Mean Shift estimates the color histogram of the target area, searches for regions with similar color distribution within the image, and updates the target area's position. Kalman Filter uses state estimation and measurement update methods to predict and update the target's position, establishing a dynamic model of the target's motion.
[0007] A polarizing microscope is an instrument that converts ordinary light into polarized light for microscopic examination. It can determine whether a substance is singly refracting (isotropic) or birefringent (anisotropic). Birefringence is a fundamental property of crystals, and as such, polarizing microscopes are widely used in the identification of rock thin sections. Compared to biological microscopes, polarizing microscopes are more complex, differing in that they are equipped with two polarizers, a Bertrand lens, and a condenser. The polarization directions of the two polarizers are at a 90-degree angle, placed above and below the sample, respectively, to test the sample's refractive properties. The angle between the sample and the polarizers must be constantly adjusted during use.
[0008] Common polarizing microscope brands on the market include Aubrey, Leica, and Leitz. Most of these products require rotating the sample to adjust the angle between the sample and the polarizer. This causes the rock sample to constantly rotate within the field of view, changing its angle and position, making it difficult to obtain sequential images of rock thin sections from multiple angles and light sources.
[0009] Previous records from oilfield sample libraries include numerous videos of thin-section samples being recorded as they rotate under microscopes. However, these microscopes lack the ability to record the sample's center of rotation, so the videos must be processed to produce a sequence of rock thin-section images from multiple angles and light sources. Summary of the Invention
[0010] The purpose of the present invention is to provide a method and system for converting orthogonal polarization video of rock slices into images based on video tracking. Its main purpose is to realize the conversion of orthogonal polarization scanning video of rock slices into multi-angle orthogonal polarization thin slice images; the main technical means is to apply artificial intelligence deep learning video tracking algorithm to the field of thin slice scanning video processing and analysis, and use video tracking technology to construct a rotation correction algorithm suitable for orthogonal polarization of rock slices, and convert the video into multi-angle orthogonal polarization images of rock slices, providing richer data for intelligent rock and mineral identification.
[0011] To achieve the above object, the present invention provides the following technical solutions:
[0012] In a first aspect, the present invention provides a method for converting rock slice orthogonal polarization video to image based on video tracking, the method comprising the following steps:
[0013] Step S101: collecting video data of polarized rotation of a rock slice sample, wherein the sample is rotated at an angle greater than 90° in the video;
[0014] Step S102: using a CoTracker network to track multiple sample points of the video data to obtain dynamic motion trajectories of the multiple sample points;
[0015] Step S103, fitting the dynamic motion trajectory of the sample point to obtain the center coordinates of the dynamic motion trajectory fitting curve and the coordinates of the sample point;
[0016] Step S104: Calculate the instantaneous rotation angle value of the rock thin section sample based on the coordinates of the circle center and the sample point coordinates;
[0017] Step S105: generating a key-angle polarization diagram of the rock thin section sample based on the instantaneous rotation angle value.
[0018] Furthermore, step S103 includes:
[0019] Fitting the dynamic motion trajectory of the sample point using a circular arc curve;
[0020] The center coordinates (x0, y0) and the arc radius r of the dynamic motion trajectory are obtained by optimizing the residual sum of squares.
[0021] Furthermore, the residual sum of squares formula is as follows:
[0022]
[0023] Where S represents the residual sum of squares; r represents the radius of the rotation trajectory; x0 and y0 represent the coordinates of the center of the rotation trajectory, (x i ,y i ) represents the coordinates of the sample points.
[0024] Furthermore, step S104 includes:
[0025] The center points of all the dynamic motion trajectory curves are averaged to obtain the midpoint (x0', y0') of the rotation of all sample points;
[0026] Based on the midpoint, the average angle of all sample points is calculated to assign an instantaneous rotation angle value to each frame image in the video.
[0027] Furthermore, the calculation formula of the instantaneous rotation angle value is as follows:
[0028]
[0029] Where θ 1,i Represents two points (x1, y1) and (x i ,y i ), (x0', y0') represents the coordinates of the center of the fitted circle after averaging, r represents the radius of the circle, (x1, y1) represents the initial coordinates of the sample point, (x i ,y i ) represents the coordinates of the sample points in each frame.
[0030] Furthermore, step S105 includes:
[0031] Assign an instantaneous angle value to each frame of the polarizing microscope sample rotation video based on the average angle of all sample points. After selecting the initial image, find the video frame image closest to the angle of 15°, 30°, 45°, 60°, and 75°.
[0032] The image is reversely rotated and cropped before output to obtain a set of orthogonal polarization multi-channel sequence image data of rock thin section samples at 0°, 15°, 30°, 45°, 60°, and 75°.
[0033] In a second aspect, the present invention provides a rock slice cross-polarization video-to-image system based on video tracking, the system comprising:
[0034] A rotation polarization video data acquisition module is used to acquire rotation polarization video data of rock thin section samples, where the sample is rotated by an angle greater than 90° in the video;
[0035] A video data sample point tracking module is used to track multiple sample points of the video data using a CoTracker network to obtain dynamic motion trajectories of the multiple sample points;
[0036] A dynamic motion trajectory fitting module is used to fit the dynamic motion trajectory of the sample point to obtain the center coordinates of the dynamic motion trajectory fitting curve and the coordinates of the sample point;
[0037] An instantaneous rotation angle value calculation module is used to calculate the instantaneous rotation angle value of the rock thin section sample based on the coordinates of the circle center and the coordinates of the sample point;
[0038] The rock slice sample key angle polarization diagram generation module is used to generate the rock slice sample key angle polarization diagram based on the instantaneous rotation angle value.
[0039] In a third aspect, the present invention provides an electronic device, comprising:
[0040] one or more processors;
[0041] a storage device for storing one or more programs;
[0042] When the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned rock slice orthogonal polarization video-to-image method based on video tracking.
[0043] In a fourth aspect, the present invention provides a storage medium comprising computer-executable instructions, which, when executed by a computer processor, are used to perform the above-mentioned video tracking-based orthogonal polarization video-to-image conversion of rock slices.
[0044] The technical effects and advantages of the present invention are as follows:
[0045] Based on the collected rock thin section microscopic videos of varying angles under orthogonal polarization, the present invention applies CoTracker deep learning video tracking technology to the rotation video of polarizing microscope inspection samples, and uses optical flow tracking technology to intelligently analyze the rotation angle of the sample, thereby converting the rock thin section polarizing microscope inspection video into a sequence of rock thin section images under multiple angles and multiple light sources, providing technical support for the universalization of the sample library.
[0046] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0048] Figure 1 This is a flow chart of a method for converting rock slice orthogonal polarization video to image based on video tracking of the present invention;
[0049] Figure 2 This is a diagram of the CoTracker network architecture of the present invention;
[0050] Figure 3 This is a schematic diagram of a rock slice orthogonal polarization video-to-image system based on video tracking according to the present invention;
[0051] Figure 4 A schematic diagram of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0052] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0053] The design concept of the present invention includes: first, collecting thin slice rotation polarization video data; then using the CoTracker network to track the thin slice video sample points to obtain the dynamic motion trajectories of multiple sample points; then fitting the motion trajectories to reduce noise, and then calculating the angle value of the thin slice rotation; finally, generating the key angle polarization map of the rock thin slice sample to provide data for the rock thin slice intelligent identification system.
[0054] To this end, the present invention discloses a rock slice orthogonal polarization video to image conversion method based on video tracking. Figure 1 This is a flow chart of a method for converting rock slice orthogonal polarization video to image based on video tracking of the present invention, as shown in FIG. Figure 1 As shown, the method includes the following steps:
[0055] Step S101, collecting rotation polarization video data of rock thin section samples;
[0056] Step S102: Track multiple sample points of the video data to obtain dynamic motion trajectories of the multiple sample points;
[0057] Step S103, fitting the dynamic motion trajectory of the sample point to obtain the center coordinates of the dynamic motion trajectory fitting curve and the coordinates of the sample point;
[0058] Step S104: Calculate the instantaneous rotation angle value of the rock thin section sample based on the coordinates of the circle center and the sample point coordinates;
[0059] Step S105: generating a key-angle polarization diagram of the rock thin section sample based on the instantaneous rotation angle value.
[0060] Step S101 of the present invention is to collect the rotation polarization video data of the rock thin section sample, specifically:
[0061] First, a batch of high-quality videos of sample rotations under polarizing microscope examination are collected. Because the present invention relies on sample point tracking, it does not constrain the angular velocity of sample rotation, allowing variations in the angular velocity. Furthermore, the present invention does not impose strict constraints on the center of rotation; the center can deviate from the center of the video by an appropriate distance. However, it is important to note that the present invention requires that the particles to be generated rotate at an angle greater than 90° in the video, which is equivalent to one period of sample extinction in the polarizing microscope.
[0062] Step S102 of the present invention is to track multiple sample points of the video data to obtain dynamic motion trajectories of the multiple sample points, specifically:
[0063] This paper uses the CoTracker network as the video tracking network, an architecture that jointly tracks multiple points throughout a video. This architecture combines ideas from optical flow and tracking methods to form a new, flexible, and powerful design. It is based on a Transformer network that models the correlation between different time points through a dedicated attention layer. The Transformer iteratively updates the estimates of multiple trajectories. The network uses a module with a non-recurrent learning loop, which can jointly track several points from a single point and supports adding new points for tracking at any time.
[0064] The CoTracker model first assumes that the point is stationary to initialize the point coordinates P, and then uses CNN to extract the image features Q. At the same time, a mark v is added to indicate whether the target is occluded. After that, the input token (P, v, Q) is sent to the Transformer for correlation modeling, and the output token (P', Q') obtained represents the updated position and image features. In this invention, since the image will not be occluded, v is essentially always 0. The entire network architecture is shown in the figure below. Figure 2 shown.
[0065] Step S103 of the present invention is to fit the dynamic motion trajectory of the sample point to obtain the center coordinates of the dynamic motion trajectory fitting curve and the coordinates of the sample point, specifically:
[0066] The optical flow tracking sequence of points generated by the CoTracker network will not be a perfect arc, but will contain some noise. Therefore, the present invention performs fitting and denoising on the motion trajectory of the sample points to remove the influence of noise and obtain a smooth arc curve.
[0067] Since the sheet motion is known to be a rotational motion around a fixed point, an arc is used to fit it. Let its center be (x0, y0), radius be r, and the coordinates of the sample point generated by CoTracker be (x i ,y i ).
[0068] The center point and radius of the rotation trajectory are obtained by the optimization method. The residual square sum S is written as the objective function. Formula (1) is used as the objective function to optimize x0, y0 and r to minimize them. The expression of formula (1) is as follows:
[0069]
[0070] Where S represents the residual sum of squares, and the optimization search method is used to adjust r, x0, and y0 to reach the minimum value; r represents the radius of the rotation trajectory; (x0, y0) represents the coordinates of the center of the rotation trajectory, (x i ,y i) represents the coordinates of the sample points.
[0071] Step S104 of the present invention is to calculate the instantaneous rotation angle value of the rock slice sample based on the coordinates of the circle center and the sample point coordinates, specifically:
[0072] The center points (x0, y0) of all the trajectories generated in step S103 are averaged to obtain the midpoint (x0', y0') of the sample rotation. Then, the two points (x1, y1) and (x i ,y i ) between the angle θ 1,i The instantaneous rotation angle value is assigned to each frame of the video according to the average angle of all sample points. The expression of formula (2) is as follows:
[0073]
[0074] Where θ 1,i Represents two points (x1, y1) and (x i ,y i ), (x0', y0') represents the coordinates of the center of the fitted circle after averaging, r represents the radius of the circle, (x1, y1) represents the initial coordinates of the sample point, (x i ,y i ) represents the coordinates of the sample points.
[0075] Step S105 of the present invention generates a key angle polarization diagram of the rock slice sample based on the instantaneous rotation angle value, specifically:
[0076] The instantaneous rotation angle value is assigned to each frame in the polarizing microscope rotation video based on the average angle of all sample points. After selecting the initial image, the video frames closest to the angles of 15°, 30°, 45°, 60°, and 75° are searched. The images are then reverse-rotated and cropped for output. This yields a set of orthogonal polarization multi-channel image sequences of rock thin sections at 0°, 15°, 30°, 45°, 60°, and 75°, providing richer data for intelligent rock and mineral identification.
[0077] Based on the same inventive concept, the present invention also provides a rock slice orthogonal polarization video to image system based on video tracking. Figure 3 Schematic diagram of a rock slice orthogonal polarization video to image system based on video tracking of the present invention, as shown in FIG. Figure 3 As shown, the system includes:
[0078] The rotation polarization video data acquisition module 201 is used to collect rotation polarization video data of rock thin section samples, where the sample rotates at an angle greater than 90° in the video; the video data sample point tracking module 202 is used to track multiple sample points of the video data using the CoTracker network to obtain dynamic motion trajectories of the multiple sample points; the dynamic motion trajectory fitting module 203 is used to fit the dynamic motion trajectories of the sample points to obtain the center coordinates and sample point coordinates of the dynamic motion trajectory fitting curve; the instantaneous rotation angle value calculation module 204 is used to calculate the instantaneous rotation angle value of the rock thin section sample based on the center coordinates and sample point coordinates; the rock thin section sample key angle polarization map generation module 205 is used to generate the rock thin section sample key angle polarization map based on the instantaneous rotation angle value.
[0079] Furthermore, the dynamic motion trajectory fitting module 203 is specifically configured to fit the dynamic motion trajectory of the sample point using an arc curve; and obtain the center coordinates (x0, y0) and arc radius r of the dynamic motion trajectory by optimizing the residual sum of squares.
[0080] Furthermore, the instantaneous rotation angle value calculation module 204 is specifically used to: average the center points generated by all dynamic motion trajectory curves to obtain the midpoint of rotation of all sample points; based on the midpoint, calculate the average angle of all sample points to assign an instantaneous rotation angle value to each frame image in the video.
[0081] Furthermore, the rock thin section sample key angle polarization image generation module 205 is specifically used to: assign an instantaneous angle value to each frame image in the polarizing microscope inspection sample rotation video according to the average angle of all sample points, and after selecting the initial image, find the video frame image closest to the angle of 15°, 30°, 45°, 60°, and 75°; reversely rotate the image and output it after cropping, to obtain a set of orthogonal polarization multi-channel sequence image data of the rock thin section sample at 0°, 15°, 30°, 45°, 60°, and 75°.
[0082] Based on the same inventive concept, the present invention also provides an electronic device, Figure 4 A schematic diagram of an electronic device provided by the present invention, such as Figure 4 As shown, the electronic device includes at least one processor 301, at least one communication interface 302, at least one memory 303 and at least one communication bus 304; wherein the processor 301, the communication interface 302 and the memory 303 communicate with each other via the communication bus 304;
[0083] Memory 303, storing computer programs;
[0084] The processor 301 is configured to implement the rock slice cross-polarization video-to-image conversion method based on video tracking when executing the program stored in the memory 303.
[0085] Optionally, the communication interface may be an interface of a communication module, such as an interface of a GSM module; the processor may be a CPU, or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention. The memory may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk storage. The memory stores a program, and the processor calls the program stored in the memory to execute some or all of the above-mentioned method embodiments.
[0086] Based on the same inventive concept, the present invention further provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed, some or all of the above-mentioned method embodiments are implemented. Optionally, the storage medium may be a non-transitory computer-readable storage medium, for example, a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, or the like.
[0087] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for converting rock slice orthogonal polarization video to image based on video tracking, characterized in that: The method comprises the following steps: Step S101: collecting video data of polarized rotation of a rock slice sample, wherein the sample is rotated at an angle greater than 90° in the video; Step S102: using a CoTracker network to track multiple sample points of the video data to obtain dynamic motion trajectories of the multiple sample points; Step S103, fitting the dynamic motion trajectory of the sample point to obtain the center coordinates of the dynamic motion trajectory fitting curve and the coordinates of the sample point; Step S104: Calculate the instantaneous rotation angle value of the rock thin section sample based on the coordinates of the circle center and the sample point coordinates; Step S105: generating a key-angle polarization diagram of the rock thin section sample based on the instantaneous rotation angle value.
2. The method for converting rock slice orthogonal polarization video to image based on video tracking according to claim 1, characterized in that: Step S103 includes: Fitting the dynamic motion trajectory of the sample point using a circular arc curve; The center coordinates (x0, y0) and the arc radius r of the dynamic motion trajectory are obtained by optimizing the residual sum of squares.
3. The method for converting rock slice orthogonal polarization video to image based on video tracking according to claim 2, characterized in that: The residual sum of squares formula is as follows: Where S represents the residual sum of squares; r represents the radius of the rotation trajectory; x0 and y0 represent the coordinates of the center of the rotation trajectory, (x i ,y i ) represents the coordinates of the sample points.
4. The method for converting rock slice orthogonal polarization video to image based on video tracking according to claim 1, characterized in that: Step S104 includes: The center points of all the dynamic motion trajectory curves are averaged to obtain the midpoint (x0', y0') of the rotation of all sample points; Based on the midpoint, the average angle of all sample points is calculated to assign an instantaneous rotation angle value to each frame image in the video.
5. The method for converting rock slice orthogonal polarization video to image based on video tracking according to claim 4 is characterized in that: The calculation formula of the instantaneous rotation angle value is as follows: Where θ 1,i Represents two points (x1, y1) and (x i ,y i ), (x0', y0') represents the coordinates of the center of the fitted circle after averaging, r represents the radius of the circle, (x1, y1) represents the initial coordinates of the sample point, (x i ,y i ) represents the coordinates of the sample points in each frame.
6. The method for converting rock slice orthogonal polarization video to image based on video tracking according to claim 1, characterized in that: Step S105 includes: Assign an instantaneous angle value to each frame of the polarizing microscope sample rotation video based on the average angle of all sample points. After selecting the initial image, find the video frame image closest to the angle of 15°, 30°, 45°, 60°, and 75°. The image is reversely rotated and cropped before output to obtain a set of orthogonal polarization multi-channel sequence image data of rock thin section samples at 0°, 15°, 30°, 45°, 60°, and 75°.
7. A rock slice orthogonal polarization video to image system based on video tracking, characterized in that: The system comprises: A rotation polarization video data acquisition module is used to acquire rotation polarization video data of rock thin section samples, where the sample is rotated by an angle greater than 90° in the video; A video data sample point tracking module is used to track multiple sample points of the video data using a CoTracker network to obtain dynamic motion trajectories of the multiple sample points; A dynamic motion trajectory fitting module is used to fit the dynamic motion trajectory of the sample point to obtain the center coordinates of the dynamic motion trajectory fitting curve and the coordinates of the sample point; An instantaneous rotation angle value calculation module is used to calculate the instantaneous rotation angle value of the rock thin section sample based on the coordinates of the circle center and the coordinates of the sample point; The rock slice sample key angle polarization diagram generation module is used to generate the rock slice sample key angle polarization diagram based on the instantaneous rotation angle value.
8. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the rock thin section orthogonal polarization video to image conversion method based on video tracking as described in any one of claims 1-7.
9. A storage medium containing computer-executable instructions, characterized in that: When executed by a computer processor, the computer executable instructions are used to perform the rock slice orthogonal polarization video to image conversion based on video tracking as described in any one of claims 1 to 7.