A target localization method, apparatus, and computer device

By decomposing the target image into a multi-layer pyramid and using multiple sub-feature templates for searching, the problem of low localization accuracy when the target is occluded, missing, or deformed is solved, achieving efficient and accurate target localization.

CN115731295BActive Publication Date: 2026-03-13SHENZHEN LINGYUN VISION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-08
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

In complex contexts, where targets are obscured, partially missing, or deformed, existing technologies struggle to accurately locate them.

Method used

The target image is decomposed into a multi-layered image pyramid, and the image pyramid is searched based on multiple sub-feature templates. The target location is determined by comparing the similarity between the sub-feature templates and the target image.

Benefits of technology

It improves the accuracy of target location, reduces the amount of search computation, and increases search efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115731295B_ABST
    Figure CN115731295B_ABST
Patent Text Reader

Abstract

This application relates to the field of visual image technology, specifically to a target localization method, apparatus, and computer device, which can, to some extent, solve the problem of low localization accuracy caused by target occlusion, partial target loss, and target deformation. The target localization method includes: sampling a target image layer by layer to generate an image pyramid composed of multiple test images corresponding to the target image, wherein in the image pyramid, the higher the level of the test image, the smaller its area and the lower its resolution; the target image is located at the lowest level of the image pyramid; the target image is an image obtained after capturing the area where the target to be located is located; obtaining at least two first sub-feature templates corresponding to at least two first sub-targets in the target; searching each layer of the test images in the image pyramid based on the at least two first sub-feature templates; and determining the target contained in the target image based on the search results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of visual image technology, and more specifically, to a target localization method, apparatus, and computer device. Background Technology

[0002] Target localization is one of the important application scenarios of computer vision. It has been widely used in many fields such as industrial production, aviation and shipping, and agricultural product packaging.

[0003] In industrial production, target positioning enables precise automatic grasping and loading operations; in aviation and maritime operations, target positioning provides reliable location services for tasks such as marine salvage; and in transportation, target positioning allows for accurate acquisition of vehicle location information.

[0004] Because the images in these fields typically have very complex backgrounds, problems such as target occlusion, partial target loss, and target distortion often exist, making target localization extremely difficult. For example... Figure 1 The illustrations show examples of targets that are occluded, partially missing, and deformed. The white areas in the diagrams represent the target. Figure 1 In the diagram, (a) is a schematic diagram when the target is occluded, (b) is a schematic diagram when part of the target is missing, and (c) is a schematic diagram when the target is deformed. Summary of the Invention

[0005] To address the problem of low positioning accuracy caused by target occlusion, partial target loss, and target deformation, this application provides a target positioning method, apparatus, and computer device.

[0006] The embodiments of this application are implemented as follows:

[0007] This application provides a target localization method, the method comprising:

[0008] The target image is sampled layer by layer to generate an image pyramid consisting of multiple test images corresponding to the target image. In the image pyramid, the test images at higher levels have smaller areas and lower resolutions. The target image is located at the lowest level of the image pyramid and is an image obtained by taking pictures of the area where the target to be located is located.

[0009] Obtain at least two first sub-feature templates corresponding to at least two first sub-targets in the target;

[0010] Based on the at least two first sub-feature templates, the test image is searched in each layer of the image pyramid, and the target contained in the target image is determined based on the search results.

[0011] In some embodiments, searching the image to be tested in each layer of the image pyramid based on the at least two first sub-feature templates, and determining the target contained in the target image based on the search results, includes:

[0012] Based on at least two of the first sub-feature templates, the image to be tested is searched at the highest level of the image pyramid or layer by layer starting from the highest level of the image pyramid until the first candidate target in the image to be tested is found, and the first position information of the first candidate target in the image to be tested is determined, wherein the similarity between the features of the first candidate target and at least two of the first sub-feature templates is greater than a first threshold.

[0013] The first region is searched layer by layer according to the sub-feature template corresponding to the first candidate target until the first target contained in the target image is found, and the target location information of the first target in the target image is determined. The first region is determined based on the first location information, the first region is located in the lower layer of the first target, and the target includes the first target.

[0014] In some embodiments, obtaining at least two first sub-feature templates corresponding to at least two first sub-targets in the target includes:

