Image region stitching method based on gray-level co-occurrence matrix

Through the image area stitching method based on the grayscale symbiosis matrix, the problems of inaccurate and low efficiency of image stitching in the prior art are solved, and a more efficient and accurate image stitching effect is achieved.

CN120125428BActive Publication Date: 2025-08-12GUILIN UNIV OF AEROSPACE TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510160684.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-13
Publication Date
2025-08-12
Estimated Expiration
2045-02-13

AI Technical Summary

Technical Problem

The existing image stitching method is difficult to accurately align images in complex scenarios, resulting in obvious seams or misalignment in the stitched images, and the calculation is large and the efficiency is low.

Method used

The image area stitching method based on the grayscale symbiosis matrix is adopted. By obtaining important areas of the grayscale image, the grayscale symbiosis matrix is constructed, the image matching value is determined, and image correction and feature comparison are performed, the edge area is adjusted, and the key pixel points and edge area are processed, and finally determine whether the stitching part meets the preset standards.

Benefits of technology

It improves the accuracy and efficiency of image stitching, reduces data processing, accurately aligns images, reduces stitching traces, and enhances the transition fluency and stitching quality between images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120125428B_ABST
    Figure CN120125428B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing technology, and in particular to an image region stitching method based on a grayscale co-occurrence matrix, comprising: acquiring a plurality of grayscale images and determining an important image region of each grayscale image; constructing a grayscale co-occurrence matrix of the important image region, and determining an image matching value based on each grayscale co-occurrence matrix; performing image correction on each grayscale image based on the image matching value to obtain an intermediate grayscale image corresponding to each grayscale image; acquiring image features corresponding to each intermediate grayscale image, and determining an image feature value corresponding to the intermediate grayscale image based on image features of the intermediate grayscale image and its neighborhood images; determining an image processing method for the intermediate grayscale image based on the image feature value corresponding to the intermediate grayscale image, stitching the processed intermediate grayscale images to obtain a pre-stitched image, and determining whether a stitched portion of the pre-stitched image meets a preset standard. The present invention can improve the efficiency and accuracy of stitching large-size image regions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to an image region splicing method based on a gray level co-occurrence matrix. Background Art

[0002] With the development of computer and image processing technology, image stitching technology has provided a promising solution for obtaining wide-viewing angle images. Image stitching technology can combine multiple images with small fields of view into a single, large-field panoramic image, allowing for a more comprehensive and complete observation of a scene. It has significant applications in fields such as panoramic photography and drone mapping. By stitching together multiple low-resolution images, higher-resolution images can be obtained to a certain extent, resulting in richer image detail. Furthermore, images taken from different angles and at different times can be stitched together to supplement missing parts of the image, providing more complete information for image analysis and understanding, facilitating image restoration and computer special effects production.

[0003] Among the existing image stitching methods, the most commonly used is the SIFT algorithm proposed by Lowe to extract image features. The SIFT algorithm uses the differential Gaussian extreme value in the scale space as a judgment basis, and takes the pixel points whose differential Gaussian extreme value of the image to be stitched is greater than the threshold as feature points, and determines the gradient direction of each feature point. Combined with the gradient distribution characteristics of the field pixel, a feature description vector of the feature point is generated. In this algorithm, the scale space of the image is obtained by convolving the image and the Gaussian kernel. The feature points in one image of the two frames to be stitched are matched with the feature points in the other image. If the feature description vectors of the two feature points are the same, the match is successful. The two frames of images are overlapped at the position of the successfully matched feature point to stitch them into one image. Since a straight line seam will appear after the two frames of images are overlapped, the straight line seam is blurred to dilute the seam.

[0004] However, in some complex scenarios, such as those with large-angle rotation, scale changes, or high similarity in image content, existing stitching technologies may find it difficult to accurately align images, resulting in obvious seams or misalignment in the stitched images, 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 amount of computation is large, resulting in relatively low stitching efficiency. Summary of the Invention

[0005] To this end, the present invention provides an image region stitching method based on 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, comprising:

[0007] 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;

[0008] Step S2, constructing a gray level co-occurrence matrix for each important area of the image, and determining an image matching value based on each gray level co-occurrence matrix;

