Image region splicing method based on gray level co-occurrence matrix
Through the method based on grayscale symbiosis matrix, the problem of low accuracy and efficiency of image stitching in the prior art in complex scenarios is solved, and a more efficient and accurate image stitching effect is achieved.
Patent Information
- Application Number
- CN202510160684.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-13
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2045-02-13
AI Technical Summary
The existing image stitching technology is difficult to accurately align images in complex scenarios, resulting in obvious seams or misalignment in the stitched images, affecting the accuracy of visual effects and image expression. At the same time, the calculation amount is large, resulting in low stitching efficiency.
The image area stitching method based on the grayscale symbiosis matrix is adopted. By acquiring the grayscale image of the original image, determining the important image areas, constructing the grayscale symbiosis matrix, calculating the image matching value, performing image correction, obtaining the intermediate grayscale image, determining the image feature value, and performing image processing and stitching.
The accuracy and efficiency of image stitching are improved, and the image matching situation is more accurately analyzed through the grayscale symbiosis matrix, reducing the stitching traces, making the transition between images smoother, reducing the data processing volume, and improving processing efficiency.
Smart Images

Figure CN120125428A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and particularly to an image region stitching method based on a gray-level co-occurrence matrix. Background Art
[0002] With the development of computer and image processing technologies, image stitching technology provides a good solution for obtaining wide-angle images. Image stitching technology can stitch multiple small-field images into a large-field panoramic image, enabling people to observe a scene more comprehensively and completely, and playing a significant role in fields such as panoramic photography and unmanned aerial vehicle mapping. By stitching multiple low-resolution images, higher-resolution images can be obtained to a certain extent, making the image details more abundant. Also, images taken from different angles and at different times can be stitched together to supplement the missing parts in the image, providing more complete information for image analysis and understanding, and being beneficial to tasks such as image restoration and computer special effects production.
[0003] In the existing image stitching methods, the most commonly used is to extract image features using the SIFT algorithm proposed by Lowe. The SIFT algorithm uses the difference Gaussian extreme values in the scale space as the judgment basis, takes the pixel points with difference Gaussian extreme values greater than the threshold in the images to be stitched as feature points, determines the gradient direction of each feature point, and combines the gradient distribution characteristics of the neighborhood pixels to generate the feature description vector of the feature point. Among them, the scale space of the image in this algorithm is obtained by convolving the image with a Gaussian kernel. The feature points in one of the two images to be stitched are matched with the feature points in the other image. If the feature description vectors of two feature points are the same, the matching is successful. At the position of the successfully matched feature points, the two images are overlapped to stitch into an image. Since there will be a straight seam after overlapping the two images, the straight seam is blurred to fade the seam.
[0004] However, in some complex scenarios, such as when there are large-angle rotations, scale changes, or high similarity in image content, the existing stitching technologies may be difficult to accurately align the images, resulting in obvious seams or misalignments in the stitched image, affecting the visual effect and the accuracy of image expression; in steps such as feature point extraction, matching, and image registration, especially when processing high-resolution images and multi-camera systems, the computational amount is large, resulting in relatively low stitching efficiency. Summary of the Invention
[0005] Therefore, the present invention provides an image region stitching method based on a gray-level co-occurrence matrix to overcome the problems of low stitching accuracy and efficiency in the prior art.
[0006] To achieve the above object, the present invention provides an image region stitching method based on a gray-level co-occurrence matrix, including:
[0007] Step S1, obtain a plurality of grayscale images corresponding to a plurality of original images, and determine the image important regions of each grayscale image;
[0008] Step S2, construct the gray-level co-occurrence matrices of each of the image important regions, and determine the image matching values based on each gray-level co-occurrence matrix;
[0009] Step S3, perform image correction on each of the grayscale images based on the image matching values to obtain an intermediate grayscale image corresponding to each grayscale image;
[0010] Step S4, obtain the image features corresponding to each of the intermediate grayscale images, and determine the image feature values corresponding to the intermediate grayscale images based on the image features of the intermediate grayscale images and their neighboring images;
[0011] Step S5, determine the image processing method of the intermediate grayscale image based on the image feature values corresponding to the intermediate grayscale image, including,
[0012] determine the key pixel points based on the pixel points in the edge regions of the intermediate grayscale image and its neighboring images, and adjust the edge region of the intermediate grayscale image based on the key pixel points;
[0013] Or, divide the edge regions of the intermediate grayscale image and its neighboring images into regions, determine the key edge sub-regions, and perform edge region processing on the key edge sub-regions;
[0014] Step S6, splice the processed intermediate grayscale images to obtain a pre-spliced image, and determine whether the spliced part of the pre-spliced image meets a preset standard. If it meets the standard, determine the pre-spliced image as the target spliced image.
[0015] Further, in the step S2, determining the image matching value includes:
[0016] Step S21, determine the gray-level features corresponding to each of the image important regions based on the gray-level co-occurrence matrices of each of the image important regions;
[0017] Step S22, determine the feature comparison values between each grayscale image based on each gray-level feature, and determine the image matching value based on each feature comparison value.
[0018] Further, in the step S3, it includes:
[0019] Step S31, compare the feature comparison values of each of the grayscale images, and determine the basic grayscale image based on the comparison result;
[0020] Step S32, perform image correction on each of the grayscale images based on the basic grayscale image and the image matching value.
[0021] Further, in the step S4, it includes:
[0022] Comparing the image features of the intermediate grayscale image with the standard image features, and comparing the image features of the neighborhood image corresponding to the intermediate grayscale image with the standard image features, and determining the image feature value corresponding to the intermediate grayscale image according to the comparison result.
[0023] Further, in the step S5, it includes:
[0024] Comparing the image feature value corresponding to the intermediate grayscale image with the first preset image feature value and the second preset image feature value, and determining the image processing method of the intermediate grayscale image according to the comparison result.
[0025] Wherein, if the image feature value is less than the first preset image feature value, key pixel points are determined based on the pixel points in the edge region of the intermediate grayscale image and its neighborhood image, and the edge region of the intermediate grayscale image is adjusted based on each key pixel point.
[0026] If the image feature value is greater than the second preset image feature value, the edge regions of the intermediate grayscale image and its neighborhood image are divided into regions, key edge sub-regions are determined, and edge region processing is performed on the key edge sub-regions.
[0027] Further, in the step S5, determining key pixel points includes:
[0028] Step S51, traversing the pixel points in the edge region of each intermediate grayscale image, and constructing a local region gray-level co-occurrence matrix corresponding to each pixel point.
[0029] Step S52, determining the gray-level feature corresponding to each pixel point based on the local region gray-level co-occurrence matrix corresponding to each pixel point.
[0030] Step S53, determining key pixel points based on the comparison result between the gray-level feature corresponding to each pixel point and the preset gray-level feature.
[0031] Further, in the step S5, adjusting the edge region of the intermediate grayscale image based on key pixel points includes:
[0032] Step S54, inputting the gray-level value corresponding to the key pixel point into the target neural network model to obtain a number of supplementary pixel points output by the target neural network model.
[0033] Step S55, adjusting the edge region of the intermediate grayscale image based on each supplementary pixel point.
[0034] Further, in the step S5, determining key edge sub-regions includes:
[0035] Step S56, partitioning the edge region of the intermediate grayscale image and its neighborhood image to obtain several edge sub-regions;
[0036] Step S57, determining corresponding grayscale vectors based on the pixel grayscale values within each of the edge sub-regions;
[0037] Step S58, determining vector matching values based on each of the grayscale vectors, and determining key edge sub-regions based on the vector matching values.
[0038] Further, in the step S5, performing edge region processing on the key edge sub-regions includes:
[0039] Determining redundant grayscale values based on the pixel grayscale values within the key edge sub-regions, determining redundant pixel points according to the distribution of the pixel points corresponding to the redundant grayscale values in the edge region of the intermediate grayscale image, and removing the redundant pixel points in the edge region of the intermediate grayscale image.
[0040] Further, in the step S6, it includes:
[0041] Step S61, constructing a splicing grayscale co-occurrence matrix for the splicing part of the pre-spliced image, and determining the splicing grayscale features corresponding to the pre-spliced image;
[0042] Step S62, determining characteristic grayscale values based on the grayscale value change curve of the splicing part of the pre-spliced image;
[0043] Step S63, determining whether the splicing part of the pre-spliced image meets a preset standard based on the splicing grayscale features and the characteristic grayscale values.
[0044] Compared with the prior art, the beneficial effects of the present invention are as follows. By obtaining a plurality of grayscale images corresponding to a plurality of original images and determining the image important regions of each grayscale image, the present invention can reduce the data processing volume and improve the processing efficiency. By constructing the gray-level co-occurrence matrix of each image important region to determine the image matching value and performing image correction according to the image matching value, the gray-level co-occurrence matrix can effectively describe the spatial distribution relationship of gray-level pairs in the image. Using the gray-level co-occurrence matrix of the image important region of the grayscale image to determine the image matching value can more accurately analyze the image matching situation between different images. Performing image correction according to the image matching value can improve the accuracy and efficiency of subsequent image stitching. The image features of the middle grayscale image and its neighboring images can accurately locate the stitching region, providing data support for determining the image processing method of the middle grayscale image in the subsequent process and improving the data processing efficiency. By processing the edge region of the middle grayscale image through two image processing methods, the images can be accurately aligned, the stitching traces can be reduced, the transition between images can be made smoother, and the stitching accuracy can be improved. By determining whether the stitching part of the pre-stitching images meets the preset standard, the accuracy and efficiency of image stitching can be further improved.
[0045] Furthermore, the gray-level features determined by the gray-level co-occurrence matrix of the present invention can effectively capture the detailed features of the image. By calculating the feature comparison values between each grayscale image based on the gray-level features, the feature differences between each grayscale image can be reflected. By determining the image matching value through the feature comparison value, the reliability of image matching can be ensured, thereby improving the accuracy of image stitching.
[0046] Furthermore, the present invention determines the basic grayscale image by comparing the feature comparison values of each grayscale image, selects a reference standard for subsequent processing, and makes subsequent image correction more efficient and accurate. Based on the basic grayscale image and the image matching value, image correction is performed on each grayscale image to reduce the differences between different grayscale images, thereby providing a basis for subsequent image stitching or alignment, reducing interference, and improving the quality of image stitching.
[0047] Furthermore, by constructing a local region gray-level co-occurrence matrix corresponding to each pixel, the present invention can capture the texture features of each local position at the image edge. The features of the image edge region may vary greatly at different positions. Constructing a local matrix for each pixel enables the processing to adapt to these local changes. Pixel points in different regions may be in different texture structures or object edges, and the local matrix can accurately describe these different situations separately, avoiding ignoring local detail differences due to using global features. Determining the gray-level features based on the local region gray-level co-occurrence matrix of each pixel can generate a unique set of feature descriptions for each pixel, characterizing the gray-level characteristics of the local region where the pixel is located from multiple dimensions and providing accurate data support for subsequent analysis and decision-making. By comparing the gray-level features of each pixel with the preset gray-level features, key pixel points can be screened out. By highlighting these key pixel points, the data volume can be effectively reduced while retaining the most representative and discriminative information in the image, thereby optimizing the processing flow and improving the processing efficiency.
[0048] Furthermore, by dividing the edge region of the middle gray-level image and its neighborhood image into several edge sub-regions, the present invention helps to analyze the image edge more meticulously. Different edge regions may have different features and importance. Through this division, each small region can be processed separately, avoiding ignoring local details due to overall processing. Determining the corresponding gray-level vector based on the pixel gray-level values within each edge sub-region, and quantifying the gray-level information of each edge sub-region. Through this quantization method, it is more convenient to compare and analyze the features of different edge sub-regions, providing a data basis for subsequent matching and key region determination. The gray-level vector represents the pixel information of the edge sub-region. Compared with directly processing a large amount of pixel data, using the gray-level vector for calculation and analysis is more efficient, reducing the complexity of data processing while retaining the key gray-level features. Determining the vector matching value based on each gray-level vector and thereby determining the key edge sub-region helps to extract the most representative and important regions from numerous edge sub-regions, improving the accuracy of stitching. By determining the key edge sub-region, the subsequent image processing resources can be concentrated on these important regions, avoiding indiscriminate processing of all edge sub-regions, thereby optimizing the entire image processing flow and improving the processing efficiency. At the same time, the determination of the key edge sub-region also helps to reduce the interference of noise and irrelevant information on the image processing result and improve the accuracy of image stitching.
[0049] Furthermore, the present invention quantifies the texture characteristics of the splicing region from multiple perspectives through the splicing gray - level features determined based on the spliced gray - level co - occurrence matrix. The gray - level value change curve reflects the change of the gray - level values of the splicing part of the pre - spliced images. Whether it meets the preset standard is determined based on the splicing gray - level features and the characteristic gray - level values, realizing a comprehensive evaluation of the splicing part of the pre - spliced images. The splicing gray - level features provide an overall evaluation from a macroscopic texture perspective, while the characteristic gray - level values supplement from the microscopic details of gray - level changes. This multi - dimensional evaluation method is more comprehensive and accurate, can accurately judge whether the splicing part reaches the expected quality level, helps to ensure the consistency and reliability of the image - processing results, and thus more precisely measures the quality of image splicing. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 is a flowchart of the image region splicing method based on the gray - level co - occurrence matrix according to an embodiment of the present invention;
[0051] Figure 2 is a schematic flowchart of determining the image matching value according to an embodiment of the present invention;
[0052] Figure 3 is a schematic flowchart of determining the key pixel points according to an embodiment of the present invention;
[0053] Figure 4 is a schematic flowchart of determining the key edge sub - regions according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0054] In order to make the objectives and advantages of the present invention more clearly understood, the present invention will be further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0055] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present invention and do not limit the protection scope of the present invention.
[0056] Please refer to Figure 1 as shown, which is a flowchart of the image region splicing method based on the gray - level co - occurrence matrix according to an embodiment of the present invention; An embodiment of the present invention provides an image region splicing method based on the gray - level co - occurrence matrix, including:
[0057] Step S1, obtain a plurality of gray - level images corresponding to a plurality of original images, and determine the image important regions of each gray - level image;
[0058] In implementation, determine the neighborhood images of each gray - level image, and determine the image important regions of each gray - level image based on the significant features in each gray - level image and its neighborhood image.
[0059] It can be understood that the important image regions are the regions in the grayscale image that contain significant features. The significant features can be the features of the common image content between the grayscale image and its neighboring images. The area of the important image regions is smaller than the area of the grayscale image. Generally, the number of neighboring images of the grayscale image is the same as the number of important image regions, and each grayscale image has at least one neighboring image. Therefore, each grayscale image contains at least one important image region.
[0060] It can be understood that those skilled in the art know that any method in the prior art for determining the neighboring images of a grayscale image and the method for determining the important image regions, such as edge detection and contour extraction, region growing, object detection, etc., all fall within the protection scope of the present invention and will not be elaborated herein.
[0061] Step S2: Construct the gray-level co-occurrence matrices of the respective important image regions, and determine the image matching values based on the respective gray-level co-occurrence matrices;
[0062] It can be understood that the method for constructing the gray-level co-occurrence matrix is prior art and will not be elaborated herein. The gray-level co-occurrence matrix has a good stitching effect in low-texture regions lacking obvious corners or edges. In addition, for the case where the texture is discontinuous in the overlapping region (edge) of the stitched images, the gray-level co-occurrence matrix can be used for optimized fusion.
[0063] Please refer to Figure 2 shown, which is a schematic flowchart for determining the image matching values in an embodiment of the present invention; specifically, in the step S2, determining the image matching values includes:
[0064] Step S21: Determine the gray-level features corresponding to the respective important image regions based on the gray-level co-occurrence matrices of the respective important image regions;
[0065] Step S22: Determine the feature comparison values between the respective grayscale images based on the respective gray-level features, and determine the image matching values based on the respective feature comparison values.
[0066] In implementation, the gray-level features include contrast, correlation, energy, entropy, homogeneity, etc. The contrast reflects the degree of difference in gray-level values in the image. The larger the value, the clearer the texture of the image and the more drastic the gray-level change; the correlation is used to measure the linear correlation of gray-level values in the image and reflects the direction and regularity degree of the image texture; the energy reflects the uniformity of the gray-level distribution in the image and the thickness of the texture. The larger the energy value, the more regular and uniform the texture of the image; the entropy reflects the complexity of the texture in the image. The larger the entropy value, the more complex the texture of the image and the stronger the randomness; the homogeneity describes the degree of similarity of gray-level values of adjacent pixels in the image. The larger the value, the smoother the texture of the image and the closer the gray-level values. The determination methods thereof are all prior art and will not be elaborated herein.
[0067] It can be understood that the image matching value can be determined according to the feature comparison value between the grayscale image and the neighborhood image and the feature coefficient corresponding to the grayscale image, wherein the feature coefficient corresponding to the grayscale image is determined according to the number of neighborhood images of the grayscale image.
[0068] In a specific embodiment, the neighborhood images of the grayscale image A are the grayscale image B and the grayscale image C respectively, and the grayscale feature of the grayscale image A is A 1 , A 2 , …, A j , …, A m , the grayscale feature of the grayscale image B is B 1 , B 2 , …, B j , …, B m , the grayscale feature of the grayscale image C is C 1 , C 2 , …, C j , …, C m , j = 1, 2, …, m; m is the number of grayscale features, then the feature comparison value AB between the grayscale image A and the grayscale image B = sqrt(∑ m j=1 (A j -B j ) 2 ), the feature comparison value AC between the grayscale image A and the grayscale image C = sqrt(∑ m j=1 (A j -C j ) 2 ), sqrt() is a preset square root determination function, then the image matching value corresponding to the grayscale image A
[0069] The grayscale features determined by the gray-level co-occurrence matrix of the present invention can effectively capture the detailed features of the image. By calculating the feature comparison values between the grayscale images based on the grayscale features, the feature differences between the grayscale images can be reflected. By determining the image matching value through the feature comparison value, the reliability of image matching can be guaranteed, thereby improving the accuracy of image stitching.
[0070] Step S3, perform image correction on each of the grayscale images based on the image matching value to obtain an intermediate grayscale image corresponding to each grayscale image;
[0071] Specifically, in the step S3, it includes:
[0072] Step S31, compare the feature comparison values of the grayscale images, and determine the basic grayscale image based on the comparison result;
[0073] Step S32: Image correction is performed on each of the grayscale images based on the basic grayscale image and the image matching value.
[0074] In implementation, if the feature comparison values corresponding to the grayscale images are all greater than the preset comparison threshold, then this grayscale image is determined as the basic grayscale image. The correction coefficients between the basic grayscale image and each grayscale image are determined based on the image matching values between the basic grayscale image and each grayscale image, and gray-scale transformation and scale transformation are performed on each grayscale image according to the correction coefficients.
[0075] It can be understood that the actual implementer can set the preset comparison threshold according to the actual situation or based on the maximum value of the feature comparison values of the grayscale images that pass the qualification test in the historical data. Preferably, the value range of the preset comparison threshold is set to 0.75 - 0.85.
[0076] In the present invention, the basic grayscale image is determined by comparing the feature comparison values of each grayscale image, selecting a reference standard for subsequent processing, and making subsequent image correction more efficient and accurate. Image correction is performed on each grayscale image based on the basic grayscale image and the image matching value, reducing the differences between different grayscale images, thereby providing a basis for subsequent image stitching or alignment, reducing interference, and improving the quality of image stitching.
[0077] Step S4: Obtain the image features corresponding to each of the intermediate grayscale images, and determine the image feature value corresponding to the intermediate grayscale image based on the image features of the intermediate grayscale image and its neighboring images;
[0078] It can be understood that the important image regions of the intermediate grayscale images are re-determined, and the image features of the important image regions corresponding to each intermediate grayscale image are obtained. The image features include geometric parameters (area, perimeter, diameter, etc.), spatial relationships (positional relationship, distance relationship, topological relationship, etc.), and contour features (curvature of the contour, inflection points, etc.).
[0079] Specifically, in the step S4, it includes:
[0080] Compare the image features of the intermediate grayscale image with the standard image features, and compare the image features of the neighboring images corresponding to the intermediate grayscale image with the standard image features, and determine the image feature value corresponding to the intermediate grayscale image according to the comparison results.
[0081] In a specific embodiment, the image features ZD of the intermediate grayscale image 1 , ZD 2 , …, ZD i , …, ZD n , the standard image features BD 1 , BD 2 , …, BDi , …, BD n , the image feature LD of the neighborhood image corresponding to the intermediate grayscale image 1 , LD 2 , …, LD i , …, LD n ; where i = 1, 2, …, n, n is the number of image features, and the first image comparison value YT is determined according to the image features of the intermediate grayscale image and the standard image features: YT = (∑ n i=1 ZD i × BD i ) / (sqrt(∑ n i=1 (ZD i ) 2 ) × sqrt(∑ n i=1 (BD i ) 2 ), and the second image comparison value ET is determined according to the image features of the neighborhood image corresponding to the intermediate grayscale image and the standard image features: ET = (∑ n i=1 LD i × BD i ) / (sqrt(∑ n i=1 (LD i ) 2 ) × sqrt(∑ n i=1 (BD i ) 2 ), then the image feature value ZT corresponding to the intermediate grayscale image is ZT = YT / ET. It can be understood that the actual implementer can set the standard image features according to the actual situation of the specific content in each image.
[0082] Step S5, determining the image processing method of the intermediate grayscale image based on the image feature value corresponding to the intermediate grayscale image, including
[0083] determining key pixel points based on the pixel points in the edge region of the intermediate grayscale image and its neighborhood image, and adjusting the edge region of the intermediate grayscale image based on the key pixel points;
[0084] or, dividing the edge region of the intermediate grayscale image and its neighborhood image into regions, determining key edge sub-regions, and performing edge region processing on the key edge sub-regions;
[0085] Specifically, in the step S5, it includes:
[0086] Compare the image feature values corresponding to the intermediate grayscale image with the first preset image feature value and the second preset image feature value, and determine the image processing method for the intermediate grayscale image according to the comparison result.
[0087] Among them, if the image feature value is less than the first preset image feature value, determine the key pixel points based on the pixel points in the edge region of the intermediate grayscale image and its neighborhood image, and adjust the edge region of the intermediate grayscale image based on each key pixel point.
[0088] If the image feature value is greater than the second preset image feature value, divide the edge region of the intermediate grayscale image and its neighborhood image into regions, determine the key edge sub-regions, and perform edge region processing on the key edge sub-regions.
[0089] It can be understood that the smaller the image feature value corresponding to the intermediate grayscale image, the greater the difference between the important image regions of the intermediate grayscale image and its neighborhood image, and there may be missing image content in the edge region. The larger the image feature value corresponding to the intermediate grayscale image, the smaller the difference between the important image regions of the intermediate grayscale image and its neighborhood image, and there may be redundant content in the edge region. Therefore, if the image feature value is less than the first preset image feature value, image supplementation is performed on the edge region of the intermediate grayscale image. If the image feature value is greater than the second preset image feature value, redundant point removal is performed on the edge region of the intermediate grayscale image.
[0090] It can be understood that the actual implementers can set the first preset image feature value and the second preset image feature value according to the actual situation or based on historical data training and prediction. Preferably, the value range of the first preset image feature value is set to 0.2 - 0.5, and the value range of the second preset image feature value is set to 1 - 2.
[0091] Please refer to Figure 3 as shown, which is a schematic flowchart for determining key pixel points in an embodiment of the present invention. Specifically, in step S5, determining the key pixel points includes:
[0092] Step S51, traverse the pixel points in the edge region of each intermediate grayscale image, and construct a local region gray-level co-occurrence matrix corresponding to each pixel point.
[0093] Step S52, determine the gray-level feature corresponding to each pixel point based on the local region gray-level co-occurrence matrix corresponding to each pixel point.
[0094] Step S53, determine the key pixel points based on the comparison result between the gray-level feature corresponding to each pixel point and the preset gray-level feature.
[0095] In implementation, the edge regions of each intermediate grayscale image are detected through an edge detection algorithm, which is a prior art and will not be elaborated here. The local region corresponding to each pixel point is a rectangular or square region centered on that pixel point. For example: 5×5, 7×7, etc. For the local region of each edge pixel point, a corresponding gray-level co-occurrence matrix is constructed. Taking a 5×5 local region as an example, assuming the gray level is 8, that is, the gray value range is 0 to 7. For a given direction (such as 0°, 45°, 90°, 135°) and distance d (such as d = 1), all pixel point pairs within the local region are traversed. If, in the given direction and distance, the gray value of one pixel point is p and the gray value of another pixel point is q, then the element value in the p-th row and q-th column of the gray-level co-occurrence matrix is incremented by 1. After completing the counting of all pixel point pairs within the local region, the gray-level co-occurrence matrix is normalized. Each element in the matrix is divided by the sum of all elements in the matrix to obtain the normalized gray-level co-occurrence matrix, making the sum of its element values equal to 1.
[0096] It can be understood that actual implementers can set preset gray-scale features according to specific application scenarios and image characteristics. For example, in a target detection task, if it is known that the texture features of the target object's edge have a high contrast and a low entropy, the preset contrast threshold can be set to a higher value and the entropy threshold can be set to a lower value. It is also possible to perform statistical analysis on a large number of images with similar features to determine appropriate preset gray-scale features. For example, calculate the average value and standard deviation of the gray-scale features of the edge pixel points in the target region of a set of training images and use them as the preset gray-scale features. Compare the gray-scale feature corresponding to each pixel point with the preset gray-scale feature, and determine the key pixel points that meet the preset conditions. Actual implementers can set the preset conditions according to specific application scenarios and image characteristics. For example: whether the contrast is greater than the preset contrast threshold, whether the entropy is less than the preset entropy threshold. If the contrast of a pixel point is greater than the preset contrast threshold and the entropy is less than the preset entropy threshold, then it meets the preset conditions.
[0097] By constructing a local region gray-level co-occurrence matrix corresponding to each pixel point, the present invention can capture the texture features of each local position at the image edge. The features in the image edge region may vary greatly at different positions. Constructing a local matrix for each pixel point enables the processing process to adapt to these local changes. Pixel points in different regions may be in different texture structures or object edges, and the local matrix can accurately describe these different situations respectively, avoiding ignoring local detail differences due to using global features. Determining the gray-level features based on the local region gray-level co-occurrence matrix of each pixel point can generate a unique set of feature descriptions for each pixel point, depicting the gray-level characteristics of the local region where the pixel point is located from multiple dimensions, providing accurate data support for subsequent analysis and decision-making. By comparing the gray-level features of each pixel point with the preset gray-level features, key pixel points can be screened out. By highlighting these key pixel points, the data volume can be effectively reduced while retaining the most representative and discriminative information in the image, thereby optimizing the processing flow and improving the processing efficiency.
[0098] Specifically, in the step S5, adjusting the edge region of the intermediate gray-level image based on the key pixel points includes:
[0099] Step S54, inputting the gray-level value corresponding to the key pixel point into the target neural network model to obtain a number of supplementary pixel points output by the target neural network model;
[0100] Step S55, adjusting the edge region of the intermediate gray-level image based on each of the supplementary pixel points.
[0101] In implementation, training samples are determined according to the key pixel points and the corresponding supplementary pixel points in the image edge regions for image supplementation in historical data, and the initial neural network model is trained according to the training samples to obtain the target neural network model. Those skilled in the art know that any neural network model capable of determining supplementary pixel points in the prior art falls within the protection scope of the present invention and will not be elaborated here.
[0102] It can be understood that image supplementation is performed on the edge region through supplementary pixel points to avoid obvious seams in the spliced image, which can improve the splicing effect.
[0103] Specifically, in the step S5, determining the key edge sub-regions includes:
[0104] Step S56, performing region division on the edge regions of the intermediate gray-level image and its neighborhood image to obtain a number of edge sub-regions;
[0105] Step S57, determining the corresponding gray-level vectors based on the pixel gray-level values in each of the edge sub-regions;
[0106] Step S58: Determine a vector matching value based on each of the grayscale vectors, and determine a key edge sub-region based on the vector matching value.
[0107] In implementation, the edge regions of the intermediate grayscale image and its neighborhood image are partitioned to obtain a number of edge sub-regions. Among them, the frequency of the pixel grayscale values in the corresponding number of edge sub-regions of the intermediate grayscale image is counted to determine the corresponding grayscale vector, and the frequency of the pixel grayscale values in the corresponding number of edge sub-regions of the neighborhood image of the intermediate grayscale image is counted to determine the corresponding neighborhood grayscale vector. The vector matching value between each grayscale vector and each neighborhood grayscale vector is determined respectively. If there is a vector matching value greater than the preset matching value, the corresponding edge sub-region is determined as the key edge sub-region. For example, taking an edge sub-region of the intermediate grayscale image and an edge sub-region of its neighborhood image as an example, the grayscale vector HX 1 , HX 2 , …, HX g , …, HX h , and the neighborhood grayscale vector LX 1 , LX 2 , …, LX g , …, LX h . Then the vector matching value XP, XP = (∑ h g=1 HX g ×LX g ) / (sqrt(∑ h g=1 (HX g ) 2 ) × sqrt(∑ h g=1 (LX g ) 2 ), where g = 1, 2, …, h; HX g is the frequency of the g-th pixel grayscale value in the edge sub-region of the intermediate grayscale image, LX g is the frequency of the g-th pixel grayscale value in the edge sub-region of the neighborhood image of the intermediate grayscale image, and h is the total number of pixel grayscale values in the two edge sub-regions. For example, the pixel grayscale values in the edge sub-region of the intermediate grayscale image are 0, 1, 2, 2, and the pixel grayscale values in the edge sub-region of the neighborhood image of the intermediate grayscale image are 1, 3, 5. Then h = 5, that is, 0, 1, 2, 3, 5. Then the grayscale vector is 1, 1, 2, 0, 0, and the neighborhood grayscale vector is 0, 1, 0, 1, 1.
[0108] It can be understood that the actual implementers can set the preset matching value according to the actual situation. Preferably, the value range of the preset matching value is set to 0.8 - 0.9.
[0109] The present invention divides the edge region of the intermediate grayscale image and its neighboring images into several edge sub-regions, which helps to conduct a more detailed analysis of the image edge. Different edge regions may have different characteristics and importance. Through this division, each small region can be processed individually, avoiding the neglect of local details due to overall processing. Based on the pixel grayscale values within each edge sub-region, the corresponding grayscale vectors are determined, and the grayscale information of each edge sub-region is quantitatively represented. Through this quantization method, it is more convenient to compare and analyze the characteristics of different edge sub-regions, providing a data basis for subsequent matching and determination of key regions. The grayscale vector represents the pixel information of the edge sub-region. Compared with directly processing a large amount of pixel data, using grayscale vectors for calculation and analysis is more efficient, reducing the complexity of data processing while retaining the key grayscale features. Based on each grayscale vector, a vector matching value is determined, and based on this, the key edge sub-regions are determined, which helps to extract the most representative and important regions from numerous edge sub-regions, improving the accuracy of splicing. By determining the key edge sub-regions, the subsequent image processing resources can be concentrated on these important regions, avoiding indiscriminate processing of all edge sub-regions, thereby optimizing the entire image processing process and improving the processing efficiency. At the same time, the determination of the key edge sub-regions also helps to reduce the interference of noise and irrelevant information on the image processing results and improve the accuracy of image splicing.
[0110] Specifically, in the step S5, performing edge region processing on the key edge sub-regions includes:
[0111] Determining redundant grayscale values based on the pixel grayscale values within the key edge sub-regions, determining redundant pixel points according to the distribution of the pixel points corresponding to the redundant grayscale values in the edge region of the intermediate grayscale image, and removing the redundant pixel points in the edge region of the intermediate grayscale image.
[0112] In implementation, the pixel grayscale value with the highest occurrence frequency within the key edge sub-region is determined as the redundant grayscale value. If the number of pixel points corresponding to the redundant grayscale value within a preset range is greater than a preset quantity threshold, then the pixel points corresponding to the redundant grayscale value within this preset range are determined as redundant pixel points. It can be understood that the actual implementer can set the preset range according to the actual situation, set the preset quantity threshold according to the size of the preset range. The preset quantity threshold can be set to 2 / 5 - 3 / 5 of the number of pixel points within the preset range. Preferably, the preset range value range is set to 5×5, and the preset quantity threshold value range is set to 10 - 15.
[0113] Step S6, splicing the processed intermediate grayscale images to obtain a pre-spliced image, and determining whether the spliced part of the pre-spliced image meets a preset standard. If it meets the standard, then the pre-spliced image is determined as the target spliced image.
[0114] Please refer to Figure 4 as shown, which is a schematic flowchart for determining the key edge sub-regions in the embodiments of the present invention; specifically, in the step S6, it includes:
[0115] Step S61, constructing the joint gray-level co-occurrence matrix of the joint part of the pre-stitching image, and determining the joint gray-level feature corresponding to the pre-stitching image;
[0116] Step S62, determining the characteristic gray-level value based on the gray-level value change curve of the joint part of the pre-stitching image;
[0117] Step S63, determining whether the joint part of the pre-stitching image meets the preset standard based on the joint gray-level feature and the characteristic gray-level value.
[0118] In implementation, the gray-level value mutation region is determined according to the region on the gray-level change curve where the slope is greater than the preset slope threshold, the characteristic gray-level value is determined according to the gray-level values within the gray-level value mutation region, the joint gray-level feature is compared with the standard gray-level feature, if it meets the preset conditions, and the frequency of occurrence of the characteristic gray-level value is less than the preset frequency, then it is determined that the joint part with the stitched image meets the preset standard.
[0119] It can be understood that the actual implementers can set the preset frequency according to the actual image content and application scenarios. Preferably, the value range of the preset frequency is set to 30-50.
[0120] The present invention quantifies the texture characteristics of the stitching region from multiple angles based on the joint gray-level feature determined by the joint gray-level co-occurrence matrix. The gray-level value change curve reflects the change of the gray-level values of the joint part of the pre-stitching image. Determining whether it meets the preset standard based on the joint gray-level feature and the characteristic gray-level value realizes the comprehensive evaluation of the joint part of the pre-stitching image. The joint gray-level feature provides an overall evaluation from the macroscopic texture perspective, while the characteristic gray-level value makes up for it from the microscopic gray-level change details. This multi-dimensional evaluation method is more comprehensive and accurate, can accurately judge whether the stitching part reaches the expected quality level, helps to ensure the consistency and reliability of the image processing results, and thus more accurately measures the quality of image stitching.
[0121] Specifically, the present invention can reduce the data processing amount and improve the processing efficiency by obtaining a plurality of grayscale images corresponding to a plurality of original images and determining the image important regions of each grayscale image. By constructing the gray-level co-occurrence matrix of each image important region to determine the image matching value and performing image correction according to the image matching value, the gray-level co-occurrence matrix can effectively describe the spatial distribution relationship of gray-level pairs in the image. Using the gray-level co-occurrence matrix of the image important region of the grayscale image to determine the image matching value can more accurately analyze the image matching situation between different images. Performing image correction according to the image matching value can improve the accuracy and efficiency of subsequent image stitching. The image features of the middle grayscale image and its neighboring images can accurately locate the stitching region, providing data support for determining the image processing method of the middle grayscale image subsequently and improving the data processing efficiency. By processing the edge region of the middle grayscale image through two image processing methods, the images can be accurately aligned, the stitching traces can be reduced, the transition between images can be made smoother, and the stitching accuracy can be improved. By determining whether the stitching part of the pre-stitched images meets the preset standard, the accuracy and efficiency of image stitching can be further improved.
[0122] So far, the technical solution of the present invention has been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the protection scope of the present invention.
Claims
1. A method for image region splicing based on gray level co-occurrence matrix, characterized in that: include: Step S1, obtaining a plurality of grayscale images corresponding to a plurality of original images, and determining an important image area of each grayscale image; Step S2, constructing a gray level co-occurrence matrix of each important area of the image, and determining an image matching value based on each gray level co-occurrence matrix; Step S3, performing image correction on each of the grayscale images based on the image matching value to obtain an intermediate grayscale image corresponding to each grayscale image; Step S4, obtaining image features corresponding to each of the intermediate grayscale images, and determining image feature values corresponding to the intermediate grayscale images based on the image features of the intermediate grayscale images and their neighborhood images; Step S5, determining an image processing method for the intermediate grayscale image based on the image feature value corresponding to the intermediate grayscale image, including: Determine key pixels based on pixel points in edge regions of the intermediate grayscale image and its neighboring images, and adjust the edge region of the intermediate grayscale image based on the key pixels; Alternatively, the edge regions of the intermediate grayscale image and its neighboring images are divided into regions, key edge sub-regions are determined, and edge region processing is performed on the key edge sub-regions; Step S6, stitching the processed intermediate grayscale images to obtain a pre-stitched image, and determining whether the stitched portion of the pre-stitched image meets a preset standard. If so, determining the pre-stitched image as a target stitched image.
2. The image region stitching method based on gray level co-occurrence matrix according to claim 1, characterized in that: In step S2, determining the image matching value includes: Step S21, determining the grayscale features corresponding to each important area of the image based on the grayscale co-occurrence matrix of each important area of the image; Step S22, determining a feature comparison value between each grayscale image based on each grayscale feature, and determining an image matching value based on each feature comparison value.
3. The image region stitching method based on gray level co-occurrence matrix according to claim 2, characterized in that: In the step S3, it includes: Step S31, comparing the feature comparison values of the grayscale images, and determining a basic grayscale image based on the comparison result; Step S32: performing image correction on each of the grayscale images based on the basic grayscale image and the image matching value.
4. The image region stitching method based on gray level co-occurrence matrix according to claim 3 is characterized in that: In the step S4, it includes: The image features of the intermediate grayscale image are compared with the standard image features, and the image features of the neighborhood image corresponding to the intermediate grayscale image are compared with the standard image features, and the image feature value corresponding to the intermediate grayscale image is determined according to the comparison result.
5. The image region stitching method based on gray level co-occurrence matrix according to claim 4, characterized in that: In the step S5, it includes: The image characteristic value corresponding to the intermediate grayscale image is compared with the first preset image characteristic value and the second preset image characteristic value, and the image processing method of the intermediate grayscale image is determined according to the comparison result. Wherein, if the image characteristic value is less than the first preset image characteristic value, key pixel points are determined based on the pixel points in the edge area of the intermediate grayscale image and its neighborhood image, and the edge area of the intermediate grayscale image is adjusted based on each key pixel point; If the image characteristic value is greater than a second preset image characteristic value, the edge region of the intermediate grayscale image and its neighborhood image is divided into regions, and key edge sub-regions are determined, and edge region processing is performed on the key edge sub-regions.
6. The image region stitching method based on gray level co-occurrence matrix according to claim 5, characterized in that: In step S5, determining key pixel points includes: Step S51, traversing the edge area pixels of each of the intermediate grayscale images, and constructing a local area grayscale co-occurrence matrix corresponding to each pixel; Step S52, determining the grayscale feature corresponding to each pixel point based on the local area grayscale co-occurrence matrix corresponding to each pixel point; Step S53, determining key pixels based on the comparison result between the grayscale feature corresponding to each pixel and the preset grayscale feature.
7. The image region stitching method based on gray level co-occurrence matrix according to claim 6, characterized in that: In the step S5, adjusting the edge area of the intermediate grayscale image based on the key pixel points includes: Step S54, inputting the grayscale value corresponding to the key pixel point into the target neural network model to obtain a number of supplementary pixel points output by the target neural network model; Step S55: adjusting the edge area of the intermediate grayscale image based on each of the supplementary pixel points.
8. The image region stitching method based on gray level co-occurrence matrix according to claim 7, characterized in that: In step S5, determining the key edge sub-regions includes: Step S56, dividing the edge regions of the intermediate grayscale image and its neighboring images into regions to obtain a plurality of edge sub-regions; Step S57, determining a corresponding grayscale vector based on the grayscale value of pixels in each edge sub-region; Step S58, determining a vector matching value based on each of the grayscale vectors, and determining a key edge sub-region based on the vector matching value.
9. The image region stitching method based on gray level co-occurrence matrix according to claim 8, characterized in that: In the step S5, edge region processing is performed on the key edge sub-regions, including: Redundant grayscale values are determined based on the grayscale values of pixels in the key edge sub-area, redundant pixels are determined according to the distribution of pixels corresponding to the redundant grayscale values in the edge area of the intermediate grayscale image, and the redundant pixels in the edge area of the intermediate grayscale image are removed.
10. The image region stitching method based on gray level co-occurrence matrix according to claim 9, characterized in that: In the step S6, it includes: Step S61, constructing a splicing grayscale co-occurrence matrix of the splicing part of the pre-splicing image, and determining a splicing grayscale feature corresponding to the pre-splicing image; Step S62, determining a characteristic gray value based on a gray value variation curve of the spliced part of the pre-spliced image; Step S63: determining whether the stitched portion of the pre-stitched image meets a preset standard based on the stitching grayscale feature and the feature grayscale value.
Citation Information
Patent Citations
Adaptive global dark channel prior image dehazing method for bright area
CN105787904A
Image splicing method and system
CN111612690A
Artificial intelligence object fragment image splicing method
CN112419349A
Panoramic image splicing method based on optimal suture line
CN112991176A
Image calibrating method for stitching images and related camera and image processing system with image calibrating function
US20160189379A1