An image matching method, apparatus and electronic device
By using edge image processing based on template images in packaging box inspection, edge interference information is identified and filtered out, improving the detection accuracy of edge icons, solving the problem of false detection caused by edge information interference, and ensuring the normal operation of the production line.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- LCFC HEFEI ELECTRONICS TECH
- Filing Date
- 2022-05-27
- Publication Date
- 2026-04-21
AI Technical Summary
During the inspection of packaging boxes, printed icons at the edges may be misdetected due to interference from edge information, resulting in low production line efficiency and inability to operate normally.
By using the first edge image based on the template image, a second candidate edge image on the image to be tested is determined, and its binarized image and saliency binary image are obtained. Edge interference information is filtered out using the saliency threshold to determine the precise location of the target edge image.
It improves the detection accuracy of edge icons, avoids detection errors caused by edge interference information, and ensures normal production line flow.
Smart Images

Figure CN115063614B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an image matching method, apparatus and electronic device. Background Technology
[0002] During the packaging box inspection process, printed icons at the edges are subject to interference from edge information, resulting in numerous false detections, leading to low production line efficiency and disruptions to normal production line flow. Therefore, improving the detection accuracy of edge icons is crucial to ensuring the bonding quality of printed cartons and the normal operation of the production line. Summary of the Invention
[0003] This application provides an image matching method, apparatus, and electronic device that improves the detection accuracy of edge images.
[0004] The technical solution of this application embodiment is implemented as follows:
[0005] In a first aspect, embodiments of this application provide an icon matching method, including:
[0006] Based on the first edge image on the template image, a second candidate edge image on the test image corresponding to the template image is determined;
[0007] Obtain the binarized image corresponding to the second candidate edge image and the saliency binary image corresponding to the second candidate edge image;
[0008] The target edge image corresponding to the first edge image is determined based on the binarized image and the saliency binary image.
[0009] In the above scheme, determining the second candidate edge image on the test image corresponding to the template image based on the first edge image on the template image includes:
[0010] Determine the bounding box corresponding to the first edge image;
[0011] The rectangle is expanded to obtain the first region of interest corresponding to the first edge image;
[0012] A second candidate edge image is determined based on the first region of interest and the image to be tested.
[0013] In the above scheme, determining the second candidate edge image based on the first region of interest and the image to be tested includes:
[0014] Determine the candidate region in the image to be tested that corresponds to the first region of interest;
[0015] The candidate region is segmented from the image to be tested;
[0016] The segmented candidate region is determined to be the second candidate edge image.
[0017] In the above scheme, obtaining the binarized image corresponding to the second candidate edge image and the saliency binarized image corresponding to the second candidate edge image includes:
[0018] The binarized image corresponding to the second candidate edge image is determined based on the color information of the second candidate edge image.
[0019] In the above scheme, obtaining the binarized image corresponding to the second candidate edge image and the saliency binarized image corresponding to the second candidate edge image includes:
[0020] Determine the saliency map corresponding to the second candidate edge image based on the second candidate edge image;
[0021] Based on the saliency statistics of the pixels in the saliency map, a saliency histogram is plotted.
[0022] The significance threshold is determined based on the significance histogram;
[0023] Based on the saliency threshold and the saliency map, the saliency binary map is determined.
[0024] In the above scheme, determining the target edge image corresponding to the first edge image based on the binarized image and the saliency binary image includes:
[0025] Perform an AND operation on the binarized image and the saliency binarized image to obtain a binarized image of the target edge image;
[0026] The target edge image is determined based on the target location information of the binarized image of the target edge image.
[0027] In the above scheme, determining the target edge image on the image to be tested based on the target location information of the binarized image of the target edge image includes:
[0028] Obtain the first position information of the second candidate edge image on the image to be tested;
[0029] Obtain the second position information of the target edge image on the second candidate edge image;
[0030] Based on the first location information and the second location information, the target location information of the target edge image on the image under test is determined;
[0031] Based on the target location information, the target edge image on the image to be tested is determined.
[0032] Secondly, embodiments of this application provide an image matching device, the image matching device comprising:
[0033] The candidate edge image determination module is used to determine a second candidate edge image on the test image corresponding to the template image based on a first edge image on the template image.
[0034] The binarization map and saliency binary map determination module is used to obtain the binarization map and the saliency binary map corresponding to the second candidate edge image;
[0035] The target edge image determination module is used to determine the target edge image corresponding to the first edge image based on the binarized image and the saliency binary image.
[0036] Thirdly, embodiments of this application provide an electronic device, the electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the image matching method provided in embodiments of this application.
[0037] Fourthly, embodiments of this application provide a computer-readable storage medium, the storage medium including a set of computer-executable instructions, which, when executed, are used to perform the image matching method provided in embodiments of this application.
[0038] The image matching method provided in this application, based on a first edge image on a template image, determines a second candidate edge image on a test image corresponding to the template image; obtains a binarized image and a saliency binarized image corresponding to the second candidate edge image; and determines a target edge image corresponding to the first edge image based on the binarized image and the saliency binarized image. The image matching method provided in this application, by determining the precise location information of the target edge image on the test image, can improve the detection accuracy of edge icons. Attached Figure Description
[0039] The accompanying drawings are provided for a better understanding of this solution and do not constitute a limitation of this application. Wherein:
[0040] Figure 1 This is a schematic diagram of an optional processing flow of the image matching method provided in the embodiments of this application;
[0041] Figure 2 This is a schematic diagram of a false detection image of an edge icon provided in an embodiment of this application;
[0042] Figure 3It is a salience map of the edge icon image provided in the embodiments of this application;
[0043] Figure 4 This is a schematic diagram of the saliency statistical histogram of the edge icon image provided in the embodiments of this application;
[0044] Figure 5 This is a schematic diagram illustrating the printing content matching effect of the image matching method provided in the embodiments of this application;
[0045] Figure 6 This is a schematic diagram illustrating the workflow of the image matching system provided in this application embodiment;
[0046] Figure 7 This is a schematic diagram of an optional device structure of the image matching apparatus provided in the embodiments of this application;
[0047] Figure 8 This is a block diagram of an electronic device for an image matching method provided in an embodiment of this application. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0049] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0050] In the following description, the terms "first" and "second" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first" and "second" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0051] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0052] This application will introduce an image matching method provided by an embodiment of the present application. See [link to relevant documentation]. Figure 1 , Figure 1 This is a schematic diagram of an optional processing flow of the image matching method provided in the embodiments of this application. The following will be combined with... Figure 1The steps S101-S103 shown are combined with Figures 2-5 Please provide an explanation.
[0053] Step S101: Based on the first edge image on the template image, determine the second candidate edge image on the test image corresponding to the template image.
[0054] In some embodiments, the template image can be a PDF (Portable Document Format) document; if the image to be tested is a printed cardboard box, the template image can be understood as a design drawing that is one-to-one with the image to be tested on the printed cardboard box.
[0055] In some applications, edge interference information often exists at the edge of the icons on packaging boxes. This interference can interfere with the detection of edge icons by production inspection equipment. When the equipment identifies a packaging box with a valid or intact edge icon as defective due to this interference, false detections occur. Multiple consecutive false detections can disrupt the production line and reduce efficiency. This edge interference can manifest as a darker shadow on the edge icon, or as a darker edge due to uneven exposure caused by creases at the edge. False detections of edge icons can be caused by… Figure 2 As shown, Figure 2 This is a diagram illustrating false detections of edge icons. Figure 2 In the process, the icon on the far left edge of the image under test was missed. The detection equipment did not detect the icon, and therefore the area around it was not selected by the rectangular bounding box. This is because the icon is located at the edge of the image under test, and there is edge information interference from the gray area at the edge of the icon. When the production equipment detects this edge icon, it does not detect it and will classify the packaging box as a quality defective box with a missing edge icon. Therefore, accurately detecting the printed icons at the edge positions on the packaging box is a crucial step in ensuring the quality of the printed carton's bonding and maintaining a normal flow line.
[0056] In some embodiments, edge icons in the template image are determined based on whether the position of the icon in the template image is close to the left or right edge, and the position of the edge icon is determined by a rectangle. The region of interest of the edge icon in the template image is determined based on the rectangle corresponding to the position of the edge icon.
[0057] As an example, edge icons can be determined based on their position within the template image. When the left coordinate x = 0, it indicates that the icon is located at the left edge of the template image. In the following description, edge icons on the template image are referred to as edge images.
[0058] In some embodiments, the specific implementation process of determining the region of interest (ROI) of the first edge image may include: expanding the bounding box corresponding to the image position of the first edge image outward by a predetermined number of pixels to obtain the first ROI of the first edge image. The first edge image can be any edge image on the template image, and the predetermined number can be flexibly set according to the actual application scenario; for example, the first edge image can be expanded outward by 200 pixels. Since there is a one-to-one correspondence between the images on the template image and the images on the test image, candidate regions of the second candidate edge image corresponding to the first ROI in the test image can be determined based on the first ROI.
[0059] As an example, if the location information corresponding to the first region of interest (ROI) in the first edge image is (x, y, w, h), where x is the coordinate of the top-left corner of the first ROI along the x-axis in the template image, y is the coordinate of the top-left corner of the first ROI along the y-axis in the template image, w is the width of the first ROI, and h is the height of the first ROI. Since there is a one-to-one correspondence between the image on the template image and the image to be tested, the location information of the candidate region corresponding to the first ROI in the image to be tested is also (x, y, w, h). This location information can be recorded as the first location information. Based on the first location information, the second candidate edge image is obtained by extracting the image from the image to be tested.
[0060] Step S102: Obtain the binarized image corresponding to the second candidate edge image and the saliency binarized image corresponding to the second candidate edge image.
[0061] In some embodiments, after obtaining the second candidate edge image in the above steps, the HSV (Hue, Saturation, Value) color information of the first edge image in the corresponding template image is extracted for the second candidate edge image. Hue, saturation, and value color information can also be referred to as HSV. In the template image, the color information can be directly extracted, and the threshold for the color information is also known. Based on the color information, a binarized image corresponding to the second candidate edge image can be obtained.
[0062] For the second candidate edge image, the FineGrained method in the OpenCV library (Open source Computer Vision Library) can be used to obtain the saliency map corresponding to the second candidate edge image, such as... Figure 3 The above, Figure 3This is a saliency map of the edge icon image provided in this application embodiment. As can be seen from the saliency map, the edge information is less saliency than the edge image information. Based on this characteristic, a saliency threshold can be determined. This saliency threshold is higher than the saliency of the edge information but lower than the saliency of the edge icon, and is used to filter out the edge information of the second candidate edge image.
[0063] In some embodiments, the saliency of pixels in the saliency map corresponding to the image can be obtained. Based on the saliency of pixels in the saliency map, a saliency histogram can be further calculated, and based on the saliency histogram, a saliency threshold can be further determined. For example... Figure 4 As shown, Figure 4 This is a schematic diagram of the saliency statistical histogram of the edge icon image provided in the embodiments of this application. Figure 4 yes Figure 3 The saliency histogram corresponds to the saliency map of the edge image within the leftmost edge box. The saliency histogram represents the statistical characteristics of the edge image saliency map, where the x-axis represents the saliency value in the saliency map, the y-axis represents the number of pixels in the saliency map, W is the width of the saliency map, and H is the height of the saliency map. It can be determined that in... Figure 4 In the image, the region from the origin (0,0) to the first trough is a non-salient region containing a large number of pixels, while the region between the first and second troughs is the region with salient edge information. It can be determined that the x-coordinate position of the black dashed line, i.e., the position of the second trough, represents salient edge information. Therefore, the x-coordinate position of the black dashed line is the saliency threshold, which is used to distinguish between edge information and image information in the edge image.
[0064] Based on the saliency threshold and saliency map of the edge image, a saliency binary map can be obtained. The process of determining the saliency binary map is as follows: set the color information value of pixels in the saliency map whose pixel value is greater than the saliency threshold to 255 (white), and set the color information value of pixels in the saliency map whose pixel value is less than or equal to the saliency threshold to 0 (black), thus obtaining the saliency binary map.
[0065] Step S103: Determine the target edge image corresponding to the first edge image based on the binarized image and the saliency binary image.
[0066] In some embodiments, performing a bitwise AND operation between the saliency binary map corresponding to the determined second candidate edge image and the binarized map corresponding to the second candidate edge image can filter out edge interference information of the second candidate edge, resulting in a pure binarized map of the target edge image. The saliency map is then represented using bin_img. saliency This indicates that the binarized image is represented by bin_img. hsv The binarized image of the clean target edge is represented by bin_img.
[0067] Its calculation method is as shown in formula (1);
[0068] bin_img = bin_img hsv &bin_img saliency (1)
[0069] After obtaining the binarized image of the target edge image, the `findContours` method in the OpenCV library can be used to obtain the second position information (x1, y1, w1, h1) of the bounding box of the region where the binarized image of the target edge image is located in the second candidate edge image. Here, x1 is the coordinate value of the upper left corner of the bounding box in the x-axis direction, y1 is the coordinate value of the upper left corner of the bounding box in the y-axis direction, w1 is the width of the bounding box, and h1 is the height of the bounding box. Combining the first position information (x, y, w, h) of the second candidate edge image on the test image obtained in step S101, the target position information (x2, y2, w2, h2) of the final target edge image on the test image is obtained. The second position information is represented as `label_region_roi`, the first position information is represented as `label_roi`, and the target position information of the final target edge image on the test image is represented as `label_location`. The calculation formulas are shown in formulas (2) to (5).
[0070] lable_location(x2)=lable_region_roi(x1)+lable_roi(x) (2)
[0071] lable_location(y2)=lable_region_roi(y1)+lable_roi(y) (3)
[0072] lable_location(w2)=lable_roi(w) (4)
[0073] lable_location(h2)=lable_roi(h) (5)
[0074] In some embodiments, by performing a bitwise AND operation on the binarized image corresponding to the second candidate edge image and the saliency binarized image corresponding to the second candidate edge image, edge interference information of the second candidate edge image can be filtered out to obtain a final clean target edge image, thereby further obtaining accurate target location information of the target edge image. Based on the target location information, matching the first edge image on the template image with the target edge image on the test image not only improves the detection accuracy of the edge image but also avoids edge image detection errors caused by edge interference information in the edge image, thus preventing reduced pipeline efficiency.
[0075] Based on the above Figures 1-4 The image matching method shown in the diagram illustrates the printing content matching effect. Figure 5 As shown, Figure 5 This is a schematic diagram illustrating the printing content matching effect of the image matching method provided in the embodiments of this application.
[0076] The following describes the workflow of the image matching system provided in the embodiments of this application. See also... Figure 6 , Figure 6 This is a schematic diagram of the workflow of the image matching system provided in the embodiments of this application.
[0077] In some embodiments, the template image and the image to be tested are in one-to-one correspondence. Therefore, based on the first edge image on the template image 601, the second candidate edge image 604 on the image to be tested 602 corresponding to the template image 601 is obtained.
[0078] The process of determining the second candidate edge image is as follows: Obtain the bounding box of the location of the first edge image in the template image; expand the bounding box of the first edge image outward by a certain number of pixels to obtain the region of interest (ROI) of the first edge image. For example, the bounding box of the first edge image can be expanded outward by 200 pixels. Based on the ROI of the first edge image, determine the candidate region on the test image corresponding to the template image. The position information of this candidate region on the test image is recorded as the first position information. Based on the first position information, obtain the candidate region 603 and the test image; segment the candidate region from the test image; and determine the segmented region as the second candidate edge image 604.
[0079] The process of extracting the binarized image 605 is as follows: The binarized image corresponding to the second candidate edge image is determined based on the color information of the second candidate edge image. For example, the HSV color information of the second candidate edge image can be extracted to obtain the corresponding binarized image.
[0080] Since the second candidate edge image is located at the edge of the image to be tested, the resulting binarized image will contain edge interference information, which needs to be filtered out.
[0081] For the second candidate edge image, the FineGrained method in the OpenCV library can be used to extract the image saliency map. Based on the saliency map, the saliency of pixels in the image can be determined, and the image saliency is extracted (606). Next, based on the saliency of pixels in the saliency map, a saliency histogram is calculated (607). According to the saliency map histogram features, a saliency threshold (608) is obtained. Pixels in the saliency map whose corresponding pixel saliency value is greater than the threshold are set to 255 (white), and pixels whose corresponding pixel saliency value is less than or equal to the saliency threshold are set to 0 (black), thus obtaining a binary saliency map (609). The saliency threshold is determined as the x-coordinate position of the statistical saliency histogram at the second trough.
[0082] After obtaining the saliency binary image and binarized image of the second candidate edge image, a bitwise AND operation is performed on the saliency binary image and the binarized image to filter edge interference information, resulting in a clean target edge image binarized image. This determines the second position information of the bounding box on the second candidate edge image, indicating the location of the target edge image. Based on the first position information of the second candidate edge image on the test image and the second position information of the target edge image binarized image on the second candidate edge image, the position of the target edge image on the test image is obtained. Based on the first and second position information, the precise position 610 of the target edge image is obtained. Based on the final precise position of the target edge image, image matching is performed on the target edge image.
[0083] Figure 7 This is a schematic diagram of an optional device structure for an image matching apparatus provided in an embodiment of this application. The image matching apparatus 700 includes a candidate edge image determination module 701, a binarized image and saliency binary image determination module 702, and a target edge image determination module 703.
[0084] The candidate edge image determination module 701 is used to determine a second candidate edge image on the test image corresponding to the template image based on a first edge image on the template image;
[0085] Binarization map and saliency binary map determination module 702 is used to obtain the binarization map and the saliency binary map corresponding to the second candidate edge image;
[0086] The target edge image determination module 703 is used to determine the target edge image corresponding to the first edge image based on the binarized image and the saliency binary image.
[0087] In some embodiments, the candidate edge image determination module 701 is specifically used to: determine a rectangular box corresponding to the first edge image; expand the rectangular box to obtain a first region of interest corresponding to the first edge image; and determine a second candidate edge image based on the first region of interest and the image to be tested.
[0088] Specifically, the candidate edge image determination module 701 is used to: determine a candidate region in the image to be tested that corresponds to the first region of interest; segment the candidate region from the image to be tested; and determine the segmented candidate region as the second candidate edge image.
[0089] In some embodiments, the binarization map and saliency binary map determination module 702 is specifically used to: determine the binarization map corresponding to the second candidate edge image based on the color information of the second candidate edge image; determine the saliency map corresponding to the second candidate edge image based on the second candidate edge image; calculate a saliency histogram based on the saliency of the pixels in the saliency map; determine a saliency threshold based on the saliency histogram; and determine the saliency binary map based on the saliency threshold and the saliency map.
[0090] In some embodiments, the target edge image determination module 703 is specifically used to: perform an AND operation on the binarized image and the saliency binarized image to obtain a binarized image of the target edge image; and determine the target edge image on the image to be tested based on the target position information of the binarized image of the target edge image.
[0091] Specifically, the target edge image determination module 703 is used to: obtain first position information of the second candidate edge image on the image to be tested; obtain second position information of the binarized image of the target edge image on the second candidate edge image; determine the target position information of the target edge image on the image to be tested based on the first position information and the second position information; and determine the target edge image on the image to be tested based on the target position information.
[0092] It should be noted that the image matching device of this application embodiment is similar to the image matching method embodiment described above, and has similar beneficial effects as the method embodiment, therefore, it will not be described in detail. For any technical details not covered in the image matching device provided in this application embodiment, please refer to... Figures 1 to 6 The meaning is understood in accordance with the description of any of the accompanying drawings.
[0093] Figure 8A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure is shown. The electronic device 800 is used to implement the image matching method of the embodiments of the present disclosure. In some alternative embodiments, the electronic device 800 can implement the image matching method provided in the embodiments of this application by running a computer program. For example, the computer program can be a software module in an operating system; it can be a native application (APP), i.e., a program that needs to be installed in the operating system to run; it can also be an applet, i.e., a program that only needs to be downloaded to a browser environment to run; or it can be an applet that can be embedded in any APP. In summary, the above-mentioned computer program can be any form of application, module, or plugin.
[0094] In practical applications, electronic device 800 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. Electronic device 800 can be a smartphone, tablet, laptop, desktop computer, smart speaker, smart TV, smartwatch, etc., but is not limited to these.
[0095] Electronic devices are intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, in-vehicle terminals, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present application described and / or claimed herein.
[0096] like Figure 8As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. The RAM 803 may also store various programs and data required for the operation of the electronic device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0097] Multiple components in electronic device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of displays, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows electronic device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0098] The computing unit 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as the image matching method. For example, in some alternative embodiments, the image matching method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 808. In some alternative embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the image matching method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured as the image matching method by any other suitable means (e.g., by means of firmware).
[0099] This application provides a computer-readable storage medium storing executable instructions, wherein the executable instructions are stored and, when executed by a processor, will cause the processor to execute the image matching method provided in this application.
[0100] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.
[0101] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0102] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.
[0103] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable image matching device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable image matching device, generate instructions for implementing the process... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0104] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable image matching device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0105] It should be understood that in the various embodiments of this application, the sequence number of each implementation process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0106] The above are merely embodiments of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. An image matching method, characterized in that, The method includes: Based on the first edge image on the template image, a second candidate edge image on the test image corresponding to the template image is determined; Obtain the binarized image and the saliency binarized image corresponding to the second candidate edge image; obtaining the binarized image and the saliency binarized image corresponding to the second candidate edge image includes: determining the binarized image corresponding to the second candidate edge image based on the color information of the second candidate edge image; The target edge image corresponding to the first edge image is determined based on the binarized image and the saliency binary image; The step of determining the target edge image corresponding to the first edge image based on the binarized image and the saliency binarized image includes: performing an AND operation on the binarized image and the saliency binarized image to obtain a binarized image of the target edge image; and determining the target edge image based on the target position information of the binarized image of the target edge image. The step of determining the target edge image based on the target position information of the binarized image of the target edge image further includes: obtaining first position information of the second candidate edge image on the image to be tested; obtaining second position information of the binarized image of the target edge image on the second candidate edge image; determining the target position information of the target edge image on the image to be tested based on the first position information and the second position information; and determining the target edge image on the image to be tested based on the target position information.
2. The method according to claim 1, wherein determining a second candidate edge image on a test image corresponding to the template image based on a first edge image on the template image, characterized in that, include: Determine the bounding box corresponding to the first edge image; The rectangle is expanded to obtain the first region of interest corresponding to the first edge image; A second candidate edge image is determined based on the first region of interest and the image to be tested.
3. The method according to claim 2, wherein determining the second candidate edge image based on the first region of interest and the image to be tested, is characterized in that, include Determine the candidate region in the image to be tested that corresponds to the first region of interest; The candidate region is segmented from the image to be tested; The segmented candidate region is determined to be the second candidate edge image.
4. The method according to claim 1, wherein obtaining the binarized image corresponding to the second candidate edge image and the saliency binarized image corresponding to the second candidate edge image is characterized in that, include: Determine the saliency map corresponding to the second candidate edge image based on the second candidate edge image; Based on the saliency statistics of the pixels in the saliency map, a saliency histogram is plotted. The significance threshold is determined based on the significance histogram; Based on the saliency threshold and the saliency map, the saliency binary map is determined.
5. An image matching device, characterized in that, The device includes: The second candidate edge image determination module is used to determine a second candidate edge image on the test image corresponding to the template image based on the first edge image on the template image; The binarization map and saliency binary map determination module is used to obtain the binarization map and the saliency binary map corresponding to the second candidate edge image; the step of obtaining the binarization map and the saliency binary map corresponding to the second candidate edge image includes: determining the binarization map corresponding to the second candidate edge image based on the color information of the second candidate edge image; A target edge image determination module is used to determine the target edge image corresponding to the first edge image based on the binarized image and the saliency binary image; The step of determining the target edge image corresponding to the first edge image based on the binarized image and the saliency binarized image includes: performing an AND operation on the binarized image and the saliency binarized image to obtain a binarized image of the target edge image; and determining the target edge image based on the target position information of the binarized image of the target edge image. The step of determining the target edge image based on the target position information of the binarized image of the target edge image further includes: obtaining first position information of the second candidate edge image on the image to be tested; obtaining second position information of the binarized image of the target edge image on the second candidate edge image; determining the target position information of the target edge image on the image to be tested based on the first position information and the second position information; and determining the target edge image on the image to be tested based on the target position information.
6. An electronic device, characterized in that, The electronic device includes: At least one processor; and a memory communicatively connected to said at least one processor; 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-4.
7. A computer-readable storage medium, characterized in that, The storage medium includes a set of computer-executable instructions, which, when executed, are used to perform the image matching method according to any one of claims 1-4.
Citation Information
Patent Citations
Image processing method and device, computing equipment and storage medium
CN111369557A
Character recognition method and device, electronic equipment and storage medium
CN111680688A
Target object detection method and device, storage medium and electronic equipment
CN114494122A