[0009] 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;

[0010] 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 neighboring images;

[0011] 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:

[0012] Determining key pixels based on pixel points in edge areas of the intermediate grayscale image and its neighboring images, and adjusting the edge area of the intermediate grayscale image based on the key pixels;

[0013] Alternatively, dividing the edge regions of the intermediate grayscale image and its neighboring images into regions, determining key edge subregions, and performing edge region processing on the key edge subregions;

[0014] 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.

[0015] Furthermore, in step S2, determining the image matching value includes:

[0016] 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;

[0017] 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.

[0018] Furthermore, in step S3, it includes:

[0019] Step S31, comparing the feature comparison values of the grayscale images, and determining a basic grayscale image based on the comparison results;

[0020] Step S32: performing image correction on each of the grayscale images based on the basic grayscale image and the image matching value.

[0021] Furthermore, in the step S4, it includes:

[0022] 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 results.

[0023] Furthermore, 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] If the image characteristic value is less than a first preset image characteristic value, key pixels are determined based on pixel points in edge areas of the intermediate grayscale image and its neighboring images, and the edge area of the intermediate grayscale image is adjusted based on the key pixels;

[0026] If the image characteristic value is greater than a second preset image characteristic value, the edge area of the intermediate grayscale image and its neighboring image is divided into regions, key edge sub-regions are determined, and edge region processing is performed on the key edge sub-regions.

[0027] Furthermore, in step S5, determining key pixels includes:

[0028] Step S51, traversing the edge area pixels of each intermediate grayscale image, and constructing a local area grayscale co-occurrence matrix corresponding to each pixel;

[0029] 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;

[0030] Step S53 : determining key pixels based on a comparison result between the grayscale feature corresponding to each pixel and a preset grayscale feature.

[0031] Furthermore, in step S5, adjusting the edge area of the intermediate grayscale image based on key pixels includes:

[0032] Step S54, inputting the grayscale value corresponding to the key pixel point into the target neural network model to obtain a plurality of supplementary pixel points output by the target neural network model;

[0033] Step S55 : adjusting the edge area of the intermediate grayscale image based on the supplementary pixel points.

[0034] Furthermore, in step S5, determining the key edge sub-regions includes:

[0035] Step S56, dividing the edge regions of the intermediate grayscale image and its neighboring images into regions to obtain a plurality of edge subregions;

[0036] Step S57, determining a corresponding grayscale vector based on the grayscale values of the pixels in each edge sub-region;

[0037] 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.

[0038] Furthermore, in step S5, edge region processing is performed on the key edge sub-regions, including:

[0039] Redundant grayscale values are determined based on the grayscale values of pixels in the key edge sub-region, redundant pixel points are determined according to the distribution of pixel points corresponding to the redundant grayscale values in the edge region of the intermediate grayscale image, and the redundant pixel points in the edge region of the intermediate grayscale image are removed.

[0040] Furthermore, in step S6, it includes:

[0041] Step S61, constructing a splicing grayscale co-occurrence matrix of the spliced part of the pre-stitched image, and determining a splicing grayscale feature corresponding to the pre-stitched image;

[0042] Step S62, determining a characteristic grayscale value based on a grayscale value variation curve of the spliced portion of the pre-spliced image;

[0043] 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.

[0044] Compared with the prior art, the present invention has the following advantages: by obtaining multiple grayscale images corresponding to multiple original images and determining the image-important regions of each grayscale image, the present invention can reduce data processing volume and improve processing efficiency. By constructing a grayscale co-occurrence matrix for each image-important region to determine image matching values, and performing image correction based on the image matching values, the grayscale co-occurrence matrix can effectively describe the spatial distribution relationship of grayscale pairs in an image. Using the grayscale co-occurrence matrix for the image-important regions of the grayscale images to determine image matching values can more accurately analyze image matching between different images. Performing image correction based on the image matching values can improve the accuracy and efficiency of subsequent image stitching. The image features of the intermediate grayscale image and its neighboring images can accurately locate the stitching region, providing data support for the subsequent determination of the image processing method for the intermediate grayscale image and improving data processing efficiency. By processing the edge regions of the intermediate grayscale images using two image processing methods, the images can be precisely aligned, reducing stitching artifacts, making transitions between images smoother, and improving stitching accuracy. By determining whether the stitched portions of the pre-stitched images meet preset standards, the accuracy and efficiency of image stitching can be further improved.

