Image registration method and system, and computer equipment applicable to scenes without obvious structures
By combining histograms, thresholding and shape context descriptor matching in a non-visible structure scenario, the problems of image registration accuracy and computational complexity are solved, and an efficient and robust image registration effect is achieved.
Patent Information
- Application Number
- CN202210549898.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-20
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2042-05-20
AI Technical Summary
In the absence of obvious structural scenarios, the existing image registration algorithms have problems such as insufficient accuracy, complex calculations and long time consumption, making it difficult to achieve fast and accurate image registration.
By obtaining the sequence image, counting and merging the histogram, selecting the grayscale value as the threshold for thresholding, extracting the outline image, calculating the shape context descriptor for matching, obtaining the prediction registration parameters, and transforming and updating the histogram until Achieving stable parameters and realizing image registration.
This method achieves efficient and robust image registration in scenarios without obvious structure, reduces computational complexity, and is suitable for applications with high real-time requirements.
Smart Images

Figure CN114882080B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing and computer vision technology, and in particular to an image registration method and system, and a computer device suitable for scenes without obvious structures. Background Art
[0002] As cameras are continuously applied to motion platforms, various application developments and research based on image sequences have been promoted. Among them, image registration between sequence image frames is a basic problem. For example, tasks such as vision-based observation platform self-positioning, motion target detection, and image stitching all require the use of image registration methods to transform multiple inter-frame images into the same coordinate system. Fast and accurate registration is a basic problem in the field of image processing. Image registration algorithms are now very rich, but most algorithms implement image registration in scenes with obvious structures. The obvious structures here refer to artificial buildings such as roads, bridges, and buildings. However, there are still many scenes without obvious structures, such as images taken in mountains, deserts, woodlands, Gobi, coasts, and other scenes. As shown in the attached figure Figure 3 and 4 As shown, Figure 3 For scenes with obvious structures, there are geometric features that are easy to extract, such as the corners of houses and the lines of roads. Figure 4 There are relatively few structural features in the scene, and achieving accurate and efficient image registration in this scenario remains a challenging problem.
[0003] At present, image registration methods are mainly divided into two categories: feature-based methods and regional grayscale-based methods. Among them, feature-based methods need to extract features from the image for matching, but there are two problems in images without obvious structural scenes: (1) The extracted features are very few, and the image lacks structural texture features, which makes it difficult to extract a sufficient number of geometric features in the image; (2) The similarity between features is high, making it difficult to achieve accurate feature matching. Grayscale-based image registration methods have problems such as complex calculations and long time consumption, and are difficult to meet the needs of applications with high real-time requirements. Summary of the invention
[0004] The present invention provides an image registration method and system, and a computer device applicable to scenes without obvious structures, which are used to overcome the defects of the prior art in image registration of scenes without obvious structures, such as insufficient accuracy, complex calculation, and long time consumption.
[0005] To achieve the above object, the present invention proposes an image registration method suitable for scenes without obvious structures, comprising the following steps:
[0006] 101: Acquire a sequence of images; use the image at the current moment as a reference image and the image at the next moment as an image to be registered;
[0007] 102: Counting the histograms of the reference image and the image to be registered respectively, and merging the histograms of the two images to obtain a merged histogram;
[0008] 103: Selecting a gray value in the middle of the value in the merged histogram as a threshold, performing threshold processing on the reference image and the image to be registered to obtain two binary images, and extracting contour images from the two binary images respectively;
[0009] 104: uniformly sampling the two contour images respectively to obtain contour point sets of the two contour images, respectively calculating shape context descriptors of the two contour point sets, performing matching calculation of the sampling points according to the shape context descriptors, and obtaining predicted registration parameters of the image to be registered;
[0010] 105: Performing a projective transformation on the image to be registered according to the predicted registration parameters to obtain a transformed image; comparing the transformed image with the image to be registered, updating the merged histogram according to the comparison result, and returning to step 103 until the change in the obtained predicted registration parameter value is less than the set value, obtaining the registration parameters of the image to be registered, and registering the image to be registered with the reference image according to the registration parameters.
[0011] To achieve the above object, the present invention further proposes an image registration system suitable for scenes without obvious structures, comprising:
[0012] An image acquisition module is used to acquire a sequence of images; the image at the current moment is used as a reference image, and the image at the next moment is used as an image to be registered;
[0013] The image processing module is used to perform the following steps:
[0014] 102: Counting the histograms of the reference image and the image to be registered respectively, and merging the histograms of the two images to obtain a merged histogram;
[0015] 103: Selecting a gray value in the middle of the value in the merged histogram as a threshold, performing threshold processing on the reference image and the image to be registered to obtain two binary images, and extracting contour images from the two binary images respectively;
[0016] 104: uniformly sampling the two contour images respectively to obtain contour point sets of the two contour images, respectively calculating shape context descriptors of the two contour point sets, performing matching calculation of the sampling points according to the shape context descriptors, and obtaining predicted registration parameters of the image to be registered;
[0017] 105: Performing a projective transformation on the image to be registered according to the predicted registration parameters to obtain a transformed image; comparing the transformed image with the image to be registered, updating the merged histogram according to the comparison result, and returning to step 103 until the change in the obtained predicted registration parameter value is less than the set value, obtaining the registration parameters of the image to be registered, and registering the image to be registered with the reference image according to the registration parameters.
[0018] To achieve the above objective, the present invention further proposes a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0019] To achieve the above object, the present invention further proposes a computer-readable storage medium on which a computer program is stored, and the computer program implements the steps of the above method when executed by a processor.
[0020] Compared with the prior art, the present invention has the following beneficial effects:
[0021] The image registration method provided by the present invention, which is applicable to scenes without obvious structures, first merges the histogram of the reference image and the image to be registered, selects a specific grayscale value in the histogram using the camera imaging characteristics, thresholds the image to be registered using the grayscale value, and calculates the registration parameters of the transformation model in the image registration based on the contour features in the binary image. The method provided by the present invention is based on the characteristic that the relative relationship of grayscales in different areas in real scene imaging remains unchanged, selects the grayscale values of the same name of the image to be registered through the histogram, and obtains the self-generated contour features by thresholding, thereby realizing the registration of scenes without obvious structural features. The method provided by the present invention has no requirements for the texture information of the image to be registered, and has the advantages of good robustness and high computational efficiency, and can be applied to various tasks requiring image registration. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0023] Figure 1 A flow chart of the image registration method applicable to scenes without obvious structures provided by the present invention;
[0024] Figure 2 A schematic diagram of the image registration method provided by the present invention that is applicable to scenes without obvious structures;
[0025] Figure 3 It is a scene graph with obvious structure;
[0026] Figure 4 It is a scene graph without obvious structure.
[0027] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0029] In addition, the technical solutions between the various embodiments of the present invention can be combined with each other, but it must be based on the fact that ordinary technicians in the field can implement it. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0030] The present invention proposes an image registration method suitable for scenes without obvious structures, such as Figure 1 and 2 As shown, the following steps are included:
[0031] 101: Acquire a sequence of images; use the image at the current moment as a reference image and the image at the next moment as an image to be registered;
[0032] 102: Counting the histograms of the reference image and the image to be registered respectively, and merging the histograms of the two images to obtain a merged histogram;
[0033] 103: Selecting the gray value in the middle of the value in the merged histogram as a threshold, performing threshold processing on the reference image and the image to be registered to obtain two binary images, and extracting contour images from the two binary images respectively;
[0034] 104: uniformly sampling the two contour images respectively to obtain contour point sets of the two contour images, respectively calculating shape context descriptors of the two contour point sets, performing matching calculation of the sampling points according to the shape context descriptors, and obtaining predicted registration parameters of the image to be registered;
[0035] 105: Performing a projective transformation on the image to be registered according to the predicted registration parameters to obtain a transformed image; comparing the transformed image with the image to be registered, updating the merged histogram according to the comparison result, and returning to step 103 until the change in the obtained predicted registration parameter value is less than the set value, obtaining the registration parameters of the image to be registered, and registering the image to be registered with the reference image according to the registration parameters.
[0036] In one embodiment, for step 102, the histograms of the two images are merged to obtain a merged histogram, including:
[0037] 201: Calculating the increase of each gray level in the histogram of the image to be registered according to the histograms of the reference image and the image to be registered;
[0038] 202: Merging the histograms of the reference image and the image to be registered according to the increase of each gray level to obtain a merged histogram.
[0039] In a certain embodiment, based on the histograms of the reference image and the image to be registered, the increase of each gray level in the histogram of the image to be registered is calculated.
[0040] H inc (i) = max(H t+1 (i)-H t (i),0)(i=0…255)
[0041] In the formula, H inc is the increase of each gray level; H t is the histogram of the reference image; H t+1 is the histogram of the image to be registered; i is the gray level of the image pixel;
[0042] According to the increase of each gray level, the histograms of the reference image and the image to be registered are merged to obtain a merged histogram.
[0043] H combine (i) = H t (i)+H inc (i)(i=0…255)
[0044] In the formula, H combine The merged histogram.
[0045] In the next embodiment, for step 103, the gray value in the middle of the value in the merged histogram is selected as a threshold, the reference image and the image to be registered are respectively subjected to threshold processing to obtain two binary images, and contour images in the two binary images are respectively extracted, including:
[0046] 301: Selecting the gray value in the middle of the numerical value in the merged histogram as a threshold (i.e., according to the middle pixel from dark to bright), and performing thresholding processing on the reference image and the image to be registered to obtain two binary images,
[0047]
[0048] In the formula, B t (i) is the binary image of the reference image; B t+1 (i) is the binary image of the image to be registered; t (i) and I t+1 (i) The reference image and the image to be registered respectively; g r is the threshold value;
[0049] 302: According to the two binary images, use high-pass filtering to extract contour images E in the two binary images respectively. t and E t+1 .
[0050] In another embodiment, for step 104, uniform sampling is performed on the two contour images to obtain contour point sets of the two contour images, and shape context descriptors of the two contour point sets are calculated to obtain shape context descriptors of the two contour point sets, including:
[0051] In the two contour images E t and E t+1 Uniform sampling is performed on the contour point set P of the two contour images to obtain t and P t+1 ;
[0052] Using the method in the paper "Shape Context: A New Descriptor for Shape Matching and Object Recognition" (published in "Proceedings of the 13th International Conference on Neural Information Processing Systems" in 2000), the shape context descriptors G of the two contour point sets are calculated respectively. t and G t+1 .
[0053] Performing matching calculation of sampling points according to the shape context descriptor to obtain predicted registration parameters of the image to be registered includes:
[0054] Calculating the similarity between two contour point sets according to the shape context descriptor;
[0055] According to the similarity, the initial point pair is obtained by using a two-way matching method, and then the predicted registration parameters of the image to be registered are calculated using the RANSAC algorithm.
[0056] In a certain embodiment, performing matching calculation of sampling points according to the shape context descriptor to obtain predicted registration parameters includes:
[0057] According to the shape context descriptor, the similarity of all matching point pairs is calculated.
[0058]
[0059] Where S(m,n) is the similarity between the shape context descriptors of two contour point sets; is the shape context descriptor of the reference image contour point set; is the shape context descriptor of the contour point set of the image to be registered; k is the dimension of the shape context descriptor;
[0060] According to the maximum similarity principle, the sampling point with the greatest similarity to each sampling point in the reference image contour point set is found in the contour point set of the image to be registered to form a set of matching point pairs;
[0061] According to the set of matching point pairs, the predicted registration parameters of the image to be registered are calculated using the RANSAC algorithm.
[0062] According to the set of matching point pairs, the selected registration model is used, and the calculated registration model is used to reproject the remaining points in the contour point set of the image to be registered, and the number of correct matches is counted. The above process is iterated, and the registration parameter with the largest number of correct matching point pairs is the predicted registration parameter.
[0063] In the next embodiment, for step 105, projecting the image to be registered is transformed according to the predicted registration parameters to obtain a transformed image; comparing the transformed image with the image to be registered, and updating the merged histogram according to the comparison result, including:
[0064] 501: According to the predicted registration parameter F t+1,t , transform the coordinates (x, y) of the image to be registered to the new coordinate position (x′, y′), and use the nearest neighbor interpolation to calculate the transformed image I of the projective transformation t ' +1 ,
[0065]
[0066] 502: Traverse Transformation Image I t ' +1For all pixels, find out the pixels whose coordinate position (x′, y′) is not in the coordinate range of the reference image, then add 1 to the gray level at the corresponding position of the histogram of the reference image to update the merged histogram.
[0067] The present invention also proposes an image registration system suitable for scenes without obvious structures, comprising:
[0068] An image acquisition module is used to acquire a sequence of images; the image at the current moment is used as a reference image, and the image at the next moment is used as an image to be registered;
[0069] The image processing module is used to perform the following steps:
[0070] 102: Counting the histograms of the reference image and the image to be registered respectively, and merging the histograms of the two images to obtain a merged histogram;
[0071] 103: Selecting a gray value in the middle of the value in the merged histogram as a threshold, performing threshold processing on the reference image and the image to be registered to obtain two binary images, and extracting contour images from the two binary images respectively;
[0072] 104: uniformly sampling the two contour images respectively to obtain contour point sets of the two contour images, respectively calculating shape context descriptors of the two contour point sets, performing matching calculation of the sampling points according to the shape context descriptors, and obtaining predicted registration parameters of the image to be registered;
[0073] 105: Performing a projective transformation on the image to be registered according to the predicted registration parameters to obtain a transformed image; comparing the transformed image with the image to be registered, updating the merged histogram according to the comparison result, and returning to step 103 until the change in the obtained predicted registration parameter value is less than the set value, obtaining the registration parameters of the image to be registered, and registering the image to be registered with the reference image according to the registration parameters.
[0074] The present invention further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0075] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented.
[0076] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the inventive concept of the present invention, or directly / indirectly applied in other related technical fields are included in the patent protection scope of the present invention.
Claims
1. An image registration method suitable for scenes without obvious structures, It is characterized in that The following steps are involved: 101: Acquire a sequence of images; use the image at the current moment as a reference image and the image at the next moment as an image to be registered; 102: Counting the histograms of the reference image and the image to be registered respectively, and merging the histograms of the two images to obtain a merged histogram; 103: Selecting a gray value in the middle of the value in the merged histogram as a threshold, performing threshold processing on the reference image and the image to be registered to obtain two binary images, and extracting contour images from the two binary images respectively; 104: uniformly sampling the two contour images respectively to obtain contour point sets of the two contour images, respectively calculating shape context descriptors of the two contour point sets, performing matching calculation of the sampling points according to the shape context descriptors, and obtaining predicted registration parameters of the image to be registered; 105: Performing a projective transformation on the image to be registered according to the predicted registration parameters to obtain a transformed image; comparing the transformed image with the image to be registered, updating the merged histogram according to the comparison result, and returning to step 103 until the change in the obtained predicted registration parameter value is less than the set value, obtaining the registration parameters of the image to be registered, and registering the image to be registered with the reference image according to the registration parameters.
2. The image registration method according to claim 1, It is characterized in that The histograms of the two images are merged to obtain a merged histogram, including: According to the histograms of the reference image and the image to be registered, the increase of each gray level in the histogram of the image to be registered is calculated; According to the increase of each gray level, the histograms of the reference image and the image to be registered are merged to obtain a merged histogram.
3. The image registration method according to claim 2, It is characterized in that According to the histograms of the reference image and the image to be registered, the increase of each gray level in the histogram of the image to be registered is calculated. H inc (i)=max(H t+1 (i)-H t (i),0) (i=0…255) In the formula, H inc is the increase of each gray level; H t is the histogram of the reference image; H t+1 is the histogram of the image to be registered; i is the gray level of the image pixel; According to the increase of each gray level, the histograms of the reference image and the image to be registered are merged to obtain a merged histogram. H combine (i)=H t (i)+H inc (i) (i=0…255) In the formula, H combine The merged histogram.
4. The image registration method according to claim 1, It is characterized in that Selecting the gray value in the middle of the value in the merged histogram as a threshold, performing threshold processing on the reference image and the image to be registered to obtain two binary images, respectively extracting contour images in the two binary images, including: The gray value in the middle of the value in the merged histogram is selected as a threshold, and threshold processing is performed on the reference image and the image to be registered to obtain two binary images. In the formula, B t (i) is the binary image of the reference image; B t+1 (i) is the binary image of the image to be registered; t (i) and I t+1 (i) The reference image and the image to be registered respectively; g r is the threshold value; According to the two binary images, contour images in the two binary images are respectively extracted by high-pass filtering.
5. The image registration method according to claim 1, It is characterized in that Performing matching calculation of sampling points according to the shape context descriptor to obtain predicted registration parameters of the image to be registered includes: Calculating the similarity between two contour point sets according to the shape context descriptor; According to the similarity, the initial point pair is obtained by using a two-way matching method, and then the predicted registration parameters of the image to be registered are calculated using the RANSAC algorithm.
6. The image registration method according to claim 5, It is characterized in that Performing matching calculation of sampling points according to the shape context descriptor to obtain predicted registration parameters includes: Pairing all sampling points in the two contour point sets in pairs to form matching point pairs; According to the shape context descriptor, the similarity of all matching point pairs is calculated. Where S(m,n) is the similarity between the shape context descriptors of two contour point sets; is the shape context descriptor of the reference image contour point set; is the shape context descriptor of the contour point set of the image to be registered; k is the dimension of the shape context descriptor; According to the maximum similarity principle, the sampling point with the greatest similarity to each sampling point in the reference image contour point set is found in the contour point set of the image to be registered to form a set of matching point pairs; According to the set of matching point pairs, the registration parameters of the image to be registered are calculated using the RANSAC algorithm.
7. The image registration method according to claim 1, It is characterized in that Performing a projection transformation on the image to be registered according to the predicted registration parameters to obtain a transformed image; Comparing the transformed image with the image to be registered, and updating the merged histogram according to the comparison result, comprising: According to the predicted registration parameter F t+1,t , transform the coordinates (x, y) of the image to be registered to the new coordinate position (x′, y′), and use the nearest neighbor interpolation to calculate the transformed image I′ of the projective transformation t+1 , Traverse the transformed image I′ t+1 For all pixels, find out the pixels whose coordinate position (x′, y′) is not in the coordinate range of the reference image, then add 1 to the gray level at the corresponding position of the histogram of the reference image to update the merged histogram.
8. An image registration system suitable for scenes without obvious structures, It is characterized in that include: An image acquisition module is used to acquire a sequence of images; the image at the current moment is used as a reference image, and the image at the next moment is used as an image to be registered; The image processing module is used to perform the following steps: 102: Counting the histograms of the reference image and the image to be registered respectively, and merging the histograms of the two images to obtain a merged histogram; 103: Selecting a gray value in the middle of the value in the merged histogram as a threshold, performing threshold processing on the reference image and the image to be registered to obtain two binary images, and extracting contour images from the two binary images respectively; 104: uniformly sampling the two contour images respectively to obtain contour point sets of the two contour images, respectively calculating shape context descriptors of the two contour point sets, performing matching calculation of the sampling points according to the shape context descriptors, and obtaining predicted registration parameters of the image to be registered; 105: Performing a projective transformation on the image to be registered according to the predicted registration parameters to obtain a transformed image; comparing the transformed image with the image to be registered, updating the merged histogram according to the comparison result, and returning to step 103 until the change in the obtained predicted registration parameter value is less than the set value, obtaining the registration parameters of the image to be registered, and registering the image to be registered with the reference image according to the registration parameters.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
