Thin-slice pore image stitching method based on block matching and multilevel sampling
Through neighborhood block matching and multi-level sampling methods, the repair problem of blank areas of boundary information in pore binary image stitching is solved, and the natural transition and high-quality stitching of the image are realized, which improves the visual effect and structural consistency of the image.
Patent Information
- Application Number
- CN202111222304.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-20
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2041-10-20
AI Technical Summary
It is difficult for the prior art to naturally splice two or more pore binary images into a complete image, especially in the repair of information blank areas between image boundaries, which affects the structural and visual connectivity of the image.
The thin pore image stitching method based on neighborhood block matching and multi-level sampling is adopted. By reserving the area to be filled, designing neighborhood block judgment criteria, optimal neighborhood block judgment and filling function, the neighborhood block matching blur phenomenon is controlled until convergence is achieved, and the image is natural transition and detail clarity are achieved.
It improves the subjective visual connectivity and overall structure of image stitching, enhances the clarity of image details and the similarity of pore morphology, and improves the texture consistency between image boundaries.
Smart Images

Figure BDA0003313056840000021 
Figure BDA0003313056840000022 
Figure BDA0003313056840000023
Abstract
Description
Technical Field
[0001] The present invention relates to a method for stitching two (or more) thin - slice pore images, and relates to an image stitching technology based on block matching and multi - level sampling, belonging to the fields of image stitching and image restoration. Background Art
[0002] Micro - displacement is a means of conducting oil displacement experiments using a glass etching model. To make a glass etching model, it is necessary to extract the pores of the casting thin slice to form a binary image. In order to simulate the pore conditions of in - homogeneous distribution in the formation, sometimes it is necessary to stitch two (or more) different pore binary images into a complete image, and these stitched images have no overlapping areas, and it is necessary to repair the information between the image boundaries according to the texture morphology and other information of the images to be stitched.
[0003] In order to stitch multiple pore binary images and make the boundaries transition naturally, estimating, predicting, and filling the information blank area between the image boundaries through the known image source region information is an effective means. However, image restoration itself is an uncertain problem. Since the computer lacks the high - level semantic understanding and perception of images like humans, it still cannot guarantee that the part that originally did not exist between the image boundaries can be obtained uniquely and correctly. Such image stitching is more like a kind of "blind restoration". Especially for stitching complete pore binary images, when filling the blank area between the image boundaries, the quality of the repair directly affects the structure of the entire image, and the human eye is most sensitive to the overall structural features of the image. Therefore, it is necessary to ensure that the images transition naturally as much as possible, conforming to the principle of subjective visual connectivity, so that the image regions generated by the repair are realistic and clear in terms of color, texture, and structure, that is, the texture between the image boundaries is consistent with the images to be stitched. Summary of the Invention
[0004] The purpose of the present invention is to provide a method for stitching thin - slice pore images based on neighborhood block matching and multi - level sampling for stitching two (or more) different pore binary images into a complete image.
[0005] The present invention realizes the above - mentioned purpose through the following technical solutions:
[0006] A method for stitching thin - slice pore images based on neighborhood block matching and multi - level sampling, comprising the following steps:
[0007] (1) After reserving the area to be filled between the boundaries of two (or more) images to be stitched, perform down - sampling;
[0008] (2) Design a neighborhood block decision criterion, screen out the neighborhood blocks with a similar neighborhood structure to the image block to be filled, and form a set D;
[0009] (3) Design the optimal neighborhood block decision criterion to determine the neighborhood block with the highest priority from the set of neighborhood blocks D;
[0010] (4) Design the filling function for the pixels to be stitched and fill the pixels to be filled;
[0011] (5) Design the neighborhood block search method to control the neighborhood block matching ambiguity phenomenon, and repeat steps (2), (3), and (4) until all the pixels to be stitched are filled;
[0012] (6) Repeat steps (2), (3), (4), and (5) in the reverse order of the filling sequence to re-update the pixel values of the area to be stitched until convergence;
[0013] (7) Upsample the image and repeat steps (2), (3), (4), (5), and (6) until the image is restored to the original image size, then the stitching is completed.
[0014] 2. In the above solution, the downsampling of the two (or multiple) images to be stitched in step (1) is to accelerate the filling processing speed and improve the clarity of the details of the filled image by filling from the coarse scale to the fine scale.
[0015] In the above solution, the neighborhood block decision criterion described in step (2) is defined as:
[0016] P = Size * Size * (e1 + e2) (1)
[0017]
[0018]
[0019] Normalize the pixel values of the image block p1 and the template p2, calculate the union U1, then calculate the intersection U2 of p1 and U1, the intersection U3 of p2 and U2, and finally calculate the Hamming distance between U2 and U3 as e2, where Size is the side length of the image block, n is the number of pixel points in the image block, i is the serial number of the pixel point in the image block, u i is the i-th pixel point of the image block, v i is the i-th pixel point of the template block, w i is the i-th pixel of the intersection image block, and determine the template with the minimum P value as the neighborhood block with a similar neighborhood structure.
[0020] In the above solution, the optimal neighborhood block decision criterion described in step (3) is defined as:
[0021]
[0022]
[0023] Calculate the Euclidean distance between the image block p1 and each subset of neighborhood blocks, and determine the Euclidean distance and σ k The neighborhood block with the smallest sum is the neighborhood block d1 with the highest priority, where m and n are the side lengths of the image block, and f k (i, j) is the pixel value at the i-th row and j-th column in the image block, and u k is the mean value of the image block, and Size is the side length of the image block.
[0024] In the above solution, the filling function of the pixel points to be stitched in step (4) is defined as calculating the Euclidean distance from each pixel of the optimal neighborhood block to the pixel points to be stitched as the weight coefficient, and after weighting and averaging each pixel point in the neighborhood block, it is used as the estimated value of the pixel points to be stitched for filling.
[0025] In the above solution, the neighborhood block search method in step (5) is defined as using the optimal neighborhood block of the previous image block as the center, and searching for neighborhood blocks with a similar structure to the image block within a 1 / 2 area of the current image size.
[0026] In the above solution, in step (6), after the pixel area to be stitched is filled, the pixel values are updated in the reverse stitching direction until convergence to ensure the accuracy of neighborhood block matching.
[0027] In the above solution, the determination of convergence in step (6) is defined as:
[0028]
[0029] When the stitching is completed, if the above criteria are met, it is considered to have converged, where G is the number of pixel points to be stitched, A is the number of updated pixel points, and max is the maximum side length of the current image. Description of the Drawings
[0030] Figure 1 is the flowchart of the method for stitching thin-sheet pore images based on neighborhood block matching and multi-level sampling of the present invention;
[0031] Figure 2 is the schematic diagram of screening neighborhood blocks with a similar structure to the image block after downsampling the image in the embodiment of the present invention;
[0032] Fig. 3(a) is the schematic diagram of the thin-sheet pore image to be stitched in the embodiment of the present invention;
[0033] Fig. 3(b) is the schematic diagram of the completed stitching of the thin-sheet pore image in the embodiment of the present invention; Detailed Embodiment
[0034] The present invention will be described in more detail below with specific embodiments in conjunction with the accompanying drawings. However, the described embodiments are only a specific and detailed description of the implementation method of the present invention, and should not be construed as any limitation on the protected content of the present invention. The accompanying drawings and the embodiments described below are provided to enable the present invention to be more completely and accurately understood by those skilled in the art.
[0035] Figure 1 Among them, a method for stitching thin-sheet pore images based on neighborhood block matching and multi-level sampling can be specifically divided into the following steps:
[0036] (1) After arranging the images to be stitched as required, reserve the area to be stitched, merge them into one image, and downsample.
[0037] (2) For each image block p1 passing through the pixel point to be stitched, traverse the image with a template of the same size as p1, and filter out the neighborhood blocks with a similar neighborhood structure to it by calculating the error e1 between p1 and the template and the difference e2 between adjacent pixel points to form a set D.
[0038] (3) From the neighborhood block set D, calculate the Euclidean distance and the image block complexity value σ between the image block p1 and each subset neighborhood block k , determine that the neighborhood block with the smallest sum of the Euclidean distance and σ k is the neighborhood block d1 with the highest priority.
[0039] (4) Use the pixel value obtained by taking the weighted average of the Euclidean distances of each pixel in the neighborhood block d1 as the estimated value of the pixel point to be stitched for filling.
[0040] (5) For the next pixel point to be stitched, search for the neighborhood blocks of all image blocks passing through this pixel point within a rectangular area centered on the neighborhood block d1 with a side length of 1 / 2 of the current image size, and repeat steps (2), (3), and (4) until all pixel points to be stitched are filled.
[0041] (6) Update the area to be stitched in the reverse order of the stitching sequence according to steps (2), (3), (4), and (5) until convergence.
[0042] (7) Upsample the image, and repeat steps (2), (3), (4), (5), and (6) until the image is restored to the original image size, then the stitching is completed.
[0043] Specifically, in step (1), in the present invention, as an implementation example, as Figure 1 shown, reserve the area to be filled between the boundaries of the two images to be stitched. As shown in Figure 3(a), the white pixel area between the two images is used as the area to be stitched, and it is downsampled to 1 / 3 of the original image size.
[0044] In step (2), the selected image block and template size are used to filter the neighborhood blocks. In this embodiment, specifically, the sizes of both the image block and the template are 3×3.
[0045] In the process of filtering the neighborhood blocks in step (2), in this embodiment, it is specifically traversed from top to bottom. In the thin-sheet pore image, the error values from all non-repeated neighborhood blocks to the central block are calculated, and the coordinates and error values of the neighborhood block with the minimum error are saved as elements, as Figure 2 shown.
[0046] In step (3), the Euclidean distance between the image block p1 and each subset neighborhood block and the image block complexity value σ k are calculated, and the neighborhood block with the smallest sum of the Euclidean distance and σ k is determined as the neighborhood block d1 with the highest priority, as Figure 2 shown.
[0047] In step (4), the Euclidean distance from each pixel point of the optimal neighborhood block to the central block is calculated as the weighting coefficient, and the average value of each weighted pixel is calculated as the estimated value of the pixel to be stitched.
[0048] In step (6), the pixel values to be stitched are updated in the reverse direction of the previous stitching order until convergence.
[0049] In step (7), in this embodiment, the upsampling is specifically set as the bilinear interpolation method.
[0050] In step (7), when upsampling to the original image size, in this embodiment, specifically: first downsample to 1 / 3 of the original image, then upsample to 2 / 3 of the original image size, and finally upsample to the original image size.
[0051] Specifically, in order to verify the effectiveness of the method of the present invention, relevant experiments were conducted in the present invention.
[0052] Figure 3(a) shows two thin-sheet pore images to be stitched, and Figure 3(b) shows the result after stitching. Visually, it can be seen that the stitching result well reproduces the structure and clarity of the thin-sheet pore image, and the similarity in pore morphology is also relatively high.
[0053] The stitching of two images with a size of 710×796 in the embodiment of the present invention has a relatively large improvement in subjective visual connectivity, the overall structure of the image, and the clarity of image details compared with the traditional image stitching method.
Claims
1. A method for stitching thin-sheet pore images based on block matching and multi-level sampling, characterized in that: It includes the following steps: (1) After reserving the area to be filled between the boundaries of the two images to be stitched, perform downsampling; (2) Design a neighborhood block decision criterion, screen out the neighborhood blocks with similar neighborhood structures to the image blocks to be filled, and form a set D; (3) Design an optimal neighborhood block decision criterion: From the neighborhood block set D, calculate the Euclidean distance and the image block complexity value between the image block and each neighborhood block, and determine the neighborhood block with the smallest sum of the Euclidean distance and the complexity value as the neighborhood block with the highest priority. The calculation method is as follows: where σ k is the complexity value of the image block, m and n are the side lengths of the image block, and f k (i, j) is the pixel value of the i-th row and j-th column in the image block, and u k is the mean value of the image block, and Size is the side length of the image block; (4) Design a filling function for the pixels to be stitched, and perform prediction and filling on the pixels to be filled; (5) Design a neighborhood block search method to control the fuzzy phenomenon of neighborhood block matching, and repeat steps (2), (3), and (4) until all the pixels to be stitched are filled; (6) Repeat steps (2), (3), (4), and (5) in the reverse order of the filling sequence to re-update the pixel values in the area to be stitched until convergence; (7) Perform upsampling on the image, and repeat steps (2), (3), (4), (5), and (6) until the image is restored to the original image size, then the stitching is completed.
2. The method for stitching thin-sheet pore images based on block matching and multi-level sampling according to claim 1, characterized in that In step (1), downsampling the two images to be stitched is to accelerate the filling processing speed and improve the clarity of the details of the filled image from the coarse scale to the fine scale.
3. A method for stitching thin-sheet pore images based on block matching and multi-level sampling according to claim 1, characterized in that The neighborhood block decision criterion described in step (2) is defined as: P = Size * Size * (e1 + e2) (3) Normalize the image block p1 and the template p2, calculate the union U1, then calculate the intersection U2 of p1 and U1, the intersection U3 of p2 and U2, and finally calculate the Hamming distance between U2 and U3 as e2, where Size is the side length of the image block, n is the number of pixel points in the image block, i is the serial number of the pixel point in the image block, u i is the i-th pixel point of the image block, v i is the i-th pixel point of the template block, w i is the i-th pixel of the intersection image block, and determine the template with the smallest P value as the neighborhood block with a similar neighborhood structure.
4. A method for stitching thin-sheet pore images based on block matching and multi-level sampling according to claim 1, characterized in that The filling function for the pixels to be stitched described in step (4) is defined as calculating the Euclidean distance from each pixel of the optimal neighborhood block to the pixel to be stitched as the weight coefficient, and after weighting and averaging each pixel in the neighborhood block, it is used as the estimated value of the pixel to be stitched for filling.
5. A method for stitching thin-sheet pore images based on block matching and multi-level sampling according to claim 1, characterized in that The neighborhood block search method described in step (5) is defined as taking the optimal neighborhood block of an image block as the center and searching for neighborhood blocks with similar neighborhood structures to the image block within a 1 / 2 area of the current image size.
6. A method for stitching thin-sheet pore images based on block matching and multi-level sampling according to claim 1, characterized in that In step (6), after the pixel area to be stitched is filled, re-update the pixel values in the reverse stitching direction until convergence to ensure the accuracy of neighborhood block matching.
7. A method for splicing thin-sheet pore images based on block matching and multi-level sampling according to claim 1, characterized in that As described in step (6), the determination of convergence is defined as: When the stitching is completed, if the above criteria are met, it is considered to have converged, where G is the number of pixels to be stitched, A is the number of updated pixels, and max is the maximum side length of the current image.