[0045] Furthermore, the grayscale features determined by the grayscale co-occurrence matrix of the present invention can effectively capture the detailed features of the image, and the feature comparison values between the grayscale images are calculated based on the grayscale features, which can reflect the feature differences between the grayscale images. The image matching values are determined by the feature comparison values, which can ensure the reliability of image matching, thereby improving the accuracy of image stitching.

[0046] Furthermore, the present invention determines a base grayscale image 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 base grayscale image and the image matching value, minimizing the differences between different grayscale images. This provides a basis for subsequent image stitching or alignment, reduces interference, and improves image stitching quality.

[0047] Furthermore, the present invention can capture the texture features of each local position at the edge of the image by constructing a local area grayscale co-occurrence matrix corresponding to each pixel point. The features of the edge area of the image may vary greatly at different positions. By constructing a local matrix for each pixel point, the processing process can adapt to these local changes. Pixels in different areas may be in different texture structures or object edges. The local matrix can be used to accurately describe these different situations, avoiding ignoring local detail differences due to the use of global features. Determining the grayscale features based on the local area grayscale co-occurrence matrix of each pixel point can generate a set of unique feature descriptions for each pixel point, characterizing the grayscale characteristics of the local area where the pixel point is located from multiple dimensions, and providing accurate data support for subsequent analysis and decision-making. By comparing the grayscale features of each pixel point with the preset grayscale features, key pixels can be screened out. By highlighting these key pixels, the amount of data can be effectively reduced while retaining the most representative and discriminative information in the image, thereby optimizing the processing flow and improving processing efficiency.

[0048] Furthermore, the present invention facilitates a more detailed analysis of image edges by dividing the edge areas of the intermediate grayscale image and its neighboring images into several edge sub-regions. Different edge regions may have different characteristics and importance. Through this division, each small region can be processed separately to avoid ignoring local details due to overall processing. Based on the grayscale values of the pixels in each edge sub-region, the corresponding grayscale vector is determined, and the grayscale information of each edge sub-region is quantified. Through this quantization method, the characteristics of different edge sub-regions can be more conveniently compared and analyzed, providing a data basis for subsequent matching and key area determination. 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, reduces the complexity of data processing, and retains key grayscale features. Determining the vector matching value based on each grayscale vector and using this to determine the key edge sub-region helps to extract the most representative and important areas from the numerous edge sub-regions, thereby improving the accuracy of splicing. By determining the key edge sub-regions, subsequent image processing resources can be concentrated on these important areas, avoiding indiscriminate processing of all edge sub-regions, thereby optimizing the entire image processing process and improving processing efficiency. At the same time, the determination of key edge sub-regions also helps reduce the interference of noise and irrelevant information on image processing results, and improves the accuracy of image stitching.

[0049] Furthermore, the present invention quantifies the texture characteristics of the stitching area from multiple angles through the stitching grayscale features determined based on the stitching grayscale co-occurrence matrix. The grayscale value change curve reflects the change in the grayscale value of the stitching part of the pre-stitched image. Based on the stitching grayscale features and the characteristic grayscale values, it is determined whether it meets the preset standards, thereby realizing a comprehensive evaluation of the stitching part of the pre-stitched image. The stitching grayscale features provide an overall evaluation from a macro texture perspective, while the characteristic grayscale values supplement it from the micro grayscale change details. This multi-dimensional evaluation method is more comprehensive and accurate, and can accurately judge whether the stitching part reaches the expected quality level, which helps to ensure the consistency and reliability of the image processing results, thereby more accurately measuring the quality of image stitching. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 This is a flowchart of an image region stitching method based on a gray-level co-occurrence matrix according to an embodiment of the present invention;

[0051] Figure 2 A schematic diagram of a process for determining an image matching value according to an embodiment of the present invention;

[0052] Figure 3 A schematic diagram of a process for determining key pixels according to an embodiment of the present invention;