[0015] Obtain a template image and the ROI region of the template image. The template image contains the target to be located and the image quality meets preset conditions. The ROI region contains the area where the target to be located is located.

[0016] The target contained in the ROI region is divided into at least two first sub-targets according to a first division method, wherein the first division method is any one of three: horizontal cutting, vertical cutting, and a combination of horizontal cutting and vertical cutting;

[0017] Obtain a first sub-feature template for each of the first sub-targets. The first sub-feature template includes a contour feature template, a grayscale feature template, a color feature template, a normalized cross-correlation feature template, a HOG feature template, or a SIFT feature template.

[0018] In some embodiments, after determining the target contained in the target image based on the search results, the method further includes:

[0019] Obtain at least two second sub-feature templates corresponding to at least two second sub-targets in the target;

[0020] The image to be tested is searched in each layer of the image pyramid based on the at least two second sub-feature templates, and the target contained in the target image is determined based on the search results;

[0021] Determine the union of a first target and a second target, wherein the first target is a target in the target image determined by the first sub-feature template, and the second target is a target in the target image determined by the second sub-feature template, and the targets in the target image include the union.

[0022] In some embodiments, obtaining at least two second sub-feature templates corresponding to at least two second sub-targets in the target includes:

[0023] Obtain a template image and the ROI region of the template image, wherein the template image contains the target to be located and the image resolution is greater than a second threshold, and the ROI region contains the area where the target to be located is located;

[0024] The target contained in the ROI region is divided into at least two second sub-targets according to a second division method. The second division method can be selected from one of three types: horizontal cutting, vertical cutting, and a combination of horizontal cutting and vertical cutting. The second division method is different from the first division method.

[0025] Obtain the second sub-feature template for each second sub-target. The second sub-feature template includes a contour feature template, a grayscale feature template, a color feature template, a normalized cross-correlation feature template, a HOG feature template, or a SIFT feature template.

[0026] In some embodiments, when the first region is located in the target image, the first region is searched layer by layer according to the sub-feature template corresponding to the first candidate target until the first target contained in the target image is found, including:

[0027] The first region is searched according to the sub-feature template corresponding to the first candidate target to obtain the second candidate target contained in the first region. The feature type of the second candidate target corresponds to the sub-feature template corresponding to the first candidate target.

[0028] A similarity threshold is preset based on the sub-feature template corresponding to the first candidate target;

[0029] Compare the similarity between the features of the second candidate target and the first sub-feature template;

[0030] The second candidate target with a similarity greater than or equal to the similarity threshold is determined as the first target.

[0031] In some embodiments, when the first region closest to the first candidate target is located in a layer other than the target image, the first region is searched layer by layer according to the sub-feature template corresponding to the first candidate target until the first target contained in the target image is found, including:

[0032] Obtain the third candidate target contained in the first target region and the image features of the third candidate target. The image features of the third candidate target correspond to the feature template corresponding to the first candidate target. The first target region belongs to the first region and is located in the next layer below the layer where the first candidate target is located.

[0033] A similarity threshold is preset based on the sub-feature template corresponding to the first candidate target;

[0034] Compare the similarity between the image features of the third candidate target and the corresponding sub-feature template;

[0035] The third candidate target with a similarity greater than or equal to the similarity threshold is determined as the fourth candidate target;

[0036] Based on the fourth location information of the fourth candidate target and the corresponding sub-feature template features, the search is performed layer by layer on other first regions outside the first target region until the first target contained in the target image is found.

[0037] In some embodiments, searching the first region based on the sub-feature template corresponding to the first candidate target yields a second candidate target contained in the first region, including:

[0038] Sliding windows of different sizes are slid across the first region. During the sliding process, the image within the sliding window is the second candidate target. The size of the sliding window is determined based on the size of the sub-target.

[0039] Extract the image features of the second candidate target, and the image features correspond to the features of the sub-feature template corresponding to the first candidate target.

[0040] Another embodiment of this application provides a target positioning device, characterized in that it includes:

[0041] The generation module is used to sample the target image layer by layer to generate an image pyramid composed of multiple test images corresponding to the target image. In the image pyramid, the test images at higher levels have smaller areas and lower resolutions. The target image is located at the lowest level of the image pyramid and is an image obtained by taking pictures of the area where the target to be located is located.

