CN-115063614-B - Image matching method and device and electronic equipment
Abstract
The application provides an image matching method, an image matching device and electronic equipment, wherein the method comprises the steps of determining a second candidate edge image on an image to be detected corresponding to a template image based on the first edge image on the template image, obtaining a binarization image corresponding to the second candidate edge image and a saliency binary image corresponding to the second candidate edge image, and determining a target edge image corresponding to the first edge image based on the binarization image and the saliency binary image. The image matching method provided by the application can improve the matching accuracy of the edge images.
Inventors
- WANG ERHU
- LI FEI
- ZHAO BING
- OU QIAN
- ZHANG WEI
Assignees
- 联宝(合肥)电子科技有限公司
- 联宝(合肥)电子科技有限公司
Dates
- Publication Date
- 20260421
- Application Date
- 20220527
- Priority Date
- 20220527
Claims (7)
- 1. A method of image matching, the method comprising: Determining a second candidate edge image on an image to be detected corresponding to a template image based on a first edge image on the template image; The method comprises the steps of obtaining a binarization map corresponding to a second candidate edge image and a saliency binarization map corresponding to the second candidate edge image, wherein the obtaining of the binarization map corresponding to the second candidate edge image and the saliency binarization map corresponding to the second candidate edge image comprises the steps of determining the binarization map corresponding to the second candidate edge image according to the color information of the second candidate edge image; Determining a target edge image corresponding to the first edge image based on the binarization map and the saliency binary map; The determining the target edge image corresponding to the first edge image based on the binarization image and the saliency binary image comprises performing AND operation on the binarization image and the saliency binary image to obtain a binarization image of the target edge image; The method comprises the steps of determining a target edge image based on target position information of a binarized image of the target edge image, obtaining first position information of a second candidate edge image on the image to be detected, obtaining second position information of a binarized image of the target edge image on the second candidate edge image, determining target position information of the target edge image on the image to be detected based on the first position information and the second position information, and determining the target edge image on the image to be detected based on the target position information.
- 2. The method of claim 1, wherein determining a second candidate edge image on the image under test corresponding to the template image based on the first edge image on the template image comprises: determining a rectangular frame corresponding to the first edge image; Expanding the rectangular frame to obtain a first region of interest corresponding to the first edge image; and determining a second candidate edge image based on the first region of interest and the image to be detected.
- 3. The method of claim 2, wherein determining a second candidate edge image based on the first region of interest and the image to be measured comprises Determining a candidate region corresponding to the first region of interest in the image to be detected; dividing the candidate region from the image to be detected; And determining the segmented candidate region as the second candidate edge image.
- 4. The method according to claim 1, wherein the acquiring the binarized map corresponding to the second candidate edge image and the saliency binarized map corresponding to the second candidate edge image includes: determining a saliency map corresponding to the second candidate edge image according to the second candidate edge image; counting a saliency histogram based on the saliency of the pixel points in the saliency map; determining a saliency threshold based on the saliency histogram; the saliency binary map is determined based on the saliency threshold and the saliency map.
- 5. An image matching apparatus, the apparatus comprising: the second candidate edge image determining module is used for determining a second candidate edge image on the image to be detected, which corresponds to the template image, based on the first edge image on the template image; the binarization map and saliency binary map determining module is used for obtaining a binarization map corresponding to the second candidate edge image and a saliency binary map corresponding to the second candidate edge image; the obtaining the binarization map corresponding to the second candidate edge image and the saliency binarization map corresponding to the second candidate edge image comprises determining the binarization map corresponding to the second candidate edge image according to the color information of the second candidate edge image; the target edge image determining module is used for determining a target edge image corresponding to the first edge image based on the binarization graph and the saliency binary graph; The determining the target edge image corresponding to the first edge image based on the binarization image and the saliency binary image comprises performing AND operation on the binarization image and the saliency binary image to obtain a binarization image of the target edge image; The method comprises the steps of determining a target edge image based on target position information of a binarized image of the target edge image, obtaining first position information of a second candidate edge image on the image to be detected, obtaining second position information of a binarized image of the target edge image on the second candidate edge image, determining target position information of the target edge image on the image to be detected based on the first position information and the second position information, and determining the target edge image on the image to be detected based on the target position information.
- 6. An electronic device, the electronic device comprising: and a memory communicatively coupled to the at least one processor; Wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.
- 7. A computer readable storage medium comprising a set of computer executable instructions for performing the image matching method of any of claims 1-4 when the instructions are executed.
Description
Image matching method and device and electronic equipment Technical Field The present application relates to the field of image processing technologies, and in particular, to an image matching method, an image matching device, and an electronic device. Background In the packaging box detection process, the printed icons at the edge positions are interfered by edge information, so that a large number of false detection is caused, the efficiency of the production line is low, and the production line cannot be normally streamlined. Therefore, the improvement of the detection accuracy of the edge icons is a key for ensuring the attaching quality of the printed cartons and the normal streamline of the production line. Disclosure of Invention The embodiment of the application provides an image matching method, an image matching device and electronic equipment, which improve the detection accuracy of edge images. The technical scheme of the embodiment of the application is realized as follows: In a first aspect, an embodiment of the present application provides an icon matching method, including: Determining a second candidate edge image on an image to be detected corresponding to a template image based on a first edge image on the template image; Acquiring a binarization image corresponding to the second candidate edge image and a saliency binary image corresponding to the second candidate edge image; and determining a target edge image corresponding to the first edge image based on the binarization map and the saliency binary map. In the above aspect, the determining, based on the first edge image on the template image, the second candidate edge image on the image to be detected corresponding to the template image includes: determining a rectangular frame corresponding to the first edge image; Expanding the rectangular frame to obtain a first region of interest corresponding to the first edge image; and determining a second candidate edge image based on the first region of interest and the image to be detected. In the above aspect, the determining a second candidate edge image based on the first region of interest and the image to be measured includes: Determining a candidate region corresponding to the first region of interest in the image to be detected; dividing the candidate region from the image to be detected; And determining the segmented candidate region as the second candidate edge image. In the above solution, the obtaining the binarization map corresponding to the second candidate edge image and the saliency binarization map corresponding to the second candidate edge image includes: And determining a binarization map corresponding to the second candidate edge image according to the color information of the second candidate edge image. In the above solution, the obtaining the binarization map corresponding to the second candidate edge image and the saliency binarization map corresponding to the second candidate edge image includes: determining a saliency map corresponding to the second candidate edge image according to the second candidate edge image; counting a saliency histogram based on the saliency of the pixel points in the saliency map; determining a saliency threshold based on the saliency histogram; the saliency binary map is determined based on the saliency threshold and the saliency map. In the above aspect, the determining, based on the binarized map and the saliency binary map, a target edge image corresponding to the first edge image includes: Performing AND operation on the binarization graph and the saliency binarization graph to obtain a binarization graph of the target edge image; And determining the target edge image based on the target position information of the binarized graph of the target edge image. In the above solution, the determining the target edge image on the image to be measured based on the target position information of the binarized graph of the target edge image includes: Acquiring first position information of the second candidate edge image on the image to be detected; Acquiring second position information of the target edge image on the second candidate edge image; determining target position information of the target edge image on the image to be detected based on the first position information and the second position information; And determining a target edge image on the image to be detected based on the target position information. In a second aspect, an embodiment of the present application provides an image matching apparatus, including: And the candidate edge image determining module is used for determining a second candidate edge image on the image to be detected corresponding to the template image based on the first edge image on the template image. The binarization map and saliency binary map determining module is used for obtaining a binarization map corresponding to the second candidate edge image and a saliency binary map corresponding to the second c