[0053] Figure 4 The figure is a schematic diagram of a process for determining key edge sub-regions according to an embodiment of the present invention. DETAILED DESCRIPTION

[0054] In order to make the objects and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are merely used to explain the present invention and are not intended to limit the present invention.

[0055] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.

[0056] See also Figure 1 As shown, it is a flow chart of an image region stitching method based on a gray level co-occurrence matrix according to an embodiment of the present invention. An embodiment of the present invention provides an image region stitching method based on a gray level co-occurrence matrix, comprising:

[0057] 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;

[0058] In implementation, a neighborhood image of each grayscale image is determined, and an image important region of each grayscale image is determined based on significant features in each grayscale image and its neighborhood image.

[0059] It can be understood that the important image region is the region in the grayscale image that contains significant features. The significant features can be the characteristics of the common image content of the grayscale image and its neighboring images. The area of the important image region is smaller than the area of the grayscale image. Generally, the number of neighboring images of a grayscale image is consistent with the number of important image regions. Each grayscale image has at least one neighboring image, so each grayscale image contains at least one important image region.

[0060] It is understandable that those skilled in the art know that any method in the prior art that can determine the neighborhood image of a grayscale image and the method for determining important areas of an image, for example, based on edge detection and contour extraction, region growing, target detection, etc., all fall within the scope of protection of the present invention and will not be repeated here.

[0061] Step S2, constructing a gray level co-occurrence matrix for each important area of the image, and determining an image matching value based on each gray level co-occurrence matrix;

[0062] It is understood that the method of constructing a gray-level co-occurrence matrix is a prior art and will not be described in detail here. The gray-level co-occurrence matrix has a good stitching effect in low-texture areas without obvious corners or edges. In addition, the gray-level co-occurrence matrix can be used to optimize the fusion of overlapping areas (edges) of the stitched images where texture discontinuities occur.

[0063] See also Figure 2 , which is a schematic diagram of a process for determining an image matching value according to an embodiment of the present invention; specifically, in step S2, determining the image matching value includes:

[0064] 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;

[0065] 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.

[0066] In implementation, grayscale features include contrast, correlation, energy, entropy, homogeneity, etc. Contrast reflects the degree of difference in grayscale values in an image. The larger the value, the clearer the texture of the image and the more drastic the grayscale change. Correlation is used to measure the linear correlation of grayscale values in an image, reflecting the direction and regularity of the image texture. Energy reflects the uniformity of the grayscale distribution of the image and the coarseness of the texture. The larger the energy value, the more regular and uniform the texture of the image. 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. Homogeneity describes the degree of similarity of the grayscale values of adjacent pixels in an image. The larger the value, the smoother the texture of the image and the closer the grayscale values. The determination methods are all existing technologies and will not be elaborated here.

[0067] It is understandable that the image matching value can be determined based on 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 based on the number of neighborhood images of the grayscale image.

[0068] In a specific embodiment, the neighborhood images of the grayscale image A are grayscale image B and grayscale image C, and the grayscale features of the grayscale image A are A1, A2, ..., A j ,…,A m , the grayscale features of the grayscale image B are B1, B2, ..., B j ,…,B m , the grayscale features of the grayscale image C are C1, C2, ..., C j ,…,C m , j = 1, 2, ..., m; m is the number of grayscale features, then the feature contrast value AB between grayscale image A and grayscale image B = sqrt(∑ m j=1 (A j -B j ) 2 ), the characteristic contrast value AC between the grayscale image A and the grayscale image C = sqrt(∑ m j=1 (A j -C j ) 2 ), sqrt() is the preset square root determination function, then the image matching value corresponding to the grayscale image A is

[0069] The grayscale features determined by the grayscale co-occurrence matrix in the present invention can effectively capture the detailed features of the image. The feature comparison values between the grayscale images are calculated based on the grayscale features, which can reflect the feature differences between the grayscale images. The image matching values are determined by the feature comparison values, which can ensure the reliability of image matching and thus improve the accuracy of image stitching.

[0070] 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;

[0071] Specifically, step S3 includes:

[0072] Step S31, comparing the feature comparison values of the grayscale images, and determining a basic grayscale image based on the comparison results;