[0042] The acquisition module is used to acquire at least two first sub-feature templates corresponding to at least two first sub-targets in the target;

[0043] The search module is used to search the image to be tested in each layer of the image pyramid based on the at least two first sub-feature templates, and to determine the target contained in the target image based on the search results.

[0044] Another embodiment of this application provides a computer device, including a memory and a processor, wherein the processor executes a computer program to implement the steps of the target localization method described in any of the above claims.

[0045] The beneficial effects of this application are as follows: By dividing the target into at least two sub-targets, each sub-target including some features of the target, and establishing at least two sub-feature templates based on the at least two sub-targets, the target image is searched through the sub-feature templates. Even if the target is occluded, partially missing, or deformed, the area of ​​the target that is not occluded, missing, or deformed still contains some features of the target. The similarity of the partial features containing the target with the sub-feature template is compared. When the similarity between the partial features containing the target and the sub-feature template is higher than the similarity threshold, the area containing the partial features is determined to be the target, thus improving the accuracy of localization.

[0046] For example, if the target to be located in the target image is partially occluded, when locating the target using the target feature template corresponding to the target, the partially occluded target will not be located due to the low similarity between the partially occluded target and the target feature template, resulting in low positioning accuracy. In this case, the solution of this application uses at least two sub-feature templates for target positioning. When the image features of at least some areas of the partially occluded target have a similarity to the sub-feature template that reaches a threshold, the partially occluded target can be determined as the target to be located, which can improve the positioning accuracy.

[0047] Furthermore, this application determines an image pyramid based on the target image, and then searches the image pyramid based on at least two sub-feature templates, which avoids searching the entire target image region and achieves the goal of low computational cost and high search efficiency during the search. Attached Figure Description

[0048] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0049] Figure 1Exemplary diagrams are shown for a target that is occluded, partially missing, and deformed; wherein, (a) is a diagram for a target that is occluded, (b) is a diagram for a target that is partially missing, and (c) is a diagram for a target that is deformed.

[0050] Figure 2 An exemplary flowchart of a target localization method provided in an embodiment of this application is shown;

[0051] Figure 3 An exemplary schematic diagram of the structure of an image pyramid provided in another embodiment of this application is shown;

[0052] Figure 4 An exemplary flowchart of a method for generating sub-template features based on a target is shown in another embodiment of this application;

[0053] Figure 5 An exemplary diagram is shown of a first sub-feature template corresponding to each first sub-target provided in another embodiment of this application;

[0054] Figure 6 An exemplary flowchart illustrates a method for determining the target contained in a target image by searching each layer of the image pyramid based on at least two first sub-feature templates, according to another embodiment of this application.

[0055] Figure 7 An exemplary flowchart of a method for searching a first region until a target in a target image is found, provided in another embodiment of this application;

[0056] Figure 8 An exemplary flowchart illustrates a method for searching a first region to obtain a second candidate target contained in the first region, according to another embodiment of this application.

[0057] Figure 9 An exemplary flowchart of a method provided in another embodiment of this application is shown, which searches for a first region until a target in the target image is found when the first region closest to the first candidate target is located in another layer outside the target image;

[0058] Figure 10 An exemplary flowchart illustrates a method for searching for a second target contained in a target image within an image pyramid after determining the target contained in the target image based on search results, according to another embodiment of this application.

[0059] Figure 11 An exemplary structural block diagram of a target positioning device provided in another embodiment of this application is shown. Detailed Implementation

[0060] To make the objectives, implementation methods and advantages of this application clearer, the exemplary implementation methods of this application will be clearly and completely described below with reference to the accompanying drawings of the exemplary embodiments of this application. Obviously, the described exemplary embodiments are only some embodiments of this application, and not all embodiments.

[0061] It should be noted that the brief descriptions of terms in this application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning.

[0062] The terms "first," "second," "third," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar or related objects or entities, and do not necessarily imply a specific order or sequence, unless otherwise specified. It should be understood that such terms are interchangeable where appropriate.

[0063] The terms “include” and “have”, and any variations thereof, are intended to cover but not exclusively include, for example, a product or device that includes a range of components is not necessarily limited to all of the components that are clearly listed, but may include other components that are not clearly listed or that are inherent to such product or device.

