Image automatic matching marking method and device, electronic equipment and storage medium
By performing grid division and template matching on the image, the marker position in semiconductor detection is automatically determined, solving the problem of low efficiency in manually finding marker positions and improving detection efficiency.
Patent Information
- Application Number
- CN202210257787.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-16
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2042-03-16
AI Technical Summary
In the field of semiconductor inspection, existing technologies require manual searching for suitable matching marker positions in high-resolution images, resulting in low inspection efficiency.
By dividing the image into grids at equal intervals, selecting grids that meet preset conditions as templates, and performing template matching to automatically determine the marking position, including contrast and contour number filtering, combined with subdivision method and uniqueness verification, the accuracy of automatic matching is improved.
It enables automatic matching of marker positions in semiconductor testing, reducing manual intervention and improving testing efficiency.
Smart Images

Figure CN114581691B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of semiconductor detection, and in particular to an image automatic matching and marking method, apparatus, electronic device and storage medium. Background Technology
[0002] In the field of industrial defect detection, especially in semiconductor defect detection, image alignment and localization are required before image detection. Template matching is typically used for image localization. When using template matching to localize an image, a matching model for localization needs to be trained first. The coordinates of this model within the image can then be found using template matching.
[0003] In the past, training matching models required manual selection of suitable marker locations within images. Images used as matching markers needed to possess characteristics such as high contrast, easily extractable contours, and uniqueness. In the field of semiconductor detection, due to the high accuracy requirements, images often have extremely high resolution, necessitating more manual effort to find suitable matching marker locations, thus impacting detection efficiency. Summary of the Invention
[0004] This invention provides an image automatic matching and marking method, apparatus, electronic device, and storage medium to achieve automatic matching of marking positions in images, reduce manual intervention costs, and improve detection efficiency.
[0005] In a first aspect, embodiments of the present invention provide an automatic image matching and tagging method, comprising:
[0006] Obtain the image to be labeled, and divide the image to be labeled into at least two first grids with equal spacing;
[0007] A second grid is obtained by selecting a grid that meets preset conditions from the first grid; wherein, meeting the preset conditions includes the number of image contours and the contrast of the first grid simultaneously meeting preset conditions;
[0008] Using the image contour within the second grid as a template, template matching is performed within a preset range to determine the target grid; wherein, the preset range is a range area formed by expanding the second grid as the center;
[0009] The target grid is marked to determine the target marked image, and the marked position information of the target marked image is output.
[0010] Secondly, embodiments of the present invention also provide an image automatic matching and marking device, comprising:
[0011] The first grid acquisition module is used to acquire the image to be labeled and divide the image to be labeled into at least two first grids at equal intervals.
[0012] The second grid acquisition module is used to select a grid that meets preset conditions from the first grid to obtain a second grid; wherein, meeting the preset conditions includes the number of image contours and the contrast of the first grid simultaneously meeting preset conditions;
[0013] The target grid acquisition module is used to determine the target grid by using the image contour within the second grid as a template and performing template matching within a preset range; wherein, the preset range is a range area formed by expanding the second grid as the center;
[0014] The image location marking module is used to mark the target grid to determine the target marked image and output the marking location information of the target marked image.
[0015] Thirdly, embodiments of the present invention also provide an electronic device, the electronic device comprising:
[0016] One or more processors;
[0017] Storage device for storing one or more programs;
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the image automatic matching and marking method according to any embodiment of the present invention.
[0019] Fourthly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the image automatic matching and marking method described in any embodiment of the present invention.
[0020] This invention provides an automatic image matching and labeling method, apparatus, electronic device, and storage medium. The method involves acquiring an image to be labeled and dividing it into at least two first grids at equal intervals. A second grid is obtained by selecting a grid from the first grids that meets preset conditions. These preset conditions include simultaneously satisfying the number of image contours and contrast within the first grids. Using the image contours within the second grid as templates, template matching is performed within a preset range to determine a target grid. The preset range is an area expanded from the second grid as its center. The target grid is then labeled to determine a target labeled image, and the labeling position information of the target labeled image is output. By employing the technical solution of this invention, the image to be labeled is divided into at least two first grids, and the first grids undergo contrast calculation, contour extraction, and template matching to obtain a target grid image that meets the image matching labeling requirements. This achieves automatic matching of labeling positions in the image, reducing manual intervention costs and improving detection efficiency. Attached Figure Description
[0021] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings. The drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0022] Figure 1A This is a flowchart of an automatic image matching and labeling method provided in Embodiment 1 of the present invention;
[0023] Figure 1B This is a schematic diagram of an image with equal spacing provided in an embodiment of the present invention;
[0024] Figure 1C This is a schematic diagram of a third grid image obtained by performing contrast calculation on a first grid, according to an embodiment of the present invention.
[0025] Figure 1D This is a schematic diagram of a second grid image obtained by extracting the contour of a third grid according to an embodiment of the present invention;
[0026] Figure 1E This is a comparative schematic diagram of contour extraction before and after according to an embodiment of the present invention;
[0027] Figure 1F This is a schematic diagram of a target mesh obtained by template matching a second mesh according to an embodiment of the present invention;
[0028] Figure 2A This is a flowchart of an automatic image matching and labeling method provided in Embodiment 2 of the present invention;
[0029] Figure 2B This is a schematic diagram of the outline length and number of corner points of an image within a second grid, provided in an embodiment of the present invention.
[0030] Figure 2C This is a schematic diagram of an enlarged rectangular subdivision method provided in an embodiment of the present invention;
[0031] Figure 2D This is a schematic diagram of a spiral subdivision method provided in an embodiment of the present invention;
[0032] Figure 2E This is a schematic diagram of a uniqueness verification process provided by an embodiment of the present invention;
[0033] Figure 2F This is a schematic diagram of the image after uniqueness verification of a subdivided grid provided in an embodiment of the present invention;
[0034] Figure 2G This is a schematic diagram of a grid that can be used for matching and marking, provided by an embodiment of the present invention;
[0035] Figure 3 This is a schematic diagram of the structure of an automatic image matching and marking device provided in Embodiment 3 of the present invention;
[0036] Figure 4 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of this application. Detailed Implementation
[0037] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0038] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations (or steps) may be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations may be rearranged. The process may be terminated when its operation is completed, but may also have additional steps not included in the figures. The process may correspond to a method, function, procedure, subroutine, subroutine, etc.
[0039] Example 1
[0040] Figure 1AThis is a flowchart of an automatic image matching and labeling method provided in Embodiment 1 of the present invention. This embodiment is applicable to the automatic matching and labeling of images. The method of this embodiment can be executed by an automatic image matching and labeling device, which can be implemented in hardware and / or software. This device can be configured in an image automatic matching and labeling server. The method specifically includes the following steps:
[0041] S110. Obtain the image to be labeled, and divide the image to be labeled into at least two first grids at equal intervals.
[0042] The image to be labeled refers to the image acquired for image matching and labeling.
[0043] Equal spacing refers to dividing an image according to a preset length and width, for example, Figure 1B This is a schematic diagram of an image with equal spacing provided in an embodiment of the present invention. See also: Figure 1B The image to be labeled is divided into at least two first grids according to preset length and width values.
[0044] S120. Select a grid that meets the preset conditions from the first grid to obtain a second grid.
[0045] Wherein, the second grid is a first grid that meets preset conditions, which include the number of image contours and the contrast of the first grid meeting preset conditions simultaneously; for example, the contrast of the image in the first grid is greater than a preset contrast threshold and the number of contours of the image in the first grid is less than a preset contour number threshold.
[0046] Optionally, selecting a second grid from the first grid that meets preset conditions includes:
[0047] Obtain the grayscale value of the image within the first grid, and filter out grids with a contrast value less than a preset contrast threshold to determine the third grid;
[0048] Contour extraction is performed on the image within the third grid, and grids with more than a preset contour number threshold are filtered out to determine the second grid.
[0049] in, Figure 1C This is a schematic diagram of a third grid image obtained by performing contrast calculation on the first grid according to an embodiment of the present invention. See also: Figure 1C Calculate the contrast of the first grid cell in the image. The contrast calculation method is as follows: Where max is the maximum grayscale value within the first grid, and min is the minimum grayscale value within the first grid; the third grid is determined by filtering out grids with a contrast ratio less than a preset contrast threshold through contrast calculation; for example, if the preset contrast threshold is 0.3, then the first grid with a contrast ratio less than 0.3 is filtered out, and the third grid is obtained by retaining grids with a contrast ratio greater than 0.3. The method for calculating the contrast ratio of the grids in this embodiment of the invention is not specifically limited.
[0050] in, Figure 1D This is a schematic diagram of a second grid image obtained by contour extraction of a third grid according to an embodiment of the present invention. See also: Figure 1D The process involves taking a screenshot of the third grid, generating outlines from the screenshot, where each outline is a continuous or closed line. Third grids with more than a certain threshold of outline counts are filtered out to obtain the second grid. For example, if the preset outline count threshold is 5, third grids with more than 5 outline counts are filtered out, and the remaining grids are the second grid. Figure 1E This is a comparative schematic diagram of contour extraction before and after an embodiment of the present invention. See also: Figure 1E ,Will Figure 1E The left image is used to extract the contours to obtain the right image. Figure 1E The image on the right side must contain at least 8 outlines (some of which may be small dots, but are not clearly visible with current pixel counts). If the number of image outlines exceeds a preset threshold of 5, then... Figure 1E The third grid cell was filtered out.
[0051] It is understandable that the term "first grid" can be a metaphor to distinguish different grids that execute corresponding logic in the embodiments. Any grid selected from the grids is used to explain the execution logic from the selected grid. Therefore, the grid that appears for the first time in this document is called the first grid, and other grids that appear later and are different from the first grid are called the second grids, which will not be elaborated on further.
[0052] S130. Using the image contour within the second grid as a template, perform template matching within a preset range to determine the target grid.
[0053] The preset range is a range area formed by expanding the second grid as the center; expanding the preset range can refer to the range formed by expanding the second grid by twice the size of the second grid as the center. In this embodiment of the invention, the preset range is not specifically limited and is set according to the actual situation.
[0054] Optionally, the step of using the image contour within the second grid as a template to perform template matching within a preset range to determine the target grid includes:
[0055] The image contours within the second grid are used as matching templates; wherein, the image contours within the second grid refer to contours that can contain all images within the second grid.
[0056] Based on the matching template, template matching is performed within a preset range to determine the target mesh that meets the uniqueness condition;
[0057] The uniqueness condition includes that the number of matching results is unique and the distance between the center point of the matching template and the center point of the matched template is less than a preset distance.
[0058] The target grid refers to the grid obtained by uniquely verifying the second grid. For example, the second grid is used as a matching template, and template matching is performed within a certain range of the second grid. If a unique matching result is found and the distance between the center point of the matching template and the center point of the matched template is less than a preset distance, then the second grid is considered to meet the uniqueness condition and the target grid is obtained. Figure 1F This is a schematic diagram of a target mesh obtained by template matching a second mesh according to an embodiment of the present invention. See also... Figure 1F The grid in the figure is the remaining grid after contrast calculation, contour extraction and template matching, and the grid is marked as the target grid.
[0059] S140. Mark the target grid to determine the target marker image, and output the marker position information of the target marker image.
[0060] Specifically, the target grid is marked, and the position information of the target grid is obtained to locate the image.
[0061] This invention provides an automatic image matching and labeling method, apparatus, electronic device, and storage medium. The method involves acquiring an image to be labeled and dividing it into at least two first grids at equal intervals. A second grid is obtained by selecting a grid from the first grids that meets preset conditions. These preset conditions include simultaneously satisfying the number of image contours and contrast within the first grids. Using the image contours within the second grid as templates, template matching is performed within a preset range to determine a target grid. The preset range is an area expanded from the second grid as its center. The target grid is then labeled to determine a target labeled image, and the labeling position information of the target labeled image is output. By employing the technical solution of this invention, the image to be labeled is divided into at least two first grids, and the first grids undergo contrast calculation, contour extraction, and template matching to obtain a target grid image that meets the image matching labeling requirements. This achieves automatic matching of labeling positions in the image, reducing manual intervention costs and improving detection efficiency.
[0062] Example 2
[0063] Figure 2A This is a flowchart illustrating an automatic image matching and labeling method according to Embodiment 2 of the present invention. The embodiments of the present invention further optimize the aforementioned embodiments, and can be combined with various optional solutions from one or more of the above embodiments. For example... Figure 2A As shown, the image automatic matching and tagging method provided in this embodiment of the invention may include the following steps:
[0064] S210. Obtain the image to be labeled, and divide the image to be labeled into at least two first grids at equal intervals.
[0065] S220. Select a grid that meets the preset conditions from the first grid to obtain a second grid.
[0066] S230. Obtain the attribute information of the image within the second grid, and filter the second grid based on the attribute information to determine the second grid that can be used to create a matching model.
[0067] The attribute information of the image within the second grid includes the image outline length and the number of image corner points.
[0068] Optionally, the step of filtering the second grid based on the attribute information to determine the second grid that can be used to create the matching model includes:
[0069] Obtain the contour length of the image within the second grid, and filter out the second grids that are less than a preset contour length threshold to determine the fourth grid;
[0070] Obtain the number of corner points in the image within the fourth grid, and filter out the fourth grids with fewer than a preset threshold number of corner points to determine the second grid that can be used to create a matching model.
[0071] Specifically, the process involves acquiring information such as the contour length and the number of corner points of the image within the second grid, filtering out second grids with a contour number less than a preset contour length threshold to determine the fourth grid. The preset contour length threshold can be 60, in which case second grids with a contour number less than 60 are filtered out as the fourth grid. Fourth grids with a number of corner points less than a preset threshold are filtered out to determine the second grids that can be used to create a matching model. The preset corner point threshold can be 3, in which case fourth grids with a number of corner points less than 3 are filtered out to determine the second grids that can be used to create a matching model. Figure 2B This is a schematic diagram illustrating the contour length and number of corner points of an image within a second grid, as provided in an embodiment of the present invention. See [link / reference]. Figure 2B The grid has 2 outlines, a minimum outline length of 80 pixels, and 8 corner points (marked with "x"). The grid will be preserved when the above thresholds are set.
[0072] S240. Using the image contour within the second grid that can be used to create a matching model as a template, perform template matching within a preset range to determine the target grid.
[0073] S250. The target mesh is subdivided using a subdivision method to determine the subdivided mesh.
[0074] After obtaining the target grid, it can be further optimized by subdividing the target grid using a subdivision method, so as to include the required image in the target grid.
[0075] The subdivision methods include, but are not limited to, the expanded rectangular subdivision method and the spiral subdivision method. Figure 2C This is a schematic diagram of an enlarged rectangular subdivision method provided in an embodiment of the present invention. See also... Figure 2C After expanding outwards from the target grid, a target grid of the same size as the target grid is generated inside it at equal intervals. Figure 2D This is a schematic diagram of a spiral subdivision method provided in an embodiment of the present invention. See also: Figure 2D A spiral is generated with the center of the target grid as the center point. Based on the generated spiral, a target grid of the same size as the target grid is generated according to certain rules. The target grid is subdivided using a subdivision method. The purpose is to ensure that the grid selected during image labeling can contain more of the required image, so that the image information can be completely reflected in the labeled grid.
[0076] S260. Perform uniqueness verification on the subdivided mesh to determine the mesh that better meets the matching label conditions.
[0077] Figure 2E This is a schematic diagram of a uniqueness verification process provided in an embodiment of the present invention. See also: Figure 2E The uniqueness verification of the subdivided mesh may include steps A1-A9:
[0078] A1. Input the image to which the subdivided grid belongs;
[0079] A2. Use the subdivided grid as the matching template and generate a larger search box centered on the subdivided grid;
[0080] A3. Perform template matching within the search box;
[0081] A4. Calculate the number of template matching searches and the distance between the matching result and the center of the subdivided grid;
[0082] A5. Determine if the matching result is unique and the distance is less than the preset distance;
[0083] A6. If not, determine whether all the subdivided grids have been verified.
[0084] A7. If so, retain the subdivided mesh and determine whether all subdivided meshes have been verified.
[0085] A8. If not all the subdivided grids have been verified, continue to verify the uniqueness of the contrast.
[0086] A9. If all the subdivided grids have been verified, output the image to which the uniqueness verification has been performed.
[0087] Figure 2F This is a schematic diagram of an image after uniqueness verification of a subdivided grid according to an embodiment of the present invention. See also... Figure 2F In this embodiment of the invention, the target mesh is subdivided and its uniqueness is verified again, so that the subdivided mesh is more in line with the matching mark conditions.
[0088] S270. Mark the target grid to determine the target marker image, and output the marker position information of the target marker image.
[0089] Figure 2G This is a schematic diagram of a grid that can be used for matching and marking, provided by an embodiment of the present invention. See also... Figure 2G It can mark any grid in the figure and output the mark position information, which includes, but is not limited to, the position coordinates of the mark and the size of the grid.
[0090] This invention provides an automatic image matching and labeling method. The method involves acquiring an image to be labeled and dividing it into at least two first grids at equal intervals; selecting a second grid from the first grids that meets preset conditions; acquiring attribute information of the image within the second grid and filtering the second grid based on this attribute information to determine a second grid suitable for creating a matching model; using the image contour within the second grid suitable for creating the matching model as a template, performing template matching within a preset range to determine a target grid; subdividing the target grid using a subdivision method to determine the subdivided grids; performing uniqueness verification on the subdivided grids to determine grids that better meet the matching labeling conditions; labeling the target grids to determine a target labeled image, and outputting the labeling position information of the target labeled image. By subdividing the acquired target grids, the method ensures that the selected grids during image labeling can contain more of the required image, allowing image information to be fully reflected in the labeled grids. Performing uniqueness verification again on the subdivided grids allows for the search for grids that better meet the matching labeling conditions around the subdivided grids, improving detection efficiency.
[0091] Example 3
[0092] Figure 3 This is a schematic diagram of an automatic image matching and marking device provided in Embodiment 3 of the present invention. The device includes: a first grid acquisition module 310, a second grid acquisition module 320, a target grid acquisition module 330, and an image position marking module 340. Wherein:
[0093] The first grid acquisition module 310 is used to acquire the image to be labeled and divide the image to be labeled into at least two first grids at equal intervals.
[0094] The second grid acquisition module 320 is used to select a grid that meets preset conditions from the first grid to obtain a second grid; wherein, meeting the preset conditions includes the number of image contours and the contrast of the first grid simultaneously meeting preset conditions;
[0095] The target grid acquisition module 330 is used to determine the target grid by using the image contour within the second grid as a template and performing template matching within a preset range; wherein, the preset range is a range area formed by expanding the second grid as the center;
[0096] The image location marking module 340 is used to mark the target grid to determine the target marked image and output the marking location information of the target marked image.
[0097] Optionally, based on the above embodiments, the second mesh acquisition module includes:
[0098] Obtain the grayscale value of the image within the first grid, and filter out grids with a contrast value less than a preset contrast threshold to determine the third grid;
[0099] Contour extraction is performed on the image within the third grid, and grids with more than a preset contour number threshold are filtered out to determine the second grid.
[0100] Based on the above embodiments, optionally, the target mesh acquisition module includes:
[0101] The image contours within the second grid are used as matching templates; wherein, the image contours within the second grid refer to contours that can contain all images within the second grid.
[0102] Based on the matching template, template matching is performed within a preset range to determine the target mesh that meets the uniqueness condition;
[0103] The uniqueness condition includes that the number of matching results is unique and the distance between the center point of the matching template and the center point of the matched template is less than a preset distance.
[0104] Optionally, based on the above embodiments, the target mesh acquisition module further includes:
[0105] Obtain the attribute information of the image within the second grid, and filter the second grid based on the attribute information to determine the second grid that can be used to create the matching model;
[0106] The attribute information of the image within the second grid includes the image outline length and the number of image corner points.
[0107] Based on the above embodiments, optionally, the step of filtering the second grid according to the attribute information to determine the second grid that can be used to create the matching model includes:
[0108] Obtain the contour length of the image within the second grid, and filter out the second grids that are less than a preset contour length threshold to determine the fourth grid;
[0109] Obtain the number of corner points in the image within the fourth grid, and filter out the fourth grids with fewer than a preset threshold number of corner points to determine the second grid that can be used to create a matching model.
[0110] Based on the above embodiments, optionally, the image location marking module includes:
[0111] The target mesh is subdivided using a subdivision method to determine the subdivided mesh;
[0112] The uniqueness of the subdivided mesh is verified to determine the mesh that better meets the matching label conditions.
[0113] The above-described apparatus can execute the image automatic matching and marking method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the image automatic matching and marking method.
[0114] Example 4
[0115] Figure 4 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of this application. This application provides an electronic device that can integrate the interactive device for automatic image matching and tagging provided in this application. Figure 4 As shown, this embodiment provides an electronic device 400, which includes: one or more processors 420; and a storage device 410 for storing one or more programs. When the one or more programs are executed by the one or more processors 420, the one or more processors 420 implement the image automatic matching and tagging method provided in this application embodiment. The method includes:
[0116] Obtain the image to be labeled, and divide the image to be labeled into at least two first grids with equal spacing;
[0117] A second grid is obtained by selecting a grid that meets preset conditions from the first grid; wherein, meeting the preset conditions includes the number of image contours and the contrast of the first grid simultaneously meeting preset conditions;
[0118] Using the image contour within the second grid as a template, template matching is performed within a preset range to determine the target grid; wherein, the preset range is a range area formed by expanding the second grid as the center;
[0119] The target grid is marked to determine the target marked image, and the marked position information of the target marked image is output.
[0120] Of course, those skilled in the art will understand that the processor 420 also implements the technical solution of the image automatic matching and marking method provided in any embodiment of this application.
[0121] Figure 4 The electronic device 400 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0122] like Figure 4 As shown, the electronic device 400 includes a processor 420, a storage device 410, an input device 430, and an output device 440; the number of processors 420 in the electronic device can be one or more. Figure 4 Taking a processor 420 as an example; the processor 420, storage device 410, input device 430, and output device 440 in the electronic device can be connected via a bus or other means. Figure 4 Taking the Sino-Israeli communication bus 450 connection as an example.
[0123] Storage device 410, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and module units, such as the program instructions corresponding to the image automatic matching and marking method in the embodiments of this application.
[0124] Storage device 410 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on terminal usage. Furthermore, storage device 410 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory, or other non-volatile solid-state storage device. In some instances, storage device 410 may further include memory remotely located relative to processor 420, which can be connected via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0125] Input device 430 can be used to receive input digital, character, or voice information, and to generate key signal inputs related to user settings and function control of the electronic device. Output device 440 may include electronic devices such as a display screen and a speaker.
[0126] The electronic device provided in this application embodiment can effectively solve the problem of automatic image matching and marking, so as to achieve automatic matching of marking positions in images, reduce the cost of manual intervention, and improve detection efficiency.
[0127] Example 5
[0128] Embodiment 5 of the present invention also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform an automatic image matching and tagging method, the method comprising:
[0129] Obtain the image to be labeled, and divide the image to be labeled into at least two first grids with equal spacing;
[0130] A second grid is obtained by selecting a grid that meets preset conditions from the first grid; wherein, meeting the preset conditions includes the number of image contours and the contrast of the first grid simultaneously meeting preset conditions;
[0131] Using the image contour within the second grid as a template, template matching is performed within a preset range to determine the target grid; wherein, the preset range is a range area formed by expanding the second grid as the center;
[0132] The target grid is marked to determine the target marked image, and the marked position information of the target marked image is output.
[0133] The computer storage medium of this invention can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, a portable CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination thereof. A computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0134] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit programs for use by or in connection with an instruction execution system, apparatus, or device.
[0135] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, radio frequency (RF), etc., or any suitable combination thereof.
[0136] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0137] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0138] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. An image automatic matching marking method characterized by, The method comprises: acquiring a to-be-labeled image, and equally spacing dividing the to-be-labeled image to obtain at least two first grids; selecting a grid satisfying a preset condition from the first grids to obtain a second grid; wherein the preset condition comprises that the number of image contours in the first grid and the contrast satisfy the preset condition at the same time; taking the image contour in the second grid as a template, and performing template matching in a preset range to determine a target grid; wherein the preset range is a range region formed by expanding the second grid as a center; labeling the target grid to determine a target labeled image, and outputting the labeling position information of the target labeled image; wherein the selecting a grid satisfying a preset condition from the first grids to obtain a second grid comprises: acquiring the gray value of the image in the first grid, and filtering out a grid with a contrast less than a preset contrast threshold value by contrast calculation to determine a third grid; extracting the contours of the image in the third grid, and filtering out a grid with a number of contours greater than a preset contour number threshold value to determine the second grid; wherein the taking the image contour in the second grid as a template, and performing template matching in a preset range to determine a target grid comprises: taking the image contour in the second grid as a matching template; wherein the image contour in the second grid refers to a contour capable of containing all the images in the second grid; and performing template matching in a preset range according to the matching template to determine a target grid satisfying a uniqueness condition; wherein the uniqueness condition comprises that the number of matching results is unique, and the distance between the center point of the matching template and the center point of the matched template is less than a preset distance.
2. The method of claim 1, wherein, The taking the image contour in the second grid as a template, and performing template matching in a preset range to determine a target grid further comprises: acquiring attribute information of the image in the second grid, and screening the second grid according to the attribute information to determine a second grid that can be used to create a matching model; wherein the attribute information of the image in the second grid comprises the contour length of the image and the number of image corner points.
3. The method of claim 2, wherein, The screening the second grid according to the attribute information to determine a second grid that can be used to create a matching model comprises: acquiring the contour length of the image in the second grid, and filtering out a second grid with a contour length less than a preset contour length threshold value to determine a fourth grid; acquiring the number of corner points of the image in the fourth grid, and filtering out a fourth grid with a number of corner points less than a preset corner point number threshold value to determine a second grid that can be used to create a matching model.
4. The method of claim 1, wherein, The labeling the target grid to determine a target labeled image, and outputting the labeling position information of the target labeled image comprises: subdividing the target grid by using a subdivision method to determine a subdivided grid; performing uniqueness verification on the subdivided grid to determine a grid that is more consistent with the matching labeling condition.
5. An image automatic matching marking apparatus characterized by comprising: The device comprises: a first grid acquisition module, configured to acquire a to-be-labeled image, and equally spacing divide the to-be-labeled image to obtain at least two first grids; a second grid acquisition module, configured to select a grid satisfying a preset condition from the first grids to obtain a second grid; wherein the preset condition comprises that the number of image contours in the first grid and the contrast satisfy the preset condition at the same time; The target grid acquisition module is configured to perform template matching in a preset range with the image contour in the second grid as a template to determine a target grid; wherein the preset range is a range region formed by expanding the second grid as a center; The image position marking module is configured to mark the target grid to determine a target marked image, and output marking position information of the target marked image; The second grid acquisition module is specifically configured to: acquire the gray value of the image in the first grid, filter out a third grid with a contrast less than a preset contrast threshold value through contrast calculation, perform contour extraction on the image in the third grid, and filter out a second grid with a contour number greater than a preset contour number threshold value; The target grid acquisition module is specifically configured to: take the image contour in the second grid as a matching template; wherein the image contour in the second grid refers to a contour capable of containing all images in the second grid; perform template matching in a preset range according to the matching template to determine a target grid satisfying a uniqueness condition; wherein the uniqueness condition includes that the number of matching results is unique and the distance between the center point of the matching template and the center point of the matched template is less than a preset distance.
6. An electronic device, comprising: comprise: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the image automatic matching marking method of any one of claims 1-4.
7. A storage medium containing computer-executable instructions, wherein: The computer executable instructions, when executed by a computer processor, are used to perform the image automatic matching marking method of any one of claims 1-4.
Citation Information
Patent Citations
Image processing method, equipment and unmanned aerial vehicle
CN109196551A
Image contour identification method and device, equipment and medium
CN110222703A
Pattern matching method, pattern matching device, and electronic component mounting method
JP2005346232A