Target object positioning method, device, electronic device and readable storage medium

By establishing a feature distance score map in image processing, the problems of inflexible object positioning, long time consumption and high computational complexity in the existing technology are solved, and efficient and flexible object positioning is achieved.

CN113255655BActive Publication Date: 2025-09-16GUANGZHOU HUYA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010088961.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-02-12
Publication Date
2025-09-16
Estimated Expiration
2040-02-12

AI Technical Summary

Technical Problem

Existing technologies have problems in object positioning, such as low positioning flexibility, long positioning time and large positioning calculation volume. In particular, it is difficult to effectively locate objects in the face of partial occlusion, rotation or inconsistent sizes.

Method used

By extracting image features from the image to be detected and the template image, a feature distance score map is established, and the preset score range in the feature distance score map is used to determine the position of the target object in the image to be detected. This avoids the limitations of traditional methods on image content and size, and reduces dependence on neural network models.

Benefits of technology

The flexibility and efficiency of object positioning are improved, the amount of calculation is reduced, and fast and accurate object positioning is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113255655B_ABST
    Figure CN113255655B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a method, device, electronic device, and readable storage medium for locating a target object, and relate to the field of image processing. The present application extracts the image features corresponding to the image to be detected and the template image including the target object, and then establishes a feature distance score map for representing the feature mapping relationship between the image features of the template image in the image to be detected based on the image features of the two images. Finally, by determining the position of the image area in the feature distance score map whose feature distance score is not less than a preset score threshold corresponding to the target object, the position information matching the target object feature in the image to be detected is obtained, thereby achieving the effect of improving positioning flexibility and positioning efficiency and reducing the amount of positioning calculation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to a method, device, electronic device and readable storage medium for locating a target object. Background Art

[0002] With the continuous development of image processing technology, image retrieval and positioning technology, which can locate the position of the same object or the same type of objects in different images, has been increasingly used in fields such as face recognition, object tracking, and character recognition. Experiencers have further requirements for the object positioning flexibility, object positioning efficiency, and the amount of calculation in the object positioning process of image retrieval and positioning technology. Therefore, how to improve and provide a target object positioning solution with high object positioning flexibility, small positioning calculation amount and high positioning efficiency is a technical problem that urgently needs to be solved. Summary of the Invention

[0003] In view of this, the purpose of this application is to provide a target object positioning method, device, electronic device and readable storage medium, which can effectively improve the positioning flexibility and efficiency of the target object and reduce the computational complexity of the entire object positioning process to a certain extent.

[0004] In order to achieve the above objectives, the technical solutions adopted in the embodiments of the present application are as follows:

[0005] In a first aspect, an embodiment of the present application provides a method for locating a target object, the method comprising:

[0006] Performing image feature extraction on the image to be detected and the template image including the target object respectively to obtain a first image feature of the template image and a second image feature of the image to be detected;

[0007] determining, based on the first image feature and the second image feature, a feature distance score map between the template image and the image to be detected, for representing an image feature mapping relationship;

[0008] The mapping position of the target area of ​​the feature distance score map in the image to be detected is used as the target positioning position of the target object in the image to be detected, wherein the target area is an image area where the feature distance score of the feature distance score map is within a preset score range corresponding to the target object.

[0009] In an optional embodiment, determining, based on the first image feature and the second image feature, a feature distance score map for representing an image feature mapping relationship between the template image and the image to be detected includes:

[0010] calculating a feature similarity between each first image feature and each second image feature;

[0011] Calculating a first likelihood function value of each first image feature relative to each second image feature based on the obtained similarities of the features, and calculating a second likelihood function value of each second image feature relative to each first image feature;

[0012] Performing a multiplication operation on the first likelihood function value and the second likelihood function value under the same first image feature and the same second image feature to obtain a likelihood function product value between each first image feature and each second image feature;

[0013] The objective function product value is screened from all the calculated likelihood function product values ​​for image expression to obtain the feature distance score map, wherein each of the objective function product values ​​is expressed as a feature distance score in the feature distance score map.