[0064] The terms "setup" and "connection" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of these terms in this application based on the specific circumstances.

[0065] Figure 2 An exemplary flowchart of a target localization method provided in an embodiment of this application is shown, such as... Figure 2 As shown, the target localization method is implemented through the following steps:

[0066] Step 210: Sample the target image layer by layer to generate an image pyramid consisting of multiple test images corresponding to the target image. In the image pyramid, the higher the level of the test image, the smaller the area and the lower the resolution. The target image is located at the lowest level of the image pyramid and is an image obtained after taking pictures of the area where the target to be located is located.

[0067] An image pyramid is a multi-scale representation of an image, an efficient yet conceptually simple structure for interpreting images at multiple resolutions. An image pyramid is a collection of images arranged in a pyramid shape, with progressively decreasing resolutions, all originating from the same original image. It is obtained through stepwise downsampling until a certain termination condition is met. We can liken the layers of the image to a pyramid, with high-resolution images at the base and low-resolution images at the top; the higher the layer, the smaller the image and the lower the resolution.

[0068] There are two main methods for generating image pyramids: downsampling and upsampling. This application uses downsampling to generate the image pyramid. Downsampling involves converting the image from GO (the target image) to G1 (the first layer of the image to be tested), G2 (the second layer), and G3 (the third layer), a process of continuously decreasing image resolution. For example... Figure 3 An exemplary schematic diagram of the structure of an image pyramid provided in another embodiment of this application is shown.

[0069] Step 220: Obtain at least two first sub-feature templates corresponding to at least two first sub-targets in the target.

[0070] Figure 4 An exemplary flowchart of a method for generating sub-templates based on target features is shown in another embodiment of this application, such as... Figure 4 As shown, obtaining at least two first sub-feature templates corresponding to at least two first sub-targets in the target is achieved through the following steps:

[0071] Step 410: Obtain the template image and the region of interest (ROI) of the template image. The template image contains the target to be located and the image quality meets the preset conditions. The ROI region contains the area where the target to be located is located.

[0072] Generally, the higher the image resolution, the more pixels it contains, and the clearer the image. Therefore, image quality can be characterized by parameters such as image resolution or sharpness. When the image resolution or sharpness meets preset conditions, the image quality is high and can clearly reflect the details in the image.

[0073] Step 420: Divide the targets contained in the ROI region into at least two first sub-targets according to the first division method. The first division method is any one of three: horizontal cutting, vertical cutting, and a combination of horizontal cutting and vertical cutting.

[0074] Step 430: Obtain the first sub-feature template for each first sub-target. The first sub-feature template includes a contour feature template, a grayscale feature template, a color feature template, a normalized cross-correlation feature template, a HOG feature template, or a SIFT feature template.

[0075] The contour features refer to the gradient direction at areas with high black-and-white contrast; the grayscale features refer to the grayscale values ​​of all pixels within the ROI region; the normalized cross-correlation features are used to compare the similarity between two images; the HOG feature (Histogram of Oriented Gradient) is constructed by calculating and statistically analyzing the gradient orientation histograms of local image regions; and the SIFT feature (Scale Invariant Feature Transform) is an algorithm that helps machines identify and match feature points in different images, enabling the search for feature points in different images at different scales.

[0076] Figure 5 An exemplary diagram is shown of a first sub-feature template corresponding to each first sub-target provided in another embodiment of this application. These sub-feature templates are all established based on the contour features of each first sub-target. For example... Figure 5 As shown, the target is divided into four first sub-targets by a combination of horizontal and vertical cutting. Each of the four first sub-targets exhibits one of the four local features of the target. Figure 5 The white area in the diagram represents the first sub-target, and the thick gray lines along the edges of each first sub-target are used to indicate its outline features.

[0077] Step 230: Search the image to be tested in each layer of the image pyramid based on at least two first sub-feature templates, and determine the target contained in the target image based on the search results.

[0078] Figure 6 An exemplary flowchart illustrates a method for determining targets contained in a target image by searching each layer of the image pyramid based on at least two first sub-feature templates, according to another embodiment of this application. Figure 6 As shown, the image to be tested is searched at each layer of the image pyramid based on at least two first sub-feature templates, and the target contained in the target image is determined based on the search results, including the following steps:

[0079] Step 610: Based on at least two first sub-feature templates, search the image to be tested at the highest level of the image pyramid or by starting from the highest level of the image pyramid layer by layer until the first candidate target in the image to be tested is found, and determine the first position information of the first candidate target in the image to be tested, wherein the similarity between the features of the first candidate target and at least two first sub-feature templates is greater than the first threshold.

[0080] In some embodiments, since the highest-level image to be tested has low resolution and small image area, starting the search from the highest-level image to be tested can reduce the amount of computation during the search and improve search efficiency.

[0081] During the search, firstly, a sliding window method is used to select a window on the highest-level image to be tested, and the features of the image within the window are extracted, and the extracted features must correspond to the feature types of the sub-feature template; then, the similarity between the image features within the sliding window and the sub-feature template corresponding to the first candidate target is compared; finally, the image in the sliding window corresponding to the image features with a similarity greater than or equal to the similarity threshold is determined as the first candidate target.

[0082] Step 620: Search the first region layer by layer according to the sub-feature template corresponding to the first candidate target until the first target contained in the target image is found, and determine the target location information of the first target in the target image. The first region is determined based on the first location information. The first region is located in the lower layer of the layer where the first target is located, and the target includes the first target.

[0083] In some embodiments, the first location information is the first location coordinates, represented as (A, B); the range of the first region is from (nA-m, nB-m) to (nA+m, nB+m), where n and m are both constants and multiples of 2.

[0084] The first region is located in every layer of the image to be tested except for the layer containing the first target. The size of the first region is determined based on the location information of the suspected target obtained from the search of the layer above it. By determining the first region using the location information of the first target, and then searching the first region, it is not necessary to search the entire image to be tested containing the first region, which improves search efficiency and reduces the amount of search computation.

[0085] We discuss two cases: the first region is located in the target image (the image to be tested at the bottom of the image pyramid), and the first region closest to the first target is located in another layer outside the target image.

[0086] In some embodiments, Figure 7 An exemplary flowchart illustrates a method for searching a first region until a target image is found when the first region is located within the target image, according to another embodiment of this application. Figure 7 As shown, when the first region is located in the target image, the first region is searched layer by layer according to the sub-feature template corresponding to the first candidate target until the first target contained in the target image is found. This includes the following steps:

[0087] Step 710: Search the first region according to the sub-feature template corresponding to the first candidate target to obtain the second candidate target contained in the first region. The feature type of the second candidate target corresponds to the sub-feature template corresponding to the first candidate target.

[0088] Figure 8 An exemplary flowchart illustrates a method for searching a first region to obtain a second candidate target contained within that first region, according to another embodiment of this application. Figure 8 As shown, the first region is searched based on the sub-feature template corresponding to the first candidate target to obtain the second candidate target contained in the first region. This is achieved through the following steps:

[0089] Step 810: Slide windows of different scales over the first region. During the sliding process, the image inside the sliding window is the second candidate target. The scale of the sliding window is determined based on the scale of the sub-target.

[0090] The sliding window traverses the first region during the sliding process. The scale of the sliding window is the same as the scale of the sub-target, which allows for comparison of the similarity between the image within the window and the sub-feature template. Of course, the scale of the sliding window can also be larger than the scale of the sub-target.

[0091] Step 820: Extract the image features of the second candidate target, and the image features correspond to the features of the sub-feature template corresponding to the first candidate target.

[0092] The image features of the second candidate target include contour features, grayscale features, color features, normalized cross-correlation features, HOG features, or SIFT features. Since it is necessary to determine whether the second candidate target is the first target based on similarity later, the image features of the second candidate target extracted here must be the same as the features of the sub-feature template corresponding to the first candidate target.

[0093] The contour features refer to the gradient direction at areas with high black-and-white contrast; the grayscale features refer to the grayscale values ​​of all pixels within the ROI region; the normalized cross-correlation features are used to compare the similarity between two images; the HOG feature (Histogram of Oriented Gradient) is constructed by calculating and statistically analyzing the gradient orientation histograms of local image regions; and the SIFT feature (Scale Invariant Feature Transform) is an algorithm that helps machines identify and match feature points in different images, enabling the search for feature points in different images at different scales.

