A method for stitching single polarization and cross polarization images of rock slices
By calculating the characteristic points and homography matrix of rock thin section images and utilizing the regularity of the stage movement direction to correct the stitching misalignment, the stitching problem of rock thin section images is solved, and efficient and accurate stitching of single polarization and orthogonal polarization images is achieved.
Patent Information
- Application Number
- CN201910627010.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-07-12
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2039-07-12
AI Technical Summary
When there are fewer feature points, the single polarization and cross polarization images of rock thin sections cannot be properly stitched together, or the stitching is misaligned, resulting in the inability to completely stitch together the entire thin section image.
By calculating the feature points of rock thin section images, using the RANSAC algorithm to eliminate erroneous feature points, counting and correcting the homography matrix, and utilizing the regularity of the stage movement direction to correct the stitching misalignment, the average value of the image matrix with the same movement direction is used for stitching to guide the stitching of orthogonal polarization images.
The complete stitching of rock thin section images is achieved, which saves the stitching time of orthogonal polarization images and improves the accuracy and efficiency of stitching.
Smart Images

Figure CN112215786B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method for optimizing the splicing of single polarization images and orthogonal polarization images of a rock slice, and belongs to the field of image splicing. Background Art
[0002] In the petroleum geology sector, thin sections are often prepared to preserve rock data. However, thin sections are easily broken and susceptible to weathering, corrosion, and other factors that can damage the original rock morphology and structure. Microscopes, as widely used optical instruments, can magnify tiny objects that are indistinguishable to the naked eye, facilitating the observation of microscopic structural features. Microscopes allow the microscopic morphology and structure of rock thin sections to be observed. For example, observing the optical properties of rock thin sections under a polarizing microscope allows for rock classification, while observing rock thin sections under a fluorescence microscope allows for analysis of oil and water content in minerals. Therefore, specialized image acquisition equipment can be used to capture images of rock thin sections observed under a microscope, forming complete rock thin section image data. This helps preserve the original rock thin section information and is of great significance for subsequent research on rock thin sections.
[0003] Sequence images are acquired using a fully automated microscopic image acquisition system. This hardware requires a computer to automatically control the x, y, and z axes of the stage for continuous image acquisition. Polarizers can also be added to alter the optical path to obtain orthogonal polarization images at different angles within the same field of view. However, due to limitations such as the microscope's imaging characteristics and the camera's target surface, a single captured image often only reflects a portion of the entire slice's field of view, preventing a complete overview of the entire slice. Therefore, it is necessary to continuously capture multiple fields of view of a slice by moving the stage to form a sequence of images. Image stitching techniques are then used to obtain a high-resolution image of the entire slice.
[0004] During the acquisition of microscopic images, if a rock slice is photographed under a microscope with a 5x objective lens, it is usually necessary to take dozens to hundreds of pictures, which are then stitched together to form a complete rock slice image. During image acquisition, it is usually necessary to collect single polarization and orthogonal polarization sequence images of the rock slice. During the acquisition of the sequence images, if the initial shooting position is set at the upper left corner and the final position is set at the lower right corner, then the number of rows m and columns n of the captured images are determined by the initial settings. After determining the number of rows and columns, the stage moves from left to right, taking n pictures of the first row, then moves to the second row, moves from right to left, and takes n pictures of the second row. And so on, the stage moves from left to right for odd-numbered rows and from right to left for even-numbered rows until the entire slice is captured. Then, the stage switches to orthogonal polarization, moves to the initial shooting position, and captures the orthogonal polarization sequence images using the same movement path. If the initial shooting position is set at the lower right corner, the movement direction is opposite. When there are no characteristic objects in certain fields of view, the captured image may appear "all white" or "all black" (in the case of orthogonal polarization). The traditional stitching method based on image feature points cannot capture enough feature points, and it is also impossible to calculate the homography matrix between images, resulting in the inability to stitch the full-sheet image normally. Summary of the Invention
[0005] The purpose of the present invention is to provide a method for correcting the inability to splice or the misalignment of single-piece light and orthogonal polarization sequence images of rock slices due to the small number of feature points.
[0006] The present invention achieves the above-mentioned purpose through the following technical methods:
[0007] 1. An optimization method for stitching single polarization and cross polarization images of rock slices, comprising the following steps:
[0008] (1) Calculate the number of feature points of all single polarized images to be stitched, calculate the number of feature points of adjacent images, use the RANSAC algorithm to remove some erroneous feature points, and mark the images with less than 4 feature points;
[0009] (2) Count the coordinate values of the homography matrix of all single polarized images and calculate and assign the homography matrix of the marked images;
[0010] (3) Calculating the position matrix information of the single polarization image through the homography matrix and checking the calculated position matrix information;
[0011] (4) Correct the erroneous position matrix information through position difference;
[0012] (5) Save the corrected position matrix information;
[0013] (6) Use position matrix information to guide image fusion of single polarized images;
[0014] (7) The position matrix information saved in step (5) is read in for the fusion calculation of the orthogonal polarization images of the same sheet.
[0015] The basic principles of the above method are as follows:
[0016] During image capture, with the initial capture position set at the upper left corner, all even-numbered rows are captured from right to left, all odd-numbered rows from left to right, and the capture direction at the beginning and end of two adjacent rows is from top to bottom. For two adjacent images with the same movement direction and step size, the size of their homography matrices is similar. Therefore, for images with fewer feature points, the homography matrix is replaced by the average of the homography matrices of images with the same movement direction. Since the image capture stage moves in a straight line with the same step size each time, the position information of any even and odd rows has a certain regularity, allowing for correction of misaligned position information through inspection.
[0017] Specifically, in step (1), it is assumed that a set of N pre-processed sequential images are f1(x, y), f2(x, y)...f N (x,y)(N>2), first find the feature points of each image and store them in the corresponding feature vector, recorded as ft1, ft2...ft N (N>2), if there is no feature point in the current image or there are less than 4 feature points in the process of searching for SIFT feature points, the ft of the current image will be i Set to NULL, that is, the length of the feature vector is 0.
[0018] According to the imaging principle of the area array camera and the motion imaging transformation matrix of the stage, the coordinates of the same feature in two images of the same feature in the same space can be transformed using a 3×3 matrix, that is, the following formula:
[0019]
[0020] Rearranging the above formula yields:
[0021]
[0022] Where (x1, y1) and (x2, y2) are the coordinates of the same feature point in the two images, and M is the transformation matrix. Given (x1, y1) and (x2, y2), we need to find the parameters in the H matrix. Analysis shows that matching a feature point in two images requires two equations, and solving eight parameters requires four feature points (this is why the number of feature points in the matching above needs to be greater than four).
[0023] If the overlapping area of the two images consists of multiple feature points, the accuracy of the transformation matrix can be improved. Substituting all the feature points into the above formula, we can get:
[0024]
[0025] In step (2), if the feature vector ft of the current image i And the feature vector ft of its next image i+1 The length of each image is greater than 0, and it is roughly matched with the next image. According to the above formula, the corresponding homography matrix M can be obtained. i Starting from the first image in the sequence, we can match two images and get the homography matrix M1, M2…M between adjacent images. N-1 If the feature vector ft of the current image i If the length of the eigenvector of the image is greater than 0, and the eigenvector of the next image to be matched is 0, its homography matrix is set to NULL, indicating that no corresponding projection relationship can be found to make the overlapping areas of the two images consistent. If the length of the eigenvector of the current image is 0, its homography matrix is also set to NULL, and the sequence number of the current image is marked.
[0026] After all homography matrices are calculated, since the homography matrices of some images with fewer feature points are NULL, subsequent stitching cannot be performed. At this time, we will count the m3 and m6 direction information of the homography matrices of all unlabeled images. There are three directions for collecting images, TR, TD, and TL. Among them, TR represents collecting images from left to right, and its m3 value is positive, and its m6 value is also positive and the value will be smaller. TD represents collecting images from top to bottom, and its m3 value is smaller, and its m6 value is larger and positive. TL collects images from right to left, and its m3 value is negative and its m6 value is smaller. In short, when collecting images horizontally, the m3 value is larger, which is basically the width of the overlapping area. When collecting images vertically, the m6 value is larger, which is basically the height of the overlapping area of the image. The collection direction will cause m3 to be positive or negative. Count the (m3, m6) values of the image transformation matrices in the three directions respectively, excluding the case where the M matrix is NULL, and calculate their mean.
[0027] For the marked image number without feature points, the total number of rows and columns of the known captured images is used to determine whether the image with the number belongs to one of the three moving directions. Then, m3 and m6 of the M matrix are set to the mean of the corresponding direction. m1, m5, m9 are set to 1, and m2, m4, m7, and m8 are set to 0. At this time, the homography matrix of the image without feature points is as follows:
[0028]
[0029] Where D is determined by the image number i.
[0030] In the step (4), the position information of all images is formed into an m×n matrix N1. According to the regularity of the movement of the stage, the data in the i+2th row of N1 is subtracted from the data in the i-th row, and the difference is formed into an (m-2)×n matrix N2. Then, the data in the i+1th row of N2 is subtracted from the data in the i-th row, and the difference is formed into an (m-3)×n matrix N3. Finally, the larger of the absolute value of the maximum value and the minimum value of each row of data in N3 is calculated. If the max value of the i-th row in N3 is i If the difference is greater than a threshold T (usually 100), it is considered that the data of rows i, i+1, i+2, and i+3 of N1 are misaligned. Find the longest continuous row (i, i+1…i+n) in N3 without misalignment. Then it can be assumed that the position data of the continuous rows (i, i+1…i+n+2, i+n+3) of N1 are correct. Then, the position data of rows (1, 2…i-1) and (i+n+4, i+n+5…m) can be recalculated using the corresponding correct differences in N2.
[0031] In step (7), the acquisition direction and number of the single polarization image and the orthogonal polarization image of the same sheet are the same, and the positions are corresponding. Therefore, the position matrix information calculated by the single polarization image can guide the splicing of the orthogonal polarization image, so that the size of the spliced single polarization image and the orthogonal polarization image is also the same.
[0032] The beneficial effects of the present invention are:
[0033] Based on image stitching, this invention considers the movement direction and path of the stage during rock thin-section image acquisition. By leveraging the similarity of homography matrices for images with the same movement direction, it addresses the problem of insufficient feature points preventing stitching. Furthermore, it uses the regularity of row data to detect and correct severe misalignment in the stitched images. Furthermore, considering that single-polarized and cross-polarized images of the same thin section are captured in the same manner, the position matrix calculated during the stitching of single-polarized images can be used to guide the stitching of cross-polarized images, significantly reducing stitching time. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 This is the first set of original thin-film single polarization sequence images taken, with a total of 304 images taken;
[0035] Figure 2 is the splicing result after correction;
[0036] Figure 3 It is the result of orthogonal polarization stitching guided by the position matrix information of single polarization;
[0037] Figure 4This is a partial screenshot of the position matrix information of the first set of pictures;
[0038] Figure 5 This is the second set of single polarization images of the original thin film, with a total of 323 images taken;
[0039] Figure 6 It is a single polarization sequence stitching dislocation map;
[0040] Figure 7 It is the stitching result image after correcting the matrix information;
[0041] Figure 8 This is the second set of orthogonal polarized light stitching images. DETAILED DESCRIPTION
[0042] The present invention will be further described below with reference to specific embodiments and accompanying drawings:
[0043] Example:
[0044] To make the optimization method of the present invention easier to understand and closer to real-world applications, the following is a comprehensive description of the entire process, from the original image sequence to the stitching of single-polarization and orthogonal polarization images of the entire sheet, including the core optimization method of the present invention:
[0045] (1) First, obtain the single polarization and orthogonal polarization sequence diagrams, Figure 1 This is the first set of original single polarization sequence images captured. A total of 304 images, spanning 19 rows and 16 columns, were captured. The starting point was the lower right corner. The stage moved leftward from the lower right corner to capture the first row, then rightward to capture the second row, until all 19 rows of images were captured. The first set of sequence images contains a large number of blank images. When calculating the homography matrix, rows 2, 17, and 18 all contain a large number of images for which the homography matrix could not be calculated. The corresponding left- and right-facing homography matrices for m3 and m6 are calculated as follows:
[0046]
[0047] Among them, the m value of the image whose homography matrix is NULL is not included in the calculation, and the corresponding final calculation is:
[0048]
[0049] Then the homography matrix of the picture with fewer feature points corresponding to the 2nd and 18th rows is copied to M (TR) , line 17 corresponds to M (TL) .
[0050] (2) All images that cannot calculate the homography matrix are assigned corresponding values for the subsequent calculation of the position matrix information. Through subsequent fusion, the resulting splicing results are shown in Figure 2, and save the position matrix information of the single polarization calculation, some of its data can be found in Figure 3 .
[0051] (3) Due to space limitations, Figure 3 Only the position information of the first five rows of pictures is displayed. The first five rows of pictures are stitched together to correspond to Figure 2 The lower part. Each row has 16 pictures, a total of 16 sets of position information, with the upper left corner of the picture as the coordinate origin, including the x-axis and y-axis directions. The first data represents the position of the y-axis, and the second data represents the position of the x-axis. Since the starting point of the first row of pictures is the lower right corner, the movement direction of the stage is from right to left. At this time, the data of the x-axis of the picture does not change much and is large. The data of the y-axis gradually decreases according to a rule (since the movement step length of each picture taken by the stage is the same). Moving from the first row to the second row, the movement direction is upward. At this time, the data of the x-axis of the second row is smaller than that of the first row. The data of the x-axis in the row does not change much, and the data of the y-axis gradually increases according to a rule. The data change rules are similar.
[0052] (4) The first set of data also corresponds to 19×16=304 orthogonal polarized images taken in the same way. The matrix information saved when stitching the single polarized images is read into the program to guide the fusion stitching of the orthogonal polarized images. The final stitching result is shown in Figure 4 .
[0053] (5) Figure 5 This is the second set of original single polarized images, a total of 19 × 17 = 323 images. The stitched result is shown in Figure 6 , the splicing result is seriously misaligned. The difference between the corresponding rows of N3 corresponding to the adjacent misaligned rows is large, while the difference between the unmisaligned parts is small. At this time, by calculating, the longest continuous rows of unmisaligned data in N3 are 3, 4, and 5. The corresponding data of rows 3, 4, 5, 6, and 7 in N1 are credible. Then, the unreliable data is recalculated as follows:
[0054]
[0055] Among them, RN23, RN24, and RN25 represent the 3rd, 4th, and 5th row data of the N2 matrix respectively. The stitching result of the single polarization image after correcting the matrix information is shown in Figure 7 , the stitching result of the orthogonal polarization images guided by the corrected matrix information is shown in Figure 8 .
[0056] The above embodiments are only preferred embodiments of the present invention and are not limitations on the technical solutions of the present invention. Any technical solution that can be implemented on the basis of the above embodiments without creative work should be deemed to fall within the scope of protection of the patent of the present invention.
Claims
1. A method for optimizing the splicing of single polarization images and cross polarization images of rock slices, characterized by: The following steps are involved: (1) Calculate the number of feature points of all single polarization images to be stitched, calculate the number of feature points of adjacent images, and mark the images with less than 4 feature points; when collecting single polarization sequence images of rock slices, if the initial shooting position is set at the upper left corner and the final shooting position is set at the lower right corner, then determine the number of rows m and columns n of the shooting images through the initial settings. After determining the number of rows and columns, move the stage from left to right to shoot n images of the first row, then move to the second row, move from right to left, and shoot n images of the second row. Similarly, the stage moves from left to right for odd rows and from right to left for even rows until the entire rock slice is shot; then switch to orthogonal polarization, move the stage to the initial shooting position, and shoot the orthogonal polarization sequence images of the rock slice with the same moving path. If the initial shooting position is set at the lower right corner, the moving direction is opposite. (2) Count the coordinate values of the homography matrices of all single-polarized images, and calculate and assign the homography matrices of the marked images. If the single-polarized sequence images are scanned according to a certain rule when shooting, the coordinate values of the homography matrices of all odd-numbered rows and columns of the images are very similar, and the even-numbered rows are also the same. The homography matrices of all odd-numbered rows can be averaged and assigned to the odd-numbered rows of the images for which the homography matrices cannot be calculated, and the same applies to the even-numbered rows. (3) Calculate the position matrix information of the single polarization image through the homography matrix and check the calculated position matrix information; (4) Correct the erroneous position matrix information through position difference; (5) Save the corrected position matrix information; (6) Use position matrix information to guide image fusion of single polarized images; (7) The position matrix information saved in step (5) is read in for the fusion calculation of the orthogonal polarization images of the same sheet.
2. The method for optimizing the splicing of single polarization images and cross polarization images of a rock slice according to claim 1, characterized in that: In step (1), the single polarization image to be spliced is a microscopic sequence of a rock slice, and the threshold T is usually set to the minimum number of feature points required to calculate the coordinate values of the homography matrix of two adjacent images; In step (3), the error is checked by calculating the y difference between the image positions of adjacent odd and even rows and then comparing the calculated difference; In step (5), the position matrix information actually represents the position of each image during fusion, which is a two-dimensional value (x, y); In step (7), when taking orthogonal polarization and single polarization pictures of a thin sheet, the initial position of the shooting, the moving direction of the stage, and the moving step are all the same, and the position information of each single polarization picture can guide the splicing of the orthogonal polarization pictures.
Citation Information
Patent Citations
Image stitching method based on characteristic point plane similarity
CN105957007A
Method and device for generating panoramic image, storage medium, and electronic apparatus
WO2019134516A1