[0073] Step S32: performing image correction 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 image are all greater than the preset comparison threshold, this grayscale image is determined as the basic grayscale image, and the correction coefficient between the basic grayscale image and each grayscale image is determined based on the image matching value between the basic grayscale image and each grayscale image, and the grayscale transformation and scale transformation are performed on each grayscale image according to the correction coefficient.

[0075] It is understandable 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 value of the grayscale image that has passed the qualification test in the historical data. Preferably, the preset comparison threshold value is set to a range of 0.75 to 0.85.

[0076] This method determines a base grayscale image by comparing the feature comparison values of each grayscale image. This serves as a reference standard for subsequent processing, making subsequent image correction more efficient and accurate. Image correction is performed on each grayscale image based on the base grayscale image and the image matching value, minimizing differences between grayscale images. This provides a basis for subsequent image stitching or alignment, reduces interference, and improves image stitching quality.

[0077] 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 neighboring images;

[0078] It can be understood that the image important areas of the intermediate grayscale images are re-determined, and the image features of the image important areas corresponding to each intermediate grayscale image are obtained. The image features include geometric parameters (area, perimeter, diameter, etc.), spatial relationships (position relationship, distance relationship, topological relationship, etc.) and contour features (curvature of the contour, inflection point, etc.).

[0079] Specifically, the step S4 includes:

[0080] 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 results.

[0081] In a specific embodiment, the image features ZD1, ZD2, ..., ZD i ,…,ZD n , standard image features BD1, BD2,…, BD i ,…,BD n , the image features LD1, LD2, ..., LD of the neighborhood image corresponding to the intermediate grayscale image i ,…,LD nWherein, i=1, 2, ..., n, n is the number of image features, and the first image comparison value YT=(∑ n i=1 ZD i ×BD i ) / (sqrt(∑ n i=1 (ZD i ) 2 )×sqrt(∑ n i=1 (BD i ) 2 )), determine the second image comparison value 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 is understandable that the actual implementation personnel can set the standard image feature according to the actual situation of the specific content in each image.

[0082] 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:

[0083] Determining key pixels based on pixel points in edge areas of the intermediate grayscale image and its neighboring images, and adjusting the edge area of the intermediate grayscale image based on the key pixels;

[0084] Alternatively, dividing the edge regions of the intermediate grayscale image and its neighboring images into regions, determining key edge subregions, and performing edge region processing on the key edge subregions;

[0085] Specifically, the step S5 includes:

[0086] 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,

[0087] If the image characteristic value is less than a first preset image characteristic value, key pixels are determined based on pixel points in edge areas of the intermediate grayscale image and its neighboring images, and the edge area of the intermediate grayscale image is adjusted based on the key pixels;

[0088] If the image characteristic value is greater than a second preset image characteristic value, the edge area of the intermediate grayscale image and its neighboring image is divided into regions, key edge sub-regions are determined, and edge region processing is performed on the key edge sub-regions.

[0089] It can be understood that the smaller the image eigenvalue corresponding to the intermediate grayscale image, the greater the difference between the important image areas of the intermediate grayscale image and its neighboring images, and the possibility of missing image content in the edge areas. The larger the image eigenvalue corresponding to the intermediate grayscale image, the smaller the difference between the important image areas of the intermediate grayscale image and its neighboring images, and the possibility of redundant content in the edge areas. Therefore, if the image eigenvalue is less than the first preset image eigenvalue, image supplementation is performed on the edge areas of the intermediate grayscale image. If the image eigenvalue is greater than the second preset image eigenvalue, redundant points are removed from the edge areas of the intermediate grayscale image.

[0090] It is understandable 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 for 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] See also Figure 3 , which is a schematic diagram of a process for determining key pixels according to an embodiment of the present invention; specifically, in step S5, determining key pixels includes:

[0092] Step S51, traversing the edge area pixels of each intermediate grayscale image, and constructing a local area grayscale co-occurrence matrix corresponding to each pixel;

[0093] 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;

[0094] Step S53 : determining key pixels based on a comparison result between the grayscale feature corresponding to each pixel and a preset grayscale feature.