[0094] Since the sub-template features include some features of the target, such as the high similarity between the image features within the sliding window and the sub-template features, the image within the sliding window is determined to be a candidate target. Simultaneously, using a sliding window approach to traverse and search for second candidate targets in the first region improves search efficiency and reduces the likelihood of missed detections.

[0095] Step 720: Preset a similarity threshold based on the sub-feature template corresponding to the first candidate target;

[0096] Step 730: Compare the similarity between the features of the second candidate target and the first sub-feature template;

[0097] Step 740: The second candidate target with a similarity greater than or equal to the similarity threshold is determined as the first target.

[0098] In some embodiments, Figure 9 An exemplary flowchart illustrates a method provided in another embodiment of this application for searching a first region until a target in the target image is found when the first region closest to the first candidate target is located in another layer outside the target image. Figure 9 As shown, when the first region closest to the first candidate target is located in other layers outside the target image, the first region is searched layer by layer according to the sub-feature template corresponding to the first candidate target until the first target contained in the target image is found. This includes the following steps:

[0099] Step 910: Obtain the third candidate target contained in the first target region and the image features of the third candidate target. The image features of the third candidate target correspond to the feature template corresponding to the first candidate target. The first target region belongs to the first region and is located in the next layer below the layer where the first candidate target is located.

[0100] In some embodiments, sliding windows of different scales are used to slide over the first target region. During the sliding process, the image inside the sliding window is the third candidate target. Image features of the third candidate target are extracted. The scale of the sliding window is determined based on the scale of the sub-target. The image features correspond to the features of the sub-feature template corresponding to the first candidate target.

[0101] Step 920: Preset a similarity threshold based on the sub-feature template corresponding to the first candidate target;

[0102] Step 930: Compare the similarity between the image features of the third candidate target and the corresponding sub-feature template;

[0103] Step 940: The third candidate target with a similarity greater than or equal to the similarity threshold is determined as the fourth candidate target;

[0104] Step 950: Based on the fourth position information of the fourth candidate target and the corresponding sub-feature template features, search the other first regions outside the first target region layer by layer until the first target contained in the target image is found.

[0105] In some embodiments, after dividing the target into first sub-targets and generating corresponding first sub-template features, and then searching the image pyramid based on the first sub-template features (see steps 210-230), we further divide the target into multiple second sub-targets. The features contained in the first sub-targets are different from those contained in the second sub-targets. Then, based on the second sub-targets, we generate corresponding second sub-feature templates, and search the image pyramid based on the second sub-feature templates to obtain the second targets contained in the target image. The union of the first target and the second target is the target searched from the target image by the target localization method of this application.

[0106] Figure 10 An exemplary flowchart illustrates a method for searching for a second target contained in a target image within an image pyramid after determining the target contained in the target image based on search results, according to another embodiment of this application. Figure 10 As shown, after determining the target contained in the target image based on the search results, the following steps are also included:

[0107] Step 1010: Obtain at least two second sub-feature templates corresponding to at least two second sub-targets in the target;

[0108] In some embodiments, a template image and a region of interest (ROI) of the template image are obtained. The template image contains the target to be located and the image resolution is greater than a second threshold. The ROI region contains the region where the target to be located is located.

[0109] The targets contained in the ROI region are divided into at least two second sub-targets according to the second division method. The second division method can be one of three types: horizontal cutting, vertical cutting, and a combination of horizontal cutting and vertical cutting. The second division method is different from the first division method.

[0110] Obtain the second sub-feature template for each second sub-target. The second sub-feature template includes contour feature template, grayscale feature template, color feature template, normalized cross-correlation feature template, HOG feature template, or SIFT feature template.

[0111] Step 1020: Search the image to be tested in each layer of the image pyramid based on at least two second sub-feature templates, and determine the target contained in the target image based on the search results;

[0112] In some embodiments, the process of searching the image pyramid based on the second sub-feature template is the same as the search principle shown in steps 810-820.

[0113] Step 1030: Determine the union of the first target and the second target. The first target is the target in the target image determined by the first sub-feature template, and the second target is the target in the target image determined by the second sub-feature template. The targets in the target image include the union.