[0014] In an optional embodiment, a calculation formula for the first likelihood function value of the first image feature relative to the second image feature is as follows:

[0015]

[0016] in, Used to indicate the first The second image feature, used to represent the total number of second image features in the image to be detected, used to represent a second image feature in the image to be detected, used to represent a first image feature in the template image, Used to represent the first image feature Relative to the second image feature The first likelihood function value of Used to indicate the feature similarity between two corresponding image features.

[0017] In an optional embodiment, a calculation formula for the second likelihood function value of the second image feature relative to the first image feature is as follows:

[0018]

[0019] in, For indicating the first The first image feature, used to represent the total number of first image features in the template image, used to represent a second image feature in the image to be detected, used to represent a first image feature in the template image, Used to represent the second image feature Relative to the first image feature The second likelihood function value of Used to indicate the feature similarity between two corresponding image features.

[0020] In an optional embodiment, the step of selecting the target function product value from all the calculated likelihood function product values ​​for image expression to obtain the feature distance score map includes:

[0021] Among all likelihood function product values ​​corresponding to each first image feature, selecting a maximum likelihood function product value as the target function product value corresponding to the first image feature;

[0022] Arranging the corresponding objective function product values ​​into image elements according to the position distribution of each first image feature in the template image;

[0023] The obtained image element arrangement result is expressed as an image to obtain the feature distance score map.

[0024] In an optional embodiment, the step of selecting the target function product value from all the calculated likelihood function product values ​​for image expression to obtain the feature distance score map includes:

[0025] Among all likelihood function product values ​​corresponding to each second image feature, selecting a maximum likelihood function product value as the target function product value corresponding to the second image feature;

[0026] Arranging the corresponding objective function product values ​​into image elements according to the position distribution of each second image feature in the image to be detected;

[0027] The obtained image element arrangement result is expressed as an image to obtain the feature distance score map.

[0028] In an optional embodiment, the mapping position of the target area of ​​the feature distance score map in the image to be detected as the target positioning position of the target object in the image to be detected includes:

[0029] Scaling the feature distance score map according to the size of the image to be detected to obtain a target score map with a size consistent with that of the image to be detected;

[0030] An image positioning region having a feature distance score within the preset score range is determined in the target score map, and then position information of the image positioning region in the target score map is used as the target positioning position.

[0031] In an optional embodiment, the mapping position of the target area of ​​the feature distance score map in the image to be detected as the target positioning position of the target object in the image to be detected includes:

[0032] Determine the regional position coordinates of the target area in the feature distance score map;

[0033] According to the coordinate mapping relationship between the feature distance score map and the image to be detected, the coordinates of the region position are transformed, and then the object positioning coordinates obtained by the transformation are used as the target positioning position.

[0034] In a second aspect, an embodiment of the present application provides a target object positioning device, the device comprising:

[0035] An image feature extraction module is used to extract image features from the image to be detected and the template image including the target object, respectively, to obtain a first image feature of the template image and a second image feature of the image to be detected;

[0036] a feature distance processing module, configured to determine a feature distance score map representing an image feature mapping relationship between the template image and the image to be detected based on the first image feature and the second image feature;

[0037] An object image positioning module is configured to use a mapping position of a target area of ​​the feature distance score map in the image to be detected as a target positioning position of the target object in the image to be detected, wherein the target area is an image area whose feature distance score of the feature distance score map is within a preset score range corresponding to the target object.

[0038] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor can execute the machine-executable instructions to implement the target object positioning method described in any one of the aforementioned embodiments.

[0039] In a fourth aspect, an embodiment of the present application provides a readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the target object positioning method described in any one of the aforementioned embodiments is implemented.

[0040] This application has the following beneficial effects:

[0041] The present application extracts the image features corresponding to the image to be detected and the template image including the target object, and then establishes a feature distance score map representing the feature mapping relationship between the image features of the template image in the image to be detected based on the image features of each of the two images. Finally, by determining the position of the image area in the feature distance score map whose feature distance score is not less than a preset score threshold corresponding to the target object mapped to the image to be detected, the position information of the target object feature matching in the image to be detected is obtained, thereby achieving the effect of improving positioning flexibility and positioning efficiency and reducing the amount of positioning calculation.