[0095] In practice, an edge detection algorithm is used to detect the edge regions of each intermediate grayscale image. This is a prior art technique and will not be described in detail here. The local region corresponding to each pixel is a rectangular or square region centered on the pixel, for example, 5×5, 7×7, etc. For each local region of an edge pixel, a corresponding grayscale co-occurrence matrix is constructed. Taking a 5×5 local region as an example, assuming the grayscale level is 8, that is, the grayscale 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 pairs in the local region are traversed. If, in the given direction and distance, the grayscale value of one pixel is p and the grayscale value of the other pixel is q, then the element value in the pth row and qth column of the grayscale co-occurrence matrix is increased by 1. After counting all pixel pairs in the local region, the grayscale co-occurrence matrix is normalized. Each element in the matrix is divided by the sum of all elements in the matrix to obtain a normalized grayscale co-occurrence matrix, so that the sum of its element values is 1.

[0096] It is understood that the actual implementation personnel can set the preset grayscale features according to the specific application scenario and image characteristics. For example, in the target detection task, if it is known that the texture features of the edge of the target object have high contrast and 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 the appropriate preset grayscale features. For example, the average and standard deviation of the grayscale features of the edge pixels of the target area in a set of training images can be calculated and used as the preset grayscale features. The grayscale features corresponding to each pixel are compared with the preset grayscale features, and the pixels that meet the preset conditions are determined as key pixels. The actual implementation personnel can set the preset conditions according to the specific application scenario and image characteristics, for example: whether the contrast is greater than the preset contrast threshold, and whether the entropy is less than the preset entropy threshold. If the contrast of a pixel is greater than the preset contrast threshold and the entropy is less than the preset entropy threshold, then the preset conditions are met.

[0097] The present invention can capture the texture features of each local position at the edge of the image by constructing a local area grayscale co-occurrence matrix corresponding to each pixel point. The features of the edge area of the image may vary greatly at different positions. By constructing a local matrix for each pixel point, the processing process can adapt to these local changes. Pixels in different areas may be in different texture structures or object edges. The local matrix can be used to accurately describe these different situations, avoiding ignoring local detail differences due to the use of global features. Based on the local area grayscale co-occurrence matrix of each pixel point, the grayscale features are determined, and a set of unique feature descriptions can be generated for each pixel point. The grayscale characteristics of the local area where the pixel point is located are characterized from multiple dimensions, providing accurate data support for subsequent analysis and decision-making. By comparing the grayscale features of each pixel point with the preset grayscale features, key pixels can be screened out. By highlighting these key pixels, the amount of data can be effectively reduced while retaining the most representative and discriminative information in the image, thereby optimizing the processing flow and improving processing efficiency.

[0098] Specifically, in step S5, adjusting the edge area of the intermediate grayscale image based on key pixels includes:

[0099] Step S54, inputting the grayscale value corresponding to the key pixel point into the target neural network model to obtain a plurality of supplementary pixel points output by the target neural network model;

[0100] Step S55 : adjusting the edge area of the intermediate grayscale image based on the supplementary pixel points.

[0101] In implementation, training samples are determined based on the key pixel points in the edge area of the image for image supplementation in historical data and the corresponding supplementary pixel points, and the initial neural network model is trained based on the training samples to obtain the target neural network model. Those skilled in the art know that any neural network model in the prior art that can determine the supplementary pixel points falls within the scope of protection of the present invention and will not be repeated here.

[0102] It is understandable that by supplementing the edge area with additional pixels, obvious seams in the stitched image can be avoided, thereby improving the stitching effect.

[0103] Specifically, in step S5, determining the key edge sub-regions includes:

[0104] Step S56, dividing the edge regions of the intermediate grayscale image and its neighboring images into regions to obtain a plurality of edge subregions;

[0105] Step S57, determining a corresponding grayscale vector based on the grayscale values of the pixels in each edge sub-region;

[0106] 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.

