Image matching method and device, electronic device and storage medium
By using neighborhood detection box technology, the limitations of threshold segmentation and template matching in existing image matching methods are overcome, achieving stable and fast image feature matching, simplifying computation and improving matching accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHAN MGI TECH CO LTD
- Filing Date
- 2024-12-16
- Publication Date
- 2026-06-16
AI Technical Summary
Existing image matching methods have limitations when using threshold segmentation and template matching, especially when the grayscale histogram has no bimodal peaks, the local adaptive thresholding is not effective, template matching is sensitive to noise, and matching failures are caused by scale differences.
The neighborhood detection box technique is adopted to generate a neighborhood detection box by acquiring the shape and size information of the target image. The box is then slidably matched in the image to be detected, and the contour and background brightness values are calculated to determine the similarity. The rotation angle is adjusted to improve the matching accuracy.
Stable and fast image feature matching was achieved, simplifying the computation and improving the accuracy and robustness of the matching.
Smart Images

Figure CN122223366A_ABST
Abstract
Claims
1. A method for image matching, characterized in that, include: Obtain the shape and size information of the target image, wherein the image to be detected contains the target image, and the target image contains a first region and a second region contained within the first region; A corresponding neighborhood detection box is generated based on the shape and size information of the target image, wherein the size of the neighborhood detection box is larger than the size of the target image; The neighborhood detection box is used to match the corresponding target image in the image to be detected.
2. The method according to claim 1, characterized in that, The step of generating a corresponding neighborhood detection box based on the shape and size information of the target image includes: Determine the center coordinates and radius of the target image; The neighborhood detection box is generated based on the center coordinates and the radius.
3. The method according to claim 1, characterized in that, The step of matching the corresponding target image in the image to be detected based on the neighborhood detection box includes: The neighborhood detection box is controlled to slide in the image to be detected, and the similarity value calculated at each slide is obtained. The similarity value is used to characterize the similarity with the target image. After traversing all the images to be detected, the target image is determined based on the region corresponding to the maximum similarity.
4. The method according to claim 3, characterized in that, The process of obtaining the similarity value calculated for each swipe includes: Calculate the first brightness value corresponding to the contour region, where the contour region is the boundary region enclosed by the first region and the second region; Calculate the second brightness value corresponding to the background region, where the background region is the background region enclosed by the first region and the neighborhood detection box; The similarity value is calculated based on the first brightness value and the second brightness value.
5. The method according to claim 4, characterized in that, The step of calculating the similarity value based on the first brightness value and the second brightness value includes: The similarity value is calculated using the following formulas, including: score=(S1-S2) / (S0-S1+α) Wherein, S0 is the brightness value corresponding to the neighborhood detection box, S1 is the brightness value corresponding to the first region, S2 is the brightness value corresponding to the second region, and α is a constant not equal to 0.
6. The method according to claim 1, characterized in that, Before matching the corresponding target image in the image to be detected based on the neighborhood detection box, the method further includes: Determine whether the image to be detected has a rotation angle greater than a preset rotation threshold; If there is a rotation angle greater than the preset rotation threshold, then the rotation angle of the image to be detected is determined. The image to be detected is corrected based on the rotation angle, wherein the rotation angle of the image to be detected is less than or equal to the preset rotation threshold.
7. The method according to claim 6, characterized in that, The step of correcting the image to be detected based on the rotation angle includes: Determine the corrected rotation direction and preset rotation size of the image to be detected, and correct the image to be detected accordingly; Alternatively, determine the linear rotation angle of the image to be detected and correct the image to be detected.
8. An image matching apparatus, characterized in that, include: An acquisition unit is used to acquire shape and size information of a target image, wherein the image to be detected contains the target image, and the target image contains a first region and a second region contained within the first region; The generation unit is used to generate a corresponding neighborhood detection box based on the shape and size information of the target image, wherein the size of the neighborhood detection box is larger than the size of the target image; The first determining unit is used to match the corresponding target image in the image to be detected based on the neighborhood detection box.
9. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-7.
11. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method according to any one of claims 1-7.