[0042] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.

[0044] Figure 1 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0045] Figure 2 A flowchart of a target object positioning method provided in an embodiment of the present application;

[0046] Figure 3 An application diagram of the target object positioning method provided in an embodiment of the present application;

[0047] Figure 4 for Figure 2 A schematic flow chart of the sub-steps included in step S220;

[0048] Figure 5 for Figure 2 One of the flowcharts of the sub-steps included in step S230;

[0049] Figure 6 for Figure 2 2 is a flow chart of the sub-steps included in step S230;

[0050] Figure 7 A schematic diagram of the functional modules of the target object positioning device provided in an embodiment of the present application.

[0051] Icons: 10 - electronic device; 11 - memory; 12 - processor; 13 - communication unit; 100 - target object positioning device; 110 - image feature extraction module; 120 - feature distance processing module; 130 - object image positioning module. DETAILED DESCRIPTION

[0052] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Generally, the components of the embodiments of the present application described and shown in the drawings herein can be arranged and designed in various different configurations.

[0053] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for protection, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present application.

[0054] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.

[0055] After a long period of investigation and research, the inventors found that when the industry is currently performing image retrieval and positioning for a certain object or a certain type of object, it usually adopts an object template matching method or a method of training a neural network model for a specific object to perform object positioning. Among them, the former requires searching for a sub-image in the image to be detected that has the same content and size as the template image according to the template image of the specific object. It cannot locate the position of the same object in the image where it is partially blocked, the image is rotated, or the size is inconsistent, and there is a problem of low positioning flexibility; the latter requires retraining the neural network model when facing a new object to be located, and realizes object positioning through complex calculations based on the trained neural network model. It cannot quickly locate the target object in the image to be detected, and there are problems of long object positioning time and large positioning calculation amount. To this end, the inventors provide the target object positioning method, device, electronic device and readable storage medium shown in this application to improve the problems of low positioning flexibility, long positioning time and large positioning calculation amount in the prior art.

[0056] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features therein may be combined with each other.

[0057] Please refer to Figure 1 , Figure 1 : is a schematic diagram of the structural composition of the electronic device 10 provided in the embodiment of the present application. In the embodiment of the present application, the electronic device 10 can be used for image processing, and can quickly locate the corresponding object position in the image to be detected based on the template image features of the specific object. There is no need to require that the image content and size of the determined object position be consistent with the template image of the specific object, nor is there a need to pre-train a matching image positioning network model specifically for the specific object, thereby improving the positioning flexibility and positioning efficiency of the object in the image and reducing the amount of positioning calculation. The specific object can be a thing or a combination of multiple things. The thing can be, but is not limited to, humans, animals, plants, vehicles, etc.; the electronic device 10 can be, but is not limited to, smart phones, personal computers, tablet computers, servers, etc.

[0058] In this embodiment, the electronic device 10 includes a target object positioning device 100, a memory 11, a processor 12, and a communication unit 13. The memory 11, processor 12, and communication unit 13 are electrically connected to each other directly or indirectly to enable data transmission or exchange. For example, the memory 11, processor 12, and communication unit 13 can be electrically connected to each other via one or more communication buses or signal lines.

[0059] In this embodiment, the memory 11 can be used to store programs, and the processor 12 can execute the programs accordingly after receiving execution instructions. The memory 11 can be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.

[0060] In this embodiment, the processor 12 may be an integrated circuit chip with signal processing capabilities. The processor 12 may be a general-purpose processor, including a graphics processing unit (GPU), a central processing unit (CPU), and a network processor (NP). The general-purpose processor may be a microprocessor or any conventional processor, and may implement or execute the methods, steps, and logic diagrams disclosed in the embodiments of this application.

[0061] In this embodiment, the communication unit 13 is used to establish a communication connection between the electronic device 10 and other physical hardware devices via a network, and to send and receive data via the network. For example, the electronic device 10 communicates with a server storing images via the communication unit 13 to obtain a template image containing a target object and an image to be detected for object localization from the server.