[0114] In this application, by dividing the target into at least two sub-targets, each sub-target including some features of the target, and establishing at least two sub-feature templates based on the at least two sub-targets, the target image is searched using the sub-feature templates. Even if the target is occluded, partially missing, or deformed, the regions of the target that are not occluded, missing, or deformed still contain some features of the target. The similarity of the partial features containing the target with the sub-feature templates is compared. When the similarity between the partial features containing the target and the sub-feature templates is higher than the similarity threshold, the region containing the partial features is determined to be the target, thus improving the accuracy of localization.

[0115] For example, if the target image contains a partially occluded target, when locating the target using the target feature template, the partially occluded target may not be located due to the low similarity between the partially occluded target and the target feature template, resulting in low location accuracy. In this case, the solution of this application utilizes at least two sub-feature templates for target location. When the image features of at least some areas of the partially occluded target have a similarity to the sub-feature template that reaches a threshold, the partially occluded target can be determined as the target to be located, thereby improving the location accuracy.

[0116] Furthermore, this application determines an image pyramid based on the target image, and then searches the image pyramid based on at least two sub-feature templates, which avoids searching the entire target image region and achieves the goal of low computational cost and high search efficiency during the search.

[0117] Figure 11 An exemplary structural block diagram of a target positioning device provided in another embodiment of this application is shown, such as... Figure 11 As shown, the target positioning device 1100 includes: a generation module 1110, an acquisition module 1120, and a search module 1130, wherein:

[0118] The generation module is used to sample the target image layer by layer to generate an image pyramid consisting of multiple test images corresponding to the target image. In the image pyramid, the higher the level of the test image, the smaller the area and the lower the resolution. The target image is located at the lowest level of the image pyramid and is the image obtained after taking pictures of the area where the target to be located is located.

[0119] The acquisition module is used to acquire at least two first sub-feature templates corresponding to at least two first sub-targets in the target;

[0120] The search module is used to search the image to be tested in each layer of the image pyramid based on at least two first sub-feature templates, and to determine the target contained in the target image based on the search results.

[0121] Its implementation principle and technical effect are similar to those of the above-described method embodiments, and will not be repeated here.

[0122] In some embodiments, a computer device is provided, including a memory and a processor, wherein the processor executes a computer program to implement the steps of the target localization method described above. Its implementation principle and technical effects are similar to those of the method embodiments described above, and will not be repeated here.

[0123] In some embodiments, a computer-readable storage medium is provided, storing instructions that, when executed on a computer, cause the computer to perform the steps of the target localization method described above. Its implementation principle and technical effects are similar to those of the method embodiments described above, and will not be repeated here.

[0124] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0125] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0126] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0127] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A target localization method, characterized in that, The method includes: The target image is sampled layer by layer to generate an image pyramid consisting of multiple test images corresponding to the target image. In the image pyramid, the test images at higher levels have smaller areas and lower resolutions. The target image is located at the lowest level of the image pyramid and is an image obtained by taking pictures of the area where the target to be located is located. Obtain at least two first sub-feature templates corresponding to at least two first sub-targets in the target; Based on the at least two first sub-feature templates, the image to be tested is searched at each layer of the image pyramid, and the target contained in the target image is determined based on the search results, including: Based on at least two of the first sub-feature templates, the image to be tested is searched at the highest level of the image pyramid or layer by layer starting from the highest level of the image pyramid until the first candidate target in the image to be tested is found, and the first position information of the first candidate target in the image to be tested is determined, wherein the similarity between the features of the first candidate target and at least two of the first sub-feature templates is greater than a first threshold. The first region is searched layer by layer according to the sub-feature template corresponding to the first candidate target until the first target contained in the target image is found, and the target location information of the first target in the target image is determined. The first region is determined based on the first location information. The first region is located in the lower layer of the first target. The target includes the first target. When the first region is located in the target image, the first region is searched layer by layer according to the sub-feature template corresponding to the first candidate target until the first target contained in the target image is found, including: The first region is searched according to the sub-feature template corresponding to the first candidate target to obtain the second candidate target contained in the first region. The feature type of the second candidate target corresponds to the sub-feature template corresponding to the first candidate target. A similarity threshold is preset based on the sub-feature template corresponding to the first candidate target; Compare the similarity between the features of the second candidate target and the first sub-feature template; The second candidate target with a similarity greater than or equal to the similarity threshold is determined as the first target; When the first region closest to the first candidate target is located in a layer other than the target image, the first region is searched layer by layer according to the sub-feature template corresponding to the first candidate target until the first target contained in the target image is found, including: Obtain the third candidate target contained in the first target region and the image features of the third candidate target. The image features of the third candidate target correspond to the feature template corresponding to the first candidate target. The first target region belongs to the first region and is located in the next layer below the layer where the first candidate target is located. A similarity threshold is preset based on the sub-feature template corresponding to the first candidate target; Compare the similarity between the image features of the third candidate target and the corresponding sub-feature template; The third candidate target with a similarity greater than or equal to the similarity threshold is determined as the fourth candidate target; Based on the fourth location information of the fourth candidate target and the corresponding sub-feature template features, the search is performed layer by layer on other first regions outside the first target region until the first target contained in the target image is found.

