A real-time splicing method and device for core drilling images
By using FAST and Harris algorithms to filter true corner points, and combining quadtree partitioning and homography geometric consistency interior point purification algorithms for sparse feature points, efficient and accurate real-time stitching of core borehole images was achieved, solving the problems of low real-time performance and low matching accuracy in existing technologies.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XIAN RES INST OF CHINA COAL TECH & ENG GRP CORP
- Filing Date
- 2026-04-14
- Publication Date
- 2026-07-03
AI Technical Summary
Existing core borehole image stitching methods do not meet real-time requirements and have low matching accuracy, making it impossible to achieve efficient and accurate stitching of core borehole video images.
The FAST algorithm is used to quickly detect corner points, and the Harris algorithm is used to filter true corner points. Quadtree partitioning and non-maximum suppression methods are used to achieve uniform distribution of corner points. Initial matching is performed by a fast approximate nearest neighbor matcher. Finally, the homography geometric consistency interior point purification algorithm of sparse feature points is used for accurate matching to obtain an optimized homography matrix for image stitching.
It significantly improves the quality of feature point extraction and matching robustness, meeting the real-time and accuracy requirements of core image stitching, with a matching accuracy rate of over 95% and a processing time of less than 8ms.
Smart Images

Figure CN122335537A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing, specifically to a method and apparatus for real-time stitching of core borehole images. Background Technology
[0002] Borehole imaging technology is a crucial tool in geological exploration for observing the interior of borehole cores. Information about the borehole wall is obtained by directly observing the core video or screenshots acquired through borehole imaging. However, the interpretation of these images relies heavily on manual operation and subjective identification, which is time-consuming and labor-intensive. Unfolding each frame of the core video and then stitching them together to create a panoramic view of the borehole wall allows for quantitative analysis of geological structures such as delamination, fracture zones, fissures, and joints within the borehole, forming the basis for intelligent core video analysis. Core image unfolding technology can expand video frames captured by the camera probe into rectangular image frames, eliminating the adverse effects of camera shake and rotation during recording. However, existing core image stitching methods do not meet real-time requirements and have low matching accuracy. Summary of the Invention
[0003] To overcome at least one deficiency in the prior art, this application provides a method and apparatus for real-time stitching of core borehole images.
[0004] Firstly, a method for real-time stitching of core borehole images is provided, including:
[0005] For any two adjacent core borehole images, the FAST algorithm is used to quickly detect corner points, and the Harris algorithm is used to remove weak corner points and retain true corner points with high response values, thus obtaining two true corner point images. A quadtree partitioning method is used to achieve a uniform distribution of true corner points in each frame of the image, and a non-maximum suppression method is used to select high-quality corner points. A fast approximate nearest neighbor matcher is used to perform initial matching on high-quality corner points in two frames of images, resulting in multiple initial matching pairs. A homography geometric consistency in-point purification algorithm based on sparse feature points is used to accurately match multiple initial matching pairs, resulting in an optimized homography matrix. Based on the optimized homography matrix, the stitching of two adjacent core borehole images is achieved.
[0006] In one embodiment, a homography geometric consistency interior point purification algorithm based on sparse feature points is used to accurately match multiple initial matching pairs, resulting in an optimized homography matrix, including: Step S41: Based on the matching similarity of the initial matching pairs and the response values of the two feature points in the initial matching pairs, the initial matching pairs are comprehensively scored and sorted from high to low scores. The initial matching pairs of the sorted results are selected as a sparse sample set. Step S42: Randomly select k0 pairs of non-collinear samples from the sparse sample set, estimate the initial homography matrix, and calculate the reprojection error and interior point probability of each sample in the sparse sample set based on the initial homography matrix. Step S43: Sort the samples according to the inlier probability from high to low, increase the number of samples by m compared to the previous sampling number, randomly select non-collinear samples from the sorting results, and re-estimate the homography matrix; calculate the reprojection error and inlier probability of each sample in the sparse sample set based on the homography matrix. Step S44: Determine whether the difference between the reprojection error of the current homography matrix and the reprojection error of the previous homography matrix is less than the first set value. If yes, the current homography matrix is the initially determined homography matrix. If no, return to step S43. Step S45: Calculate the reprojection error of each sample based on the initially determined homography matrix, and retain samples with reprojection errors less than a second set value as the final matching pairs; Step S46: Based on the final matching pairs, the homography matrix is re-estimated using the robust least squares method to obtain the optimized homography matrix.
[0007] In one embodiment, the reprojection error of the sample is calculated using the following formula: e = ||(x2,y2)-H(x1,y1)|| Where e is the reprojection error of the sample, (x1,y1) and (x2,y2) are the coordinates of two feature points in the sample, H is the homography matrix; ||.|| denotes the norm; The probability of an interior point is calculated using the following formula: P = 1 / (1+e) Where P is the interior point probability.
[0008] In one embodiment, stitching two adjacent core borehole images together based on the homography matrix includes: The optimized homography matrix includes: a parameter representing the horizontal offset in the matching of two adjacent image frames. The parameter representing the vertical offset in the matching of two adjacent image frames. ;according to and To stitch together two adjacent core borehole images.
[0009] Secondly, a real-time core borehole image stitching device is provided, comprising: The corner detection and filtering module is used to quickly detect corners using the FAST algorithm for any two adjacent core borehole images, and to remove weak corners using the Harris algorithm, while retaining true corners with high response values, thus obtaining two true corner image frames. The corner point uniformization and filtering module is used to achieve uniform distribution of true corner points in each frame of true corner point image by using a quadtree partitioning method, and to filter high-quality corner points by using a non-maximum suppression method. The feature point initial matching module is used to perform initial matching on high-quality corner points in two frames of images using a fast approximate nearest neighbor matcher to obtain multiple initial matching pairs. The feature point precise matching module is used to perform precise matching on multiple initial matching pairs using a homography geometric consistency interior point purification algorithm based on sparse feature points, and obtain an optimized homography matrix. The image stitching module is used to stitch together two adjacent core borehole images based on the optimized homography matrix.
[0010] Compared with the prior art, this application has the following beneficial effects: 1. This application utilizes the Harris algorithm to filter corner points detected by the FAST algorithm, which significantly improves the extraction quality and matching robustness of feature points. Combined with the quadtree partitioning method and non-maximum suppression, a feature point set with spatial uniform distribution and optimal local response can be obtained.
[0011] 2. The initial matching of feature points is performed using an approximate nearest neighbor search based on spatial indexing. This matching method, which first searches for full coverage and then filters to improve accuracy, can meet the requirements of core image stitching scenarios that require both real-time performance and robustness.
[0012] 3. By using a homography-based geometric consistency in-point purification algorithm based on sparse feature points, high-value matching points are prioritized, while sparsity is used to reduce computational costs and time, ensuring the real-time performance and accuracy of core borehole unfolding image stitching. Attached Figure Description
[0013] This application can be better understood by referring to the description given below in conjunction with the accompanying drawings, which, together with the detailed description below, are incorporated in and form part of this specification. In the drawings: Figure 1 A flowchart of a real-time image stitching method for core borehole images is shown. Figure 2 The image shows a real-time stitched result of core borehole images. Detailed Implementation
[0014] Exemplary embodiments of the present application will be described below with reference to the accompanying drawings. For clarity and brevity, not all features of the actual embodiments are described in the specification. However, it should be understood that many embodiment-specific decisions can be made in the development of any such actual embodiment to achieve the developer’s specific objectives, and these decisions may vary as the embodiments differ.
[0015] It should also be noted that, in order to avoid obscuring this application with unnecessary details, only the device structure closely related to the solution of this application is shown in the accompanying drawings, while other details that are not closely related to this application are omitted.
[0016] It should be understood that this application is not limited to the described embodiments by virtue of the following description with reference to the accompanying drawings. In this document, embodiments may be combined with each other, features may be substituted or borrowed between different embodiments, and one or more features may be omitted in one embodiment, where feasible.
[0017] This application provides a method for real-time stitching of core borehole images. Figure 1 A flowchart of a real-time image stitching method for core borehole images is shown. (See attached image) Figure 1 The method mainly includes the following steps: Step S1: For any two adjacent core borehole images, use the FAST algorithm to quickly detect corner points, and use the Harris algorithm to remove weak corner points and retain true corner points with high response values to obtain two true corner point images.
[0018] Here, the FAST (Features from Accelerated Segment Test) algorithm is used to quickly detect corner points (feature points). During execution, the FAST algorithm calculates the sum of the grayscale differences between each corner point (center pixel) and its surrounding pixels, which is used as the corner point's response value. The Harris algorithm is then used to retain corner points with response values greater than a threshold, while invalid points with response values less than or equal to the threshold are removed to improve the purity of the corner point set.
[0019] Step S2: Use a quadtree partitioning method to achieve a uniform distribution of true corner points in each frame of the true corner point image, and use a non-maximum suppression method to select high-quality corner points.
[0020] Quadtree partitioning uses the entire image as the root node and recursively divides each image region into four sub-quadrant regions (top left, top right, bottom left, and bottom right) to form a hierarchical quadtree structure until the conditions for stopping splitting are met (sub-region pixel size ≤ preset minimum size 32×32 or the number of corner points contained in the sub-region ≤ preset threshold 3) to force a uniform distribution of corner points.
[0021] Within all leaf nodes of a quadtree, perform nonmaximum suppression to filter out uniformly distributed and high-quality corner points within that region. Traverse all leaf nodes and collect the final set of corner points.
[0022] Furthermore, invalid corner points at the image edges are removed if the number of pixels from the corner point coordinates (x, y) to the image boundary is less than or equal to the suppression radius. r (suppression radius) r If the threshold is set to 5 pixels, then that corner point is directly removed. For the final set of corner points, a further filtering is performed using Harris's response value threshold t to ensure the response values of all corner points are within acceptable limits. R>t, To ensure that no weak corners are mixed in.
[0023] Step S3: Initial matching is performed on the high-quality corner points in the two frames using a Fast Approximate Nearest Neighbor Matcher (FLANN Matcher) to obtain multiple initial matching pairs. Each initial matching pair includes two feature points, i.e., the two corner points that were successfully matched.
[0024] FLANN's high-coverage approximate search solves the problem of missed effective matches, while low-similarity elimination solves the problem of too many false matches. The combination of the two balances the comprehensiveness and accuracy of matching and enhances the robustness of the algorithm. During the matching process, the FLANN matcher calculates the matching similarity between two corner points and eliminates low-similarity matching point pairs.
[0025] Step S4: The homography geometric consistency interior point purification algorithm based on sparse feature points is used to accurately match multiple initial matching pairs to obtain the optimized homography matrix.
[0026] Based on the fact that only about 20% of the feature points in core borehole images are of practical significance (rock interface, fracture endpoint, lithological abrupt change, etc.), while the remaining 80% are invalid feature points with repetitive textures, a geometric consistency interior point purification algorithm based on sparse feature points is used to estimate the optimal homography matrix.
[0027] Step S5: Based on the optimized homography matrix, stitch together two adjacent core borehole images.
[0028] The optimized homography matrix includes: a parameter representing the horizontal offset in the matching of two adjacent image frames. The parameter representing the vertical offset in the matching of two adjacent image frames. ;according to and Existing image fusion methods are used to stitch together two adjacent core borehole images. Figure 2 The image shows a real-time stitched result of core borehole images.
[0029] In this embodiment, the Harris algorithm is used to filter the corner points detected by the FAST algorithm, which significantly improves the extraction quality and matching robustness of feature points. Combined with quadtree partitioning and nonmaximum suppression, a feature point set with spatial uniform distribution and optimal local response can be obtained.
[0030] The initial matching of feature points is performed by using an approximate nearest neighbor search based on spatial indexing. This matching method, which first searches for full coverage and then filters to improve accuracy, can meet the requirements of core image stitching scenarios that require both real-time performance and robustness.
[0031] By utilizing a homography-based geometric consistency in-point purification algorithm based on sparse feature points, high-value matching points are prioritized, while sparsity is used to reduce computational costs and time, ensuring the real-time performance and accuracy of core borehole unfolding image stitching.
[0032] In one embodiment, step S4 involves performing precise matching on multiple initial matching pairs using a homography geometric consistency interior point purification algorithm based on sparse feature points to obtain an optimized homography matrix, including: Step S41: Based on the matching similarity of the initial matching pairs and the response values of the two feature points in the initial matching pairs, the initial matching pairs are comprehensively scored and sorted from high to low scores. The initial matching pairs of the sorted results are selected as the sparse sample set, with the first set proportion (e.g., 20%) being selected. Here, the matching similarity of the initial matching pair has been obtained when the fast approximate nearest neighbor matcher is used for initial matching, and the response values of the two feature points in the initial matching pair have been obtained when the FAST algorithm is used to detect corner points.
[0033] The initial matching pair is comprehensively scored based on its matching similarity and the response values of the two feature points in the initial matching pair. This can be done by setting weights for the matching similarity and the response values of the two feature points, multiplying the matching similarity and response values by their respective weights, and using the results as the score.
[0034] Step S42: Randomly select k0 (e.g., 15~20) pairs of non-collinear samples from the sparse sample set, estimate the initial homography matrix, such as by robust least squares estimation, and calculate the reprojection error e and interior point probability P of each sample in the sparse sample set based on the initial homography matrix. e = ||(x2,y2)-H(x1,y1)|| P = 1 / (1+e) Where (x1,y1) and (x2,y2) are the coordinates of two feature points in the sample, and H is the homography matrix; Step S43: Sort the samples according to the inlier probability from high to low, increase the number of samples by m (e.g., 10) compared to the previous sample number, randomly select non-collinear samples (e.g., k0+10) from the sorting results, and re-estimate the homography matrix; calculate the reprojection error and inlier probability of each sample in the sparse sample set based on the homography matrix. Step S44: Determine whether the difference between the reprojection error of the current homography matrix and the reprojection error of the previous homography matrix is less than a first set value (e.g., 0.1 pixels). If yes, the current homography matrix is the initially determined homography matrix; otherwise, return to step S43. Step S45: Calculate the reprojection error of each sample based on the initially determined homography matrix, and retain samples with reprojection errors less than a second set value (e.g., 1.5 pixels) as the final matching pairs; Step S46: Based on the final matching pairs, the homography matrix is re-estimated using the robust least squares method to obtain the optimized homography matrix.
[0035] In this embodiment, the sparse characteristics of feature points in core borehole images and the fact that geologically significant feature points (rock interfaces, fracture endpoints, and lithological abrupt changes) typically account for only about 20% of the total are used to construct a sparse sample set. Optimal model estimation is achieved through three main steps: interior point probability calculation and sorting, progressive sampling, and model estimation with dynamic iteration termination. By discarding a large number of redundant points that do not provide effective information, the speed of accurate matching of core borehole unfolded images is greatly improved (total time for accurate matching based on geometric consistency of the sparse sample set is <6ms).
[0036] To further verify the effectiveness of the proposed method, a technical comparison was made with two mainstream schemes: SIFT+RANSAC and ORB+RANSAC. The comparison results are shown in Table 1.
[0037] Experiments show that this application can improve the matching accuracy to over 95% (image stitching error < 0.5 pixels) with almost no impact on real-time performance (total time < 8ms, which can be further reduced to 3-5ms with GPU acceleration), which is 20.3% higher than SIFT+RANSAC and 5.6% higher than ORB+RANSAC.
[0038] Based on the same inventive concept as the real-time core borehole image stitching method, this embodiment also provides a corresponding real-time core borehole image stitching device, including: The corner detection and filtering module is used to quickly detect corners using the FAST algorithm for any two adjacent core borehole images, and to remove weak corners using the Harris algorithm, while retaining true corners with high response values, thus obtaining two true corner image frames. The corner point uniformization and filtering module is used to achieve uniform distribution of true corner points in each frame of true corner point image by using a quadtree partitioning method, and to filter high-quality corner points by using a non-maximum suppression method. The feature point initial matching module is used to perform initial matching on high-quality corner points in two frames of images using a fast approximate nearest neighbor matcher to obtain multiple initial matching pairs. The feature point precise matching module is used to perform precise matching on multiple initial matching pairs using a homography geometric consistency interior point purification algorithm based on sparse feature points, and obtain an optimized homography matrix. The image stitching module is used to stitch together two adjacent core borehole images based on the optimized homography matrix.
[0039] The real-time core borehole image stitching device of this embodiment has the same inventive concept as the real-time core borehole image stitching method described above. Therefore, the specific implementation of this device can be found in the embodiment section of the real-time core borehole image stitching method described above, and its technical effects correspond to the technical effects of the above method, so it will not be repeated here.
[0040] The above descriptions are merely various embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for real-time stitching of core borehole images, characterized in that, include: For any two adjacent core borehole images, the FAST algorithm is used to quickly detect corner points, and the Harris algorithm is used to remove weak corner points and retain true corner points with high response values, thus obtaining two true corner point images. A quadtree partitioning method is used to achieve a uniform distribution of true corner points in each frame of the image, and a non-maximum suppression method is used to select high-quality corner points. A fast approximate nearest neighbor matcher is used to perform initial matching on high-quality corner points in two frames of images, resulting in multiple initial matching pairs. The multiple initial matching pairs are precisely matched using a homography geometric consistency interior point purification algorithm based on sparse feature points to obtain an optimized homography matrix; Based on the optimized homography matrix, adjacent core borehole images are stitched together.
2. The method as described in claim 1, characterized in that, in, The multiple initial matching pairs are precisely matched using a homography geometric consistency interior point purification algorithm based on sparse feature points to obtain an optimized homography matrix, including: Step S41: Based on the matching similarity of the initial matching pairs and the response values of the two feature points in the initial matching pairs, the initial matching pairs are comprehensively scored and sorted from high to low scores. The initial matching pairs of the sorted results are selected as a sparse sample set. Step S42: Randomly select k0 pairs of non-collinear samples from the sparse sample set, estimate the initial homography matrix, and calculate the reprojection error and interior point probability of each sample in the sparse sample set based on the initial homography matrix. Step S43: Sort the samples according to the inlier probability from high to low, increase the number of samples by m compared to the previous sample selection, randomly select non-collinear samples from the sorting results, and re-estimate the homography matrix; calculate the reprojection error and inlier probability of each sample in the sparse sample set based on the homography matrix. Step S44: Determine whether the difference between the reprojection error of the current homography matrix and the reprojection error of the previous homography matrix is less than the first set value. If yes, the current homography matrix is the initially determined homography matrix. If no, return to step S43. Step S45: Calculate the reprojection error of each sample based on the initially determined homography matrix, and retain samples with reprojection errors less than a second set value as the final matching pairs; Step S46: Based on the final matching pair, the homography matrix is re-estimated using the robust least squares method to obtain the optimized homography matrix.
3. The method as described in claim 2, characterized in that, The reprojection error of the sample is calculated using the following formula: e = ||(x2,y2)-H(x1,y1)|| Where e is the reprojection error of the sample, (x1,y1) and (x2,y2) are the coordinates of two feature points in the sample, H is the homography matrix; ||.|| denotes the norm; The probability of an interior point is calculated using the following formula: P = 1 / (1+e) Where P is the interior point probability.
4. The method as described in claim 1, characterized in that, in, Based on the homography matrix, the stitching of two adjacent core borehole images is achieved, including: The optimized homography matrix includes a parameter representing the horizontal offset in the matching of two adjacent image frames. The parameter representing the vertical offset in the matching of two adjacent image frames. ;according to and To stitch together two adjacent core borehole images.
5. A real-time image stitching device for rock core boreholes, characterized in that, include: The corner detection and filtering module is used to quickly detect corners using the FAST algorithm for any two adjacent core borehole images, and to remove weak corners using the Harris algorithm, while retaining true corners with high response values, thus obtaining two true corner image frames. The corner point uniformization and filtering module is used to achieve uniform distribution of true corner points in each frame of true corner point image by using a quadtree partitioning method, and to filter high-quality corner points by using a non-maximum suppression method. The feature point initial matching module is used to perform initial matching on high-quality corner points in two frames of images using a fast approximate nearest neighbor matcher to obtain multiple initial matching pairs. The feature point precise matching module is used to perform precise matching on the multiple initial matching pairs using a homography geometric consistency interior point purification algorithm based on sparse feature points, so as to obtain an optimized homography matrix. The image stitching module is used to stitch together two adjacent core borehole images based on the optimized homography matrix.