[0062] In this embodiment, the target object positioning device 100 includes at least one software functional module that can be stored in the memory 11 in the form of software or firmware or embedded in the operating system of the electronic device 10. The processor 12 can be used to execute the executable modules stored in the memory 11, such as the software functional modules and computer programs included in the target object positioning device 100. The electronic device 10 uses the target object positioning device 100 to quickly locate the corresponding object position in the image to be detected based on the template image features of the target object, thereby achieving the effect of improving positioning flexibility and positioning efficiency and reducing the amount of positioning calculations.

[0063] It is understandable that Figure 1 The block diagram shown is only a schematic diagram of the structure of the electronic device 10. The electronic device 10 may also include Figure 1More or fewer components than shown in, or with Figure 1 Different configurations shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0064] In this application, to ensure that the electronic device 10 can quickly locate the corresponding object position in the image to be detected based on the template image features of the target object, thereby improving positioning flexibility and efficiency and reducing the amount of positioning calculations, this application implements the above functions by providing a target object positioning method applied to the electronic device 10. The target object positioning method provided in this application is described below.

[0065] Alternatively, see Figure 2 , Figure 2 : is a flow chart of the target object positioning method provided in the embodiment of the present application. In the embodiment of the present application, Figure 2 The specific process and steps of the target object positioning method are shown below.

[0066] Step S210 , performing image feature extraction on the image to be detected and the template image including the target object, respectively, to obtain a first image feature of the template image and a second image feature of the image to be detected.

[0067] In this embodiment, the electronic device 10 may pre-store a convolutional neural network (CNN) model for extracting image features. When the electronic device 10 obtains a template image including a target object and an image to be detected that requires object positioning, the convolutional neural network model may be used to perform an image feature extraction operation on the obtained template image and the image to be detected to obtain a first image feature corresponding to the target object included in the template image and a second image feature included in the image to be detected.

[0068] Step S220 : determining a feature distance score map between the template image and the image to be detected, for representing an image feature mapping relationship, based on the first image feature and the second image feature.

[0069] In this embodiment, the feature distance score map can be used to represent the specific mapping between each first image feature in the template image and each second image feature in the image to be detected. By determining the feature distance score map between the template image and the image to be detected, the electronic device 10 can intuitively understand the image feature distribution of the first image feature corresponding to the target object when expressing the image content in the image to be detected.

[0070] Step S230 , using the mapping position of the target area of ​​the feature distance score map in the image to be detected as the target positioning position of the target object in the image to be detected, wherein the target area is the image area whose feature distance score of the feature distance score map is within a preset score range corresponding to the target object.

[0071] In this embodiment, the preset score range is used to represent the numerical range of the characteristic distance score between the template image of the object and the target image when the corresponding object is expressed in a certain target image. When there is a target image area in the characteristic distance score map between a certain template image and a target image whose value is within the preset score range of the object included in the template image, it can be indicated that the object exists in the target image, and the relative position of the object in the target image is consistent with the relative position of the corresponding target image area in the corresponding characteristic distance score map. The image size of the object in the target image is associated with the image size of the target image and is not necessarily the same as the image size of the corresponding template image. The preset score ranges corresponding to different object objects can be the same or different.

[0072] Therefore, after the electronic device 10 determines the characteristic distance score map between a certain template image and the image to be detected, it can determine whether there is a target area in the characteristic distance score map whose characteristic distance score is within a preset score range corresponding to the target object included in the target image. Then, if the target area exists in the characteristic distance score map, the regional position of the target area in the characteristic distance score map is mapped to the image to be detected for regional positioning, and then the regional position located in the image to be detected is used as the target positioning position of the target object in the image to be detected, thereby achieving the effect of quickly locating the target object. If there are multiple target objects, the electronic device 10 can repeatedly perform the above content for each target object to determine the position of each target object in the image to be detected.