2. The target localization method as described in claim 1, characterized in that, Obtain at least two first sub-feature templates corresponding to at least two first sub-targets in the target, including: Obtain a template image and the ROI region of the template image. The template image contains the target to be located and the image quality meets preset conditions. The ROI region contains the area where the target to be located is located. The target contained in the ROI region is divided into at least two first sub-targets according to a first division method, wherein the first division method is any one of three: horizontal cutting, vertical cutting, and a combination of horizontal cutting and vertical cutting; Obtain a first sub-feature template for each of the first sub-targets. The first sub-feature template includes a contour feature template, a grayscale feature template, a color feature template, a normalized cross-correlation feature template, a HOG feature template, or a SIFT feature template.

3. The target localization method as described in claim 1, characterized in that, After determining the target contained in the target image based on the search results, the method further includes: Obtain at least two second sub-feature templates corresponding to at least two second sub-targets in the target; The image to be tested is searched in each layer of the image pyramid based on the at least two second sub-feature templates, and the target contained in the target image is determined based on the search results; Determine the union of a first target and a second target, wherein the first target is a target in the target image determined by the first sub-feature template, and the second target is a target in the target image determined by the second sub-feature template, and the targets in the target image include the union.

4. The target localization method as described in claim 3, characterized in that, Obtain at least two second sub-feature templates corresponding to at least two second sub-targets in the target, including: Obtain a template image and the ROI region of the template image, wherein the template image contains the target to be located and the image resolution is greater than a second threshold, and the ROI region contains the area where the target to be located is located; The target contained in the ROI region is divided into at least two second sub-targets according to a second division method. The second division method can be selected from one of three types: horizontal cutting, vertical cutting, and a combination of horizontal cutting and vertical cutting. The second division method is different from the first division method. Obtain the second sub-feature template for each second sub-target. The second sub-feature template includes a contour feature template, a grayscale feature template, a color feature template, a normalized cross-correlation feature template, a HOG feature template, or a SIFT feature template.

5. The target localization method as described in claim 1, characterized in that, The first region is searched based on the sub-feature template corresponding to the first candidate target to obtain the second candidate target contained in the first region, including: Sliding windows of different sizes are slid across the first region. During the sliding process, the image within the sliding window is the second candidate target. The size of the sliding window is determined based on the size of the sub-target. Extract the image features of the second candidate target, and the image features correspond to the features of the sub-feature template corresponding to the first candidate target.

6. A target positioning device, applied to the target positioning method of claim 1, characterized in that, include: The generation module is used to sample the target image layer by layer to generate an image pyramid composed of multiple test images corresponding to the target image. In the image pyramid, the test images at higher levels have smaller areas and lower resolutions. The target image is located at the lowest level of the image pyramid and is an image obtained by taking pictures of the area where the target to be located is located. The acquisition module is used to acquire at least two first sub-feature templates corresponding to at least two first sub-targets in the target; The search module is used to search the image to be tested in each layer of the image pyramid based on the at least two first sub-feature templates, and to determine the target contained in the target image based on the search results.

7. A computer device, characterized in that, It includes a memory and a processor, wherein the processor, when executing a computer program, implements the steps of the target localization method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Image fast matching algorithm based on Log-Polar transformation

    CN110660092A

  • Target positioning method and device, electronic equipment and storage medium

    CN114972540A