[0107] In the implementation, the edge areas of the intermediate grayscale image and its neighboring images are divided into regions to obtain a number of edge sub-regions, wherein the corresponding grayscale vectors are determined after the frequency of the pixel grayscale values in the several edge sub-regions corresponding to the intermediate grayscale image is counted, and the corresponding neighboring grayscale vectors are determined after the frequency of the pixel grayscale values in the several edge sub-regions corresponding to the neighboring images of the intermediate grayscale image is counted, and the vector matching values between each grayscale vector and each neighboring grayscale vector are determined respectively. If there is a vector matching value greater than a preset matching value, the corresponding edge sub-region is determined as a key edge sub-region. For example, taking an edge sub-region of the intermediate grayscale image and an edge sub-region of its neighboring image as an example, the grayscale vectors HX1, HX2, ..., HX g ,…,HX h , neighborhood grayscale vector LX1, LX2, ..., 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 )), g=1, 2, …, h; HX g is the frequency of occurrence of the gray value of the g-th pixel in the edge sub-region of the intermediate gray image, LX g is the frequency of occurrence 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 is understandable that the actual implementer can set the preset matching value according to the actual situation. Preferably, the preset matching value is set in the range of 0.8 to 0.9.

[0109] The present invention helps to perform a more detailed analysis of the image edge by dividing the edge area of the intermediate grayscale image and its neighboring images into several edge sub-regions. Different edge regions may have different characteristics and importance. Through this division, each small region can be processed separately to avoid ignoring local details due to overall processing. Based on the grayscale value of the pixels in each edge sub-region, the corresponding grayscale vector is determined, and the grayscale information of each edge sub-region is quantified. Through this quantization method, the characteristics of different edge sub-regions can be more conveniently compared and analyzed, providing a data basis for subsequent matching and key area determination. 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, reduces the complexity of data processing, and retains key grayscale features. Determining the vector matching value based on each grayscale vector and using this to determine the key edge sub-region helps to extract the most representative and important areas from a large number of edge sub-regions, thereby improving the accuracy of splicing. By determining the key edge sub-regions, subsequent image processing resources can be concentrated on these important areas, avoiding indiscriminate processing of all edge sub-regions, thereby optimizing the entire image processing process and improving processing efficiency. At the same time, the determination of key edge sub-regions also helps reduce the interference of noise and irrelevant information on image processing results, and improves the accuracy of image stitching.

[0110] Specifically, in step S5, edge region processing is performed on the key edge sub-regions, including:

[0111] Redundant grayscale values are determined based on the grayscale values of pixels in the key edge sub-region, redundant pixel points are determined according to the distribution of pixel points corresponding to the redundant grayscale values in the edge region of the intermediate grayscale image, and the redundant pixel points in the edge region of the intermediate grayscale image are removed.

[0112] During implementation, the grayscale value of the pixel with the highest frequency of occurrence within the key edge sub-region is determined as the redundant grayscale value. If the number of pixels corresponding to the redundant grayscale value within a preset range is greater than a preset threshold, the pixels corresponding to the redundant grayscale value within the preset range are determined as redundant pixels. It is understood that the actual implementation personnel can set the preset range based on actual conditions and the preset threshold based on the size of the preset range. The preset threshold can be set to 2 / 5 to 3 / 5 of the number of pixels within the preset range. Preferably, the preset range is set to 5×5, and the preset threshold is set to 10 to 15.

[0113] 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.

[0114] See also Figure 4 , which is a schematic diagram of a process for determining key edge sub-regions according to an embodiment of the present invention; specifically, in step S6, it includes:

[0115] Step S61, constructing a splicing grayscale co-occurrence matrix of the spliced part of the pre-stitched image, and determining a splicing grayscale feature corresponding to the pre-stitched image;

[0116] Step S62, determining a characteristic grayscale value based on a grayscale value variation curve of the spliced portion of the pre-spliced image;

[0117] 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.

[0118] During implementation, the grayscale value mutation area is determined based on the area on the grayscale change curve whose slope is greater than the preset slope threshold, the characteristic grayscale value is determined based on the grayscale value in the grayscale value mutation area, and the spliced grayscale feature is compared with the standard grayscale feature. If the preset conditions are met and the frequency of occurrence of the characteristic grayscale value is less than the preset frequency, it is determined that the spliced part of the spliced image meets the preset standard.

[0119] It is understandable that the actual implementer can set the preset frequency according to the actual image content and application scenario. Preferably, the preset frequency is set to a value range of 30 to 50.