[0073] In the present application, the electronic device 10 avoids the picture content limitations and size limitations that exist in the prior art when directly using template images for picture matching by determining the position area in the image to be detected that has a picture mapping relationship with the template image features of the target object, thereby improving the flexibility of object positioning, and avoiding the limitations of the prior art when specifically training a neural network model for the object to be located to perform object positioning operations, such as long positioning time and large positioning calculation amount, thereby improving the object positioning efficiency and reducing the calculation amount required for the object positioning process.

[0074] Below Figure 3 The application diagram shown in the figure is used as an example to illustrate the above target object positioning method. Figure 3In the embodiment of the present invention, when the electronic device 10 obtains a reference image showing a deer running on the water surface, it can intercept a template image with the deer head as the target object from the reference image, and then input the image to be detected and the template image into the convolutional neural network model to perform image feature extraction, thereby obtaining a first image feature of the template image and a second image feature of the image to be detected. Then, a corresponding feature distance score map is determined based on the first image feature and the second image feature, and the feature distance score map is scaled so that the image size of the scaled feature distance score map is consistent with that of the image to be detected. The image area in the scaled feature distance score map having a feature distance score within a preset score range corresponding to the deer head is determined ( Figure 3 The area where the bright white ring pattern in the upper right corner of the image is located is detected), and the specific position of this image area in the image to be detected is used as the positioning position of the deer head in the image to be detected.

[0075] In this application, to ensure that the electronic device 10 can properly determine the characteristic distance score map between the template image and the image to be detected, thereby ensuring the smooth execution of the object localization method, this application implements the above function by providing a characteristic distance score map construction scheme. The characteristic distance score map construction scheme provided in this application is described below.

[0076] Please refer to Figure 4 , Figure 4 yes Figure 2 Schematic diagram of the flow of sub-steps included in step S220. In the embodiment of the present application, step S220 may include sub-steps S221 to S224.

[0077] Sub-step S221 , calculating the feature similarity between each first image feature and each second image feature.

[0078] In this embodiment, the electronic device 10 can calculate the feature similarity between each first image feature and each second image feature by calculating any one of structural similarity, cosine similarity, histogram similarity, mutual information similarity, and texture similarity. In one implementation of this embodiment, the electronic device 10 completes the above feature similarity calculation process by calculating the cosine similarity between each first image feature and each second image feature.

[0079] Sub-step S222 , calculating a first likelihood function value of each first image feature relative to each second image feature based on the obtained similarities of each feature, and calculating a second likelihood function value of each second image feature relative to each first image feature.

[0080] In this embodiment, the calculation formula of the first likelihood function value of the first image feature relative to the second image feature is as follows:

[0081]

[0082] in, Used to indicate the first The second image feature, Used to represent the total number of second image features in the image to be detected, Used to represent a second image feature in the image to be detected, Used to represent a first image feature in the template image, Used to represent the first image feature Relative to the second image feature The first likelihood function value of Used to indicate the feature similarity between two corresponding image features.

[0083] The calculation formula of the second likelihood function value of the second image feature relative to the first image feature is as follows:

[0084]

[0085] in, Used to represent the first The first image feature, Used to represent the total number of first image features in the template image, Used to represent a second image feature in the image to be detected, Used to represent a first image feature in the template image, Used to represent the second image feature Relative to the first image feature The second likelihood function value of Used to indicate the feature similarity between two corresponding image features.

[0086] The electronic device 10 can calculate the first likelihood function value of each first image feature relative to each second image feature, and the second likelihood function value of each second image feature relative to each first image feature according to the above-mentioned first likelihood function value calculation formula and second likelihood function value calculation formula.

[0087] Sub-step S223 , performing a multiplication operation on the first likelihood function value and the second likelihood function value under the same first image feature and the same second image feature to obtain a likelihood function product value between each first image feature and each second image feature.

[0088] In this embodiment, after determining the first likelihood function value of each first image feature relative to each second image feature, and the second likelihood function value of each second image feature relative to each first image feature, the electronic device 10 can multiply the first likelihood function value and the second likelihood function value corresponding to the same group of image features (consisting of any first image feature and any second image feature) to obtain the likelihood function product value corresponding to each group of image features, that is, the likelihood function product value between each first image feature and each second image feature.

[0089] Sub-step S224 , screening the target function product value from all the calculated likelihood function product values ​​for image expression, and obtaining a feature distance score map, wherein each target function product value is expressed as a feature distance score in the feature distance score map.

[0090] In this embodiment, the objective function product value can be used to maximize the expression of the feature mapping relationship between the first image feature and the image to be detected, or the feature mapping relationship between the second image feature and the template image. Therefore, the electronic device 10 can select the maximum likelihood function product value from all likelihood function product values ​​corresponding to each first image feature as the objective function product value corresponding to the first image feature to perform the feature distance score map generation operation, or can select the maximum likelihood function product value from all likelihood function product values ​​corresponding to each second image feature as the objective function product value corresponding to the second image feature to perform the feature distance score map generation operation.

[0091] Therefore, in the first implementation of this embodiment, the step of selecting the target function product value from all the calculated likelihood function product values ​​for image expression to obtain the feature distance score map includes:

[0092] Among all likelihood function product values ​​corresponding to each first image feature, selecting a maximum likelihood function product value as the target function product value corresponding to the first image feature;

[0093] Arrange the corresponding objective function product values ​​into image elements according to the position distribution of each first image feature in the template image;

[0094] The obtained image element arrangement results are expressed as an image to obtain a feature distance score map.

[0095] In a second implementation of this embodiment, the step of selecting the target function product value from all the calculated likelihood function product values ​​for image expression to obtain the feature distance score map includes:

[0096] Among all likelihood function product values ​​corresponding to each second image feature, selecting a maximum likelihood function product value as the target function product value corresponding to the second image feature;

[0097] Arrange the corresponding objective function product values ​​into image elements according to the position distribution of each second image feature in the image to be detected;

[0098] The obtained image element arrangement results are expressed as an image to obtain a feature distance score map.

[0099] Among them, both of the above-mentioned two implementations can generate a feature distance score map for implementing the target object positioning method, but because this application needs to locate the position of the target object in the image to be detected, the higher the image matching degree between the generated feature distance score map and the image to be detected, the higher the accuracy of the position of the target object located in the image to be detected. Therefore, compared with the above-mentioned first implementation, the feature distance score map generated by the second implementation has a higher matching degree with the image to be detected in terms of image content layout, which can ensure that the accuracy of the target positioning position finally determined is higher, and the feature distance score map generated by the above-mentioned first implementation has a higher matching degree with the template image in terms of image content layout, which can ensure that the target positioning position finally determined has a higher template tendency.

[0100] In this application, after the electronic device 10 determines a characteristic distance score map between the template image and the image to be detected, to ensure that the electronic device 10 can determine the position of the target object in the image to be detected based on the characteristic distance score map, this application implements the above function by providing an object mapping and positioning solution applied to the characteristic distance score map. The object mapping and positioning solution provided by this application is described below.

[0101] Alternatively, see Figure 5 , Figure 5 yes Figure 2 One of the flow charts of the sub-steps included in step S230 of the embodiment of the present application, the step S230 may include sub-step S231 and sub-step S232.

[0102] In sub-step S231 , the feature distance score map is scaled according to the size of the image to be detected, to obtain a target score map having the same size as the image to be detected.

[0103] In sub-step S232 , an image positioning region having a feature distance score within a preset score range is determined in the target score map, and then the position information of the image positioning region in the target score map is used as the target positioning position.

[0104] Alternatively, see Figure 6 , Figure 6 yes Figure 2 FIG2 is a flow chart showing the sub-steps included in step S230 of the embodiment of the present application. In the embodiment of the present application, the step S230 may include sub-step S233 and sub-step S234.

[0105] Sub-step S233: determining the region position coordinates of the target region in the feature distance score map.

[0106] In sub-step S234 , coordinate transformation is performed on the region position coordinates according to the coordinate mapping relationship between the feature distance score map and the image to be detected, and the object positioning coordinates obtained by the transformation are then used as the target positioning position.