[0120] The present invention quantifies the texture characteristics of the stitching area from multiple angles through the stitching grayscale features determined based on the stitching grayscale co-occurrence matrix. The grayscale value change curve reflects the change in the grayscale value of the stitching part of the pre-stitched image. Based on the stitching grayscale features and the characteristic grayscale values, it is determined whether it meets the preset standards, thereby realizing a comprehensive evaluation of the stitching part of the pre-stitched image. The stitching grayscale features provide an overall evaluation from a macro texture perspective, while the characteristic grayscale values supplement it from the micro grayscale change details. This multi-dimensional evaluation method is more comprehensive and accurate, and can accurately judge whether the stitching part reaches the expected quality level, which helps to ensure the consistency and reliability of the image processing results, thereby more accurately measuring the quality of image stitching.

[0121] Specifically, the present invention reduces data processing and improves processing efficiency by acquiring multiple grayscale images corresponding to multiple original images and determining the image-important regions of each grayscale image. By constructing a grayscale co-occurrence matrix for each image-important region to determine image matching values, and performing image correction based on the image matching values, the grayscale co-occurrence matrix effectively describes the spatial distribution relationship of grayscale pairs in an image. Using the grayscale co-occurrence matrix of the image-important regions of the grayscale images to determine image matching values allows for more accurate analysis of image matching between different images. Performing image correction based on the image matching values improves the accuracy and efficiency of subsequent image stitching. The image features of the intermediate grayscale image and its neighboring images can accurately locate the stitching region, providing data support for the subsequent determination of the image processing method for the intermediate grayscale image and improving data processing efficiency. By processing the edge regions of the intermediate grayscale images using two image processing methods, images can be precisely aligned, reducing stitching artifacts, making transitions between images smoother, and improving stitching accuracy. By determining whether the stitched portions of the pre-stitched images meet preset standards, the accuracy and efficiency of image stitching can be further improved.

[0122] Thus far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art may make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will fall within the scope of protection 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 for 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 neighboring 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: Determining key pixels based on pixel points in edge areas of the intermediate grayscale image and its neighboring images, and adjusting the edge area of the intermediate grayscale image based on the key pixels; Alternatively, dividing the edge regions of the intermediate grayscale image and its neighboring images into regions, determining key edge subregions, and performing edge region processing on the key edge subregions; 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 splicing 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 results; 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, 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 results.

5. The image region splicing method based on gray level co-occurrence matrix according to claim 4, characterized in that: In the step S5, it includes: 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, If the image characteristic value is less than a first preset image characteristic value, key pixels are determined based on pixel points in edge areas of the intermediate grayscale image and its neighboring images, and the edge area of the intermediate grayscale image is adjusted based on the key pixels; If the image characteristic value is greater than a second preset image characteristic value, the edge area of the intermediate grayscale image and its neighboring image is divided into regions, key edge sub-regions are determined, and edge region processing is performed on the key edge sub-regions.

6. The image region splicing method based on gray level co-occurrence matrix according to claim 5, characterized in that: In step S5, determining key pixels includes: Step S51, traversing the edge area pixels of each intermediate grayscale image, 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 a comparison result between the grayscale feature corresponding to each pixel and a preset grayscale feature.

7. The image region stitching method based on gray level co-occurrence matrix according to claim 6, characterized in that: In 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 plurality of supplementary pixel points output by the target neural network model; Step S55 : adjusting the edge area of the intermediate grayscale image based on the supplementary pixel points.

8. The image region splicing 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 subregions; Step S57, determining a corresponding grayscale vector based on the grayscale values of the 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 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-region, redundant pixel points are determined according to the distribution of pixel points corresponding to the redundant grayscale values in the edge region of the intermediate grayscale image, and the redundant pixel points in the edge region of the intermediate grayscale image are removed.

10. The image region splicing 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 spliced part of the pre-stitched image, and determining a splicing grayscale feature corresponding to the pre-stitched image; Step S62, determining a characteristic grayscale value based on a grayscale value variation curve of the spliced portion 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

  • Artificial intelligence object fragment image splicing method

    CN112419349A

  • Panoramic image splicing method based on optimal suture line

    CN112991176A