[0107] in, Figure 5 The substeps shown are similar to Figure 6 Compared with the sub-steps shown in FIG, the amount of calculation is smaller, and the electronic device 10 can use Figure 5 The sub-steps shown in the figure are used to perform object positioning to further reduce the amount of positioning calculation required for the entire object positioning process, but Figure 6 The substeps shown are relative to Figure 5 The sub-steps shown have higher positioning accuracy, and the electronic device 10 can be Figure 6 The sub-steps shown perform object positioning to further improve the positioning accuracy required for the entire object positioning process. The electronic device 10 can select any of the sub-steps of step S230 to perform the object mapping positioning operation according to the object positioning requirements.

[0108] In the present application, to ensure that the electronic device 10 can quickly locate the corresponding object position in the image to be detected based on the template image features of the target object, thereby improving positioning flexibility and efficiency and reducing the amount of positioning calculations, the present application divides the target object positioning device 100 into functional modules, so that the above functions are implemented through the software functional modules included in the target object positioning device 100. The specific components of the target object positioning device 100 provided in the present application are described below.

[0109] Alternatively, see Figure 7 , Figure 7 1 is a functional module diagram of the target object positioning device 100 provided in the embodiment of the present application. In the embodiment of the present application, Figure 7 The target object positioning device 100 shown includes an image feature extraction module 110 , a feature distance processing module 120 and an object image positioning module 130 .

[0110] The image feature extraction module 110 is used to extract image features from the image to be detected and the template image including the target object, respectively, to obtain a first image feature of the template image and a second image feature of the image to be detected.

[0111] The feature distance processing module 120 is configured to determine a feature distance score map for representing an image feature mapping relationship between the template image and the image to be detected based on the first image feature and the second image feature.

[0112] The object image positioning module 130 is configured to use the mapping position of the target area of ​​the feature distance score map in the image to be detected as the target positioning position of the target object in the image to be detected, wherein the target area is the image area whose feature distance score of the feature distance score map is within a preset score range corresponding to the target object.

[0113] It should be noted that the basic principle and technical effects of the target object positioning device 100 provided in this application are similar to those of the Figure 2 The target object positioning method shown in FIG is the same. For the sake of simplicity, the parts not mentioned in this embodiment can be referred to the above-mentioned Figure 2 The corresponding description of the target object positioning method is shown.

[0114] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to the embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.

[0115] In addition, the functional modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0116] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a readable storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned readable storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program code.

[0117] In summary, in a target object positioning method, device, electronic device and readable storage medium provided by the present application, the present application extracts the image features corresponding to the image to be detected and the template image including the target object, and then establishes a feature distance score map for representing the feature mapping relationship of the image features of the template image in the image to be detected based on the image features of each of the two images. Finally, by determining the position of the image area in the feature distance score map whose feature distance score is not less than the preset score threshold corresponding to the target object mapped to the image to be detected, the position information matching the target object feature in the image to be detected is obtained, thereby achieving the effect of improving positioning flexibility and positioning efficiency and reducing the amount of positioning calculation.

[0118] The above description is merely a preferred embodiment of the present application and is not intended to limit the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application shall be included within the scope of protection of the present application.

Claims

1. A target object positioning method, characterized in that: The method comprises: Performing image feature extraction on the image to be detected and the template image including the target object respectively to obtain a first image feature of the template image and a second image feature of the image to be detected; Based on the first image feature and the second image feature, a feature distance score map for representing the image feature mapping relationship between the template image and the image to be detected is determined; wherein the step of determining the feature distance score map includes: calculating the feature similarity between each first image feature and each second image feature; based on the obtained feature similarities, calculating the first likelihood function value of each first image feature relative to each second image feature, and calculating the second likelihood function value of each second image feature relative to each first image feature; multiplying the first likelihood function value and the second likelihood function value under the same first image feature and the same second image feature to obtain the likelihood function product value between each first image feature and each second image feature; screening the target function product value from all the calculated likelihood function product values ​​for image expression to obtain the feature distance score map, wherein each of the target function product values ​​is expressed as a feature distance score in the feature distance score map; The mapping position of the target area of ​​the feature distance score map in the image to be detected is used as the target positioning position of the target object in the image to be detected, wherein the target area is an image area where the feature distance score of the feature distance score map is within a preset score range corresponding to the target object.

2. The method according to claim 1, characterized in that The calculation formula of the first likelihood function value of the first image feature relative to the second image feature is as follows: in, Used to indicate the first The second image feature, used to represent the total number of second image features in the image to be detected, used to represent a second image feature in the image to be detected, used to represent a first image feature in the template image, Used to represent the first image feature Relative to the second image feature The first likelihood function value of Used to indicate the feature similarity between two corresponding image features.

3. The method according to claim 1, characterized in that The calculation formula of the second likelihood function value of the second image feature relative to the first image feature is as follows: in, For indicating the first The first image feature, used to represent the total number of first image features in the template image, used to represent a second image feature in the image to be detected, used to represent a first image feature in the template image, Used to represent the second image feature Relative to the first image feature The second likelihood function value of Used to indicate the feature similarity between two corresponding image features.

4. The method according to claim 1, wherein The step of selecting the target function product value from all the calculated likelihood function product values ​​for image expression to obtain the feature distance score map includes: Among all likelihood function product values ​​corresponding to each first image feature, selecting a maximum likelihood function product value as the target function product value corresponding to the first image feature; Arranging the corresponding objective function product values ​​into image elements according to the position distribution of each first image feature in the template image; The obtained image element arrangement result is expressed as an image to obtain the feature distance score map.

5. The method according to claim 1, wherein The step of selecting the target function product value from all the calculated likelihood function product values ​​for image expression to obtain the feature distance score map includes: Among all likelihood function product values ​​corresponding to each second image feature, selecting a maximum likelihood function product value as the target function product value corresponding to the second image feature; Arranging the corresponding objective function product values ​​into image elements according to the position distribution of each second image feature in the image to be detected; The obtained image element arrangement result is expressed as an image to obtain the feature distance score map.

6. The method according to any one of claims 1 to 5, characterized in that The step of using the mapping position of the target area of ​​the feature distance score map in the image to be detected as the target positioning position of the target object in the image to be detected includes: Scaling the feature distance score map according to the size of the image to be detected to obtain a target score map with a size consistent with that of the image to be detected; An image positioning region having a feature distance score within the preset score range is determined in the target score map, and then position information of the image positioning region in the target score map is used as the target positioning position.

7. The method according to any one of claims 1 to 5, characterized in that The step of using the mapping position of the target area of ​​the feature distance score map in the image to be detected as the target positioning position of the target object in the image to be detected includes: Determine the regional position coordinates of the target area in the feature distance score map; According to the coordinate mapping relationship between the feature distance score map and the image to be detected, the coordinates of the region position are transformed, and then the object positioning coordinates obtained by the transformation are used as the target positioning position.

8. A target object positioning device, characterized in that: The device comprises: An image feature extraction module is used to extract image features from the image to be detected and the template image including the target object, respectively, to obtain a first image feature of the template image and a second image feature of the image to be detected; A feature distance processing module is used to determine a feature distance score map for representing the image feature mapping relationship between the template image and the image to be detected based on the first image feature and the second image feature; wherein the feature distance processing module is specifically used to: calculate the feature similarity between each first image feature and each second image feature; calculate the first likelihood function value of each first image feature relative to each second image feature based on the obtained feature similarities, and calculate the second likelihood function value of each second image feature relative to each first image feature; multiply the first likelihood function value and the second likelihood function value under the same first image feature and the same second image feature to obtain the likelihood function product value between each first image feature and each second image feature; screen the target function product value from all the calculated likelihood function product values ​​for image expression to obtain the feature distance score map, wherein each target function product value is expressed as a feature distance score in the feature distance score map; An object image positioning module is configured to use a mapping position of a target area of ​​the feature distance score map in the image to be detected as a target positioning position of the target object in the image to be detected, wherein the target area is an image area whose feature distance score of the feature distance score map is within a preset score range corresponding to the target object.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor can execute the machine-executable instructions to implement the target object positioning method according to any one of claims 1 to 7.

10. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the target object positioning method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • A template matching method and device

    CN109726746A