Target recognition method, device and electronic system
By adopting the double bottom library recognition method in the target recognition technology, using the rapid identification of the first bottom library and the feature update of the second bottom library, the problem of poor recognition effect of the bottom library diagram features is solved, and a higher recognition accuracy and effect is achieved.
Patent Information
- Application Number
- CN202011227138.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-05
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2040-11-05
AI Technical Summary
In the existing target recognition technology, the feature data of the base library map is not comprehensive enough, resulting in poor recognition effect. Especially in the face recognition task, the base library map and the capture image have low recognition accuracy under the influence of factors such as different styles, age, makeup, and occlusion.
The recognition method of the double bottom library is adopted to obtain the image with the highest degree of matching with the target image and its matching scores through the first bottom library. When the matching score is higher than the threshold, the recognition is determined to be successful, and when a specific condition is met, the target image is updated to the second bottom library to improve the comprehensiveness and accuracy of the image features in the second bottom library; when the recognition of the first bottom library fails, the recognition is performed through the second bottom library.
The accuracy and recognition effect of target recognition are improved, and the images of the second base library are dynamically updated to make their features close to the clustering center, thereby improving the accuracy and recall of recognition.
Smart Images

Figure CN112418006B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of target recognition, and in particular to a target recognition method, device and electronic system. Background Art
[0002] In traffic scenarios or other practical application scenarios, there is often a need to identify the target identity. Taking face recognition as an example, it is necessary to pre-set the image base library. After obtaining the snapshot of the face, find the base library image with the highest matching degree with the snapshot from the base library, and calculate the matching score. According to the matching score and the preset score threshold, return the recognition result of the above snapshot. In the face recognition task, each face is regarded as a cluster, and the feature data contained in the base library image is regarded as the cluster center. The distance between the feature data of the snapshot image and the cluster center is calculated to obtain the matching degree between the snapshot image and the base library image; however, many base library images do not contain the most comprehensive and accurate features of the face, resulting in the feature data of the base library image not being in the cluster center. Recognition based on such base library images often has poor recognition effect. Summary of the invention
[0003] In view of this, an object of the present invention is to provide a target recognition method, device and electronic system to improve the accuracy and recognition effect of target recognition.
[0004] In a first aspect, an embodiment of the present invention provides a target recognition method, the method comprising: obtaining, through a first base database, a first image with the highest degree of match with a target image, and a first matching score between the target image and the first image; wherein a second image with the same target identification as the first image is stored in the second base database; when the first matching score is higher than a first score threshold of the first base database, determining that target recognition in the target image is successful; when the first matching score meets a preset score condition and the target image meets a preset image condition, replacing the second image with the target image; when the first matching score is lower than the first score threshold, determining a recognition result of the target to be identified through the second base database.
[0005] Furthermore, the preset score conditions include: the first matching score is higher than the first score threshold, and the first matching score is higher than the update threshold of the second base library; wherein the update threshold is used to: when the first matching score is higher than the update threshold, allow the image in the second base library to be updated.
[0006] Furthermore, the preset score condition also includes: the first matching score is higher than the replacement threshold corresponding to the target identifier of the first image; wherein the replacement threshold is used to: when the first matching score is higher than the replacement threshold, allow the image corresponding to the target identifier to be replaced.
[0007] Furthermore, after the step of replacing the second image with the target image, the method further includes: when the first matching score is higher than a replacement threshold corresponding to the target identifier of the first image, updating the replacement threshold to the first matching score.
[0008] Furthermore, the preset image conditions include one or more of the following: the posture parameters of the target in the target image meet the preset posture parameter threshold; the clarity of the target image meets the preset clarity threshold; the light intensity of the target image meets the preset light intensity threshold; the occlusion degree of the target in the target image meets the preset occlusion degree threshold.
[0009] Furthermore, when the first matching score is lower than the first score threshold, the step of determining the recognition result of the target to be identified through the second base database includes: when the first matching score is lower than the first score threshold and the first matching score is higher than or equal to the enabling threshold of the second base database, determining the recognition result of the target to be identified through the second base database; wherein the enabling threshold is used to: if the first matching score is higher than or equal to the enabling threshold, allow the recognition result of the target to be identified to be determined through the second base database.
[0010] Furthermore, the step of determining the recognition result of the target to be identified through the second base database includes: obtaining a third image with the highest degree of matching with the target image, and a second matching score between the target image and the third image through the second base database; when the target identifier of the third image is the same as that of the first image, and the second matching score is higher than or equal to the second score threshold of the second base database, it is determined that the target recognition in the target image is successful.
[0011] In a second aspect, an embodiment of the present invention provides a target recognition device, which includes: an acquisition module, used to acquire a first image with the highest degree of match with a target image, and a first matching score between the target image and the first image through a first base database; wherein a second image with the same target identification as the first image is stored in the second base database; a replacement module, used to determine that target recognition in the target image is successful when the first matching score is higher than a first score threshold of the first base database; when the first matching score meets a preset score condition and the target image meets a preset image condition, the second image is replaced with the target image; and an identification module, used to determine the identification result of the target to be identified through the second base database when the first matching score is lower than the first score threshold.
[0012] In a third aspect, an embodiment of the present invention provides an electronic system, the electronic system comprising: a processing device and a storage device; a computer program is stored on the storage device, and the computer program executes a target recognition method as any one of the first aspects when the processed device is running.
[0013] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processing device, the steps of the target recognition method as described in any one of the items in the first aspect are executed.
[0014] The embodiments of the present invention bring the following beneficial effects:
[0015] The embodiment of the present invention provides a target recognition method, device and electronic system, which obtains the first image with the highest matching degree with the target image and the first matching score between the target image and the first image through the first base library; when the first matching score is higher than the first score threshold of the first base library, it is determined that the target in the target image is successfully recognized; when the first matching score meets the preset score condition and the target image meets the preset image condition, the second image is replaced with the target image; when the first matching score is lower than the first score threshold, the recognition result of the target to be recognized is determined through the second base library. In this method, two base libraries are set up in total. If the target can be successfully recognized through the first base library and the target image meets certain conditions, the target image can be updated to the second base library, so that the image in the second base library contains more comprehensive and accurate features of the target; when the target recognition fails through the first base library, it can be recognized based on the second base library; thereby improving the accuracy and recognition effect of target recognition.
[0016] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0017] In order to make the above-mentioned objects, features and advantages of the present invention 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
[0018] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 A schematic diagram of the structure of an electronic system provided by an embodiment of the present invention;
[0020] Figure 2 A flow chart of a target recognition method provided by an embodiment of the present invention;
[0021] Figure 3A flowchart of another target recognition method provided by an embodiment of the present invention;
[0022] Figure 4 A flowchart of another target recognition method provided by an embodiment of the present invention;
[0023] Figure 5 A flowchart of a specific target recognition method provided by an embodiment of the present invention;
[0024] Figure 6 A schematic diagram of the structure of a target recognition device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0026] In traffic scenes or other practical application scenes, there is often a need to identify the target identity. Taking face recognition as an example, it is necessary to pre-set the image base library. After obtaining the snapshot of the face, find the base library image with the highest matching degree with the snapshot from the base library, and calculate the matching score. According to the matching score and the preset score threshold, return the recognition result of the snapshot. In the face recognition task, each face is regarded as a cluster, and the feature data contained in the base library image is regarded as the cluster center. The distance between the feature data of the snapshot image and the cluster center is calculated to obtain the matching degree between the snapshot image and the base library image; however, many base library images do not contain the most comprehensive and accurate features of the face, resulting in the feature data of the base library image not being in the cluster center, but usually at the edge of the cluster; and due to the influence of the scene, the base library image and the snapshot image have different styles, as well as age, makeup, occlusions, etc., so the recognition effect based on such base library images is often poor. Based on this, an embodiment of the present invention provides a target recognition method, device and electronic system. This technology can be applied to application scenarios that require target recognition, such as traffic scenarios for recognizing human faces.
[0027] Embodiment 1:
[0028] First, refer to Figure 1 An exemplary electronic system 100 for implementing the target recognition method, apparatus, and electronic system according to the embodiments of the present invention is described.
[0029] like Figure 1The electronic system 100 includes one or more processing devices 102, one or more storage devices 104, an input device 106, an output device 108, and may also include one or more image acquisition devices 110. These components are interconnected through a bus system 112 and / or other forms of connection mechanisms (not shown). It should be noted that Figure 1 The components and structure of the electronic system 100 shown are merely exemplary and not limiting. The electronic system may also have other components and structures as required.
[0030] The processing device 102 can be a gateway, or a smart terminal, or a device including a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities. It can process data of other components in the electronic system 100 and control other components in the electronic system 100 to perform desired functions.
[0031] The storage device 104 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processing device 102 may run the program instructions to implement the client functions and / or other desired functions in the embodiments of the present invention (implemented by the processing device) described below. Various applications and various data, such as various data used and / or generated by the application, may also be stored in the computer-readable storage medium.
[0032] The input device 106 may be a device used by a user to input instructions, and may include one or more of a keyboard, a mouse, a microphone, a touch screen, and the like.
[0033] The output device 108 may output various information (eg, images, data, or sounds) to the outside (eg, a user), and may include one or more of a display, a speaker, and the like.
[0034] The image acquisition device 110 can acquire preview video frames or picture data (such as images to be processed or target video frames), and store the acquired preview video frames or image data in the storage device 104 for use by other components.
[0035] Exemplarily, the components in the example electronic system for implementing the target recognition method, device and electronic system according to the embodiment of the present invention can be integrated or dispersed, such as integrating the processing device 102, the storage device 104, the input device 106 and the output device 108 into one, and setting the image acquisition device 110 at a specified position where the image can be acquired. When the components in the above electronic system are integrated, the electronic system can be implemented as a smart terminal such as a camera, a smart phone, a tablet computer, a computer, a vehicle-mounted terminal, a camera, etc.
[0036] Embodiment 2:
[0037] The embodiment of the present invention provides a target recognition method, such as Figure 2 As shown, the method comprises the following steps:
[0038] Step S202, obtaining, through the first base database, a first image with the highest matching degree with the target image, and a first matching score between the target image and the first image; wherein a second image with the same target identifier as the first image is stored in the second base database;
[0039] The first base database can be a base database in a variety of scenarios, such as a face recognition base database that can be used to identify the face of a passerby, and a behavior recognition base database that can be used to identify the behavior of a pedestrian; the first base database can contain multiple images, identity information corresponding to the image, feature vectors corresponding to the image, etc.; the identity information corresponding to the image can be an ID (Identity Document, identity identification number), a Token, or a randomly generated string, etc., and each image has unique identity information. For example, in a traffic scene at the entrance of an apartment, the first base database contains facial photos of all residents in the apartment (such as N ID photos), identity information corresponding to each facial photo (such as ID number or name), and feature vectors corresponding to each facial photo.
[0040] The target image may be an image containing a target, such as a face, a pedestrian, an object, an animal, a building, etc. For example, a captured photo of a pedestrian or a face in a traffic scene at the entrance of an apartment. The image in the second base library corresponds to the identity information of the target in the image in the first base library. The image in the second base library is usually clearer than the image in the first base library, and contains more comprehensive features. For example, if the image of the same person in the first base library is a certificate photo, the image in the second base library may be a more realistic recent photo (a photo taken recently or a photo taken recently in the current scene). It can be understood that the second image is the initial image in the second base library.
[0041] In actual implementation, all images in the first base library are matched with the target image. Specifically, the feature distance between the feature vector corresponding to each image in the first base library and the feature vector of the target image can be calculated to obtain the feature distance of each image. The image with the smallest feature distance is the first image with the highest degree of matching with the target image. After obtaining the first image, the first matching score between the target image and the first image can be calculated based on the feature distance. Alternatively, the feature distance between the feature vector corresponding to each image in the first base library and the feature vector of the target image can be calculated. The matching score between the target image and each image is calculated based on the feature distance to obtain the matching score of each image. The image with the largest matching score is the first image with the highest degree of matching with the target image. The matching score is used to indicate the degree of matching between the image and the target image. The larger the matching score, the more similar the target in the image is to the target image.
[0042] Step S204, determining whether the first matching score is higher than the first score threshold of the first base database; if yes, executing step S206; if no, executing step S212;
[0043] Step S206, when the first matching score is higher than the first score threshold of the first base database, it is determined that the target in the target image is successfully recognized;
[0044] Step S208, determining whether the first matching score satisfies a preset score condition, and whether the target image satisfies a preset image condition; if yes, executing step S210; if no, ending;
[0045] Step S210, when the first matching score meets the preset score condition and the target image meets the preset image condition, the second image is replaced with the target image; end;
[0046] The above-mentioned first score threshold can be pre-set according to actual needs, for example, it can be set to a value between 50 and 80. This embodiment does not limit the size of the first score threshold. If the first matching score is higher than the first score threshold of the first base library, it means that the target in the target image is the same as the target in the first image, and it is determined that the target in the target image is successfully recognized. For example, in a traffic scene at the entrance of an apartment, the first branch threshold is pre-set to 70, and the first matching score calculated by the above step S202 is 80. The first matching score 80 is greater than the first branch threshold 70, which means that the target in the first image in the first base library (such as the face of the ID photo) is the same as the target in the target image (such as the pedestrian in the snapshot photo). It can be understood that the pedestrian in the target image is a resident in the apartment. It is determined that the target in the target image is successfully recognized, and the user is prompted to enter the apartment through the apartment entrance.
[0047] When the first matching score is higher than the first score threshold of the first base database, it is determined that the target in the target image is successfully recognized; then it is necessary to determine whether the first matching score meets the preset score condition and whether the target image meets the preset image condition; if so, the second image is replaced with the target image.
[0048] If the image quality of the target image is good, the first matching score meets the preset score condition, and the target image meets the preset image condition, the second image can be replaced with the target image, and the initial image in the second base library can be updated to make the image in the second base library more comprehensive and accurate and can serve as the clustering center of the target.
[0049] The preset score condition may be that the first match score is greater than the first score threshold, and the difference between the first match score and the first score threshold is greater than the preset difference threshold, or the first match score is greater than the preset update threshold of the second base database. If the preset score condition is met, it means that the target in the target image is the same as the target in the first image. The larger the first match score or the difference between the first match score and the first score threshold, the greater the probability that the targets are the same, and the smaller the possibility of recognition error; recognition error, for example, identifies person A in the target image as person B in the first base database.
[0050] The preset image condition may be that the image quality of the target image meets a preset quality parameter threshold, for example, the behavior or posture of the target in the target image meets a preset condition, the image clarity of the target image meets a preset clarity, the image color and brightness of the target image meet preset requirements, the occlusion attribute of the target in the target image meets a preset requirement, the image resolution of the target image meets a preset requirement, the image scale of the target image meets a preset requirement, etc. Only the target image that meets the preset image condition will have a higher image quality and can replace the second image.
[0051] For example, in a traffic scene at the entrance of an apartment, a captured photo of a pedestrian is the target image. If the first matching score obtained based on the currently captured target image is higher than the first score threshold of the first base database, the first matching score meets the preset score condition, and the target image meets the preset image condition, then it means that the target feature of the captured pedestrian photo is closer to the cluster center than the target feature of the second image, and contains more comprehensive and accurate target feature information, and target recognition based on the target image is more accurate.
[0052] Step S212: when the first matching score is lower than the first score threshold, the recognition result of the target to be recognized is determined through the second base database.
[0053] If the first matching score is lower than the first score threshold, there may be three reasons: reason one, because the feature information of the image in the first base library is not comprehensive enough, the target in the target image fails to be identified; reason two, the target in the target image is blocked, such as the target in the target image wears a mask, sunglasses, or is in a complex light scene, so the first base library fails to identify the target; reason three, the target in the image of the first base library does not include the target in the target image. In order to avoid the above reasons one and two, the recognition result of the target to be identified can be further determined through the second base library. The second base library includes the initial image and the target image with the same target identifier as the initial image after replacement.
[0054] Specifically, the second image with the highest degree of match with the target image and the matching score between the target image and the second image can be obtained through the second base database; if the matching score is greater than the score threshold of the second base database, and the target image has the same target identifier as the first image, it is determined that the target to be identified is successfully identified.
[0055] The embodiment of the present invention provides a target recognition method, which obtains the first image with the highest matching degree with the target image and the first matching score between the target image and the first image through the first base library; if the first matching score is higher than the first score threshold of the first base library, it is determined that the target in the target image is successfully recognized; if the first matching score meets the preset score condition, and the target image meets the preset image condition, the second image is replaced with the target image; if the first matching score is lower than the first score threshold, the recognition result of the target to be recognized is determined through the second base library. In this method, two base libraries are set up in total. If the target can be successfully recognized through the first base library and the target image meets certain conditions, the target image can be updated to the second base library, so that the image in the second base library contains more comprehensive and accurate features of the target; when the target recognition fails through the first base library, it can be recognized based on the second base library; thereby improving the accuracy and recognition effect of target recognition.
[0056] Embodiment three:
[0057] The embodiment of the present invention provides another target recognition method. This embodiment is implemented on the basis of the above embodiment. This embodiment focuses on describing the specific contents of the preset score conditions and the preset image conditions, and the specific implementation method of the steps after the step of replacing the second image with the target image (implemented by step S306), such as Figure 3 As shown, the method comprises the following steps:
[0058] Step S302, obtaining a first image with the highest matching degree with the target image and a first matching score between the target image and the first image through the first base database; wherein a second image with the same target identifier as the first image is stored in the second base database;
[0059] Step S304, determining whether the first matching score is higher than the first score threshold of the first base database; if yes, executing step S306; if no, executing step S314;
[0060] Step S306, when the first matching score is higher than the first score threshold of the first base database, it is determined that the target in the target image is successfully recognized;
[0061] Step S308, determining whether the first matching score satisfies a preset score condition, and whether the target image satisfies a preset image condition; if yes, executing step S310; if no, ending;
[0062] Step S310, when the first matching score satisfies a preset score condition and the target image satisfies a preset image condition, the second image is replaced with the target image;
[0063] The preset score conditions include: the first matching score is higher than the first score threshold, and the first matching score is higher than the update threshold of the second base library; wherein the update threshold is used to allow updating of images in the second base library when the first matching score is higher than the update threshold.
[0064] The update threshold can be set according to actual needs, and the update threshold is usually higher than the first match threshold. When the first match score is higher than the first score threshold, and the first match score is higher than the update threshold of the second base library, the target image can be updated to the second base library to replace the second image.
[0065] In addition, the above-mentioned preset score conditions also include: the first matching score is higher than the replacement threshold corresponding to the target identifier of the first image; wherein the replacement threshold is used to: when the first matching score is higher than the replacement threshold, allow the image corresponding to the target identifier to be replaced.
[0066] The second image in the second base library with the same target identifier as the first image may be the initial second image or the target image that has been replaced; if the second image is the initial second image, the replacement threshold can be understood as the aforementioned update threshold; if the second image is the target image that has been replaced, the replacement threshold is usually the first matching score between the target image and the first image. Specifically, the replacement threshold is used to allow the image in the second base library corresponding to the target identifier to be replaced when the first matching score is higher than the replacement threshold.
[0067] For example, in a traffic scene at an apartment entrance, when target A passes through the entrance for the first time, the first match score between the first photo of target A and the first image is greater than the first score threshold, and greater than the update threshold of the second base library; in addition, the second image with the same target identifier as the first image is the initial image, and the second image is directly replaced with the first photo. When target A passes through the entrance again, the second match score between the second photo of target A and the first image is greater than the first score threshold, and greater than the update threshold of the second base library; at this time, the second image with the same target identifier as the first image is not the initial image, but the first photo that has been replaced. At this time, the replacement threshold of target A is the first match score, and only when the second match score is higher than the first match score, the second image is allowed to be replaced with the second photo of target A.
[0068] The above-mentioned preset image conditions include one or more of the following: the posture parameters of the target in the target image meet the preset posture parameter threshold; the clarity of the target image meets the preset clarity threshold; the light intensity of the target image meets the preset light intensity threshold; the occlusion degree of the target in the target image meets the preset occlusion degree threshold.
[0069] The above-mentioned attitude parameter threshold, clarity threshold, illumination intensity threshold, and occlusion degree threshold can all be set according to actual needs; wherein, the attitude parameters of the target in the target image can be determined according to the rotation angle of the target in the coordinate axis, for example, the target is mapped to the three-dimensional coordinate axis, and specifically the postures such as lowering the head, shaking the head left and right, raising the head, and tilting the head are mapped to the rotation angle around the X-axis, Y-axis, and Z-axis, and the attitude parameters are determined using the rotation angle. The threshold of the same attitude parameter can also be determined in the same way, for example, postures such as lowering the head 20 degrees, shaking the head left and right 20 degrees, raising the head 20 degrees, and tilting the head 20 degrees can be attitude parameter thresholds. The attitude parameters of the target in the target image meet the preset attitude parameter thresholds, that is, the attitude parameters of the target in the target image are less than the preset attitude parameter thresholds.
[0070] The clarity of the target image can be an index such as image resolution and blurriness, which can be calculated by image processing. For example, if the clarity is 1, it is considered that the facial features of the target are clearly visible, and when the clarity is 0.5, it is considered that the facial features of the target are out of focus and become blurry. For example, the clarity threshold can be set to 0.6. That is, the clarity of the target image is less than the preset clarity threshold;
[0071] The light intensity of the target image can be calculated by image processing. For example, if the light intensity is 10, the target image is considered to be dark (usually a photo taken at night when the light is insufficient); for example, the light intensity threshold can be set to 40. That is, the light intensity of the target image is greater than the preset light intensity threshold.
[0072] The occlusion degree of the target in the above target image can also be identified according to the image processing method, and the larger the occlusion area, the greater the occlusion degree. For example, if the target wears a mask, it can be considered that the occlusion degree of the target is 50%, and if the target is not occluded, it can be considered that the occlusion degree of the target is 0. Usually, the occlusion degree threshold can be set to 0. That is, the occlusion degree of the target in the target image is equal to the preset occlusion degree threshold.
[0073] Step S312, when the first matching score is higher than the replacement threshold corresponding to the target identifier of the first image, the replacement threshold is updated to the first matching score; end;
[0074] It can be understood that in the images of the second base library, each target identifier corresponds to the target identifier image. For the target identifier whose image has been replaced by the target image, the first matching score between the replaced target image and the first image can be set as the replacement threshold; specifically, the highest score of the first matching score between the target image corresponding to the target identifier and the first image is the replacement threshold.
[0075] Step S314: when the first matching score is lower than the first score threshold, the recognition result of the target to be recognized is determined through the second base database.
[0076] In the above method, if the target can be identified using the first base database, the first matching score is higher than the update threshold of the second base database, the first matching score is higher than the replacement threshold corresponding to the target identification of the first image, and the posture parameters of the target in the target image meet the preset posture parameter threshold; the clarity of the target image meets the preset clarity threshold; the illumination intensity of the target image meets the preset illumination intensity threshold; the degree of occlusion of the target in the target image meets the preset occlusion degree threshold, then the target image can be updated to the second image, so that the image features in the second base database are more comprehensive and accurate, and the images in the base database use the on-site pictures more reasonably. By dynamically updating the images of the second base database, the image features can continuously approach the cluster center. Therefore, if the target fails to be identified using the first base database, it can be identified based on the updated second base database, which can achieve better passage effects and improve the accuracy and recognition effect of target recognition.
[0077] Embodiment 4:
[0078] The embodiment of the present invention provides another target recognition method. This embodiment is implemented on the basis of the above embodiment. This embodiment focuses on describing the specific implementation method of the step of determining the recognition result of the target to be recognized through the second base database when the first matching score is lower than the first score threshold (implemented by step S408), such as Figure 4 As shown, the method comprises the following steps:
[0079] Step S402, obtaining a first image with the highest matching degree with the target image and a first matching score between the target image and the first image through the first base database; wherein a second image with the same target identifier as the first image is stored in the second base database;
[0080] Step S404, determining whether the first matching score is higher than the first score threshold of the first base database; if yes, executing step S406; if no, executing step S414;
[0081] Step S406, when the first matching score is higher than the first score threshold of the first base database, it is determined that the target in the target image is successfully recognized;
[0082] Step S408, determining whether the first matching score satisfies a preset score condition, and whether the target image satisfies a preset image condition; if yes, executing step S410; if no, ending;
[0083] Step S410, when the first matching score satisfies a preset score condition and the target image satisfies a preset image condition, the second image is replaced with the target image;
[0084] Step S412, when the first matching score is higher than the replacement threshold corresponding to the target identifier of the first image, the replacement threshold is updated to the first matching score; end;
[0085] Step S414, when the first matching score is lower than the first score threshold, determine whether the first matching score is higher than or equal to the activation threshold of the second base library; if yes, execute step S418; if no, end;
[0086] Step S416, when the first matching score is higher than or equal to the enabling threshold of the second base database, the recognition result of the target to be identified is determined through the second base database; wherein the enabling threshold is used to: if the first matching score is higher than or equal to the enabling threshold, the recognition result of the target to be identified is allowed to be determined through the second base database.
[0087] The activation threshold of the second base database can be set according to actual needs, and the activation threshold is usually lower than the first score threshold; for example, the first score threshold is pre-set to 70, and the activation threshold of the second base database is 50. If the first match score is 60, which is lower than the first score threshold of 70 and higher than the activation threshold of the second base database of 50, the recognition result of the target to be identified can be determined through the second base database. Of course, if the first match score is lower than the first score threshold, and the first match score is lower than the activation threshold of the second base database, it means that the recognition fails, and the second base database will not be used for the next step of recognition.
[0088] A possible implementation method of determining the identification result of the target to be identified by the second base database is as follows:
[0089] (1) obtaining, through the second base database, a third image that has the highest matching degree with the target image, and a second matching score between the target image and the third image;
[0090] Specifically, the feature vectors of all images in the second base library are matched with the feature vectors of the target image, and the feature distance between the target image and each image is calculated to obtain the feature distance of each image. The image with the smallest feature distance is the third image mentioned above. After obtaining the third image, the second matching score between the target image and the third image can be calculated based on the feature distance. Alternatively, the feature distance between the feature vector corresponding to each image in the second base library and the feature vector of the target image is calculated; the matching score between the target image and each image is calculated based on the feature distance to obtain the matching score of each image. The image with the largest matching score is the third image mentioned above. The second matching score is used to indicate the matching degree between the third image and the target image. The larger the second matching score, the more similar the target in the third image is to the target image.
[0091] (2) When the target identifier of the third image is the same as that of the first image, and the second matching score is higher than or equal to the second score threshold of the second base database, it is determined that the target in the target image is successfully recognized.
[0092] The second score threshold can be set according to actual needs, and is usually greater than the first score threshold. For example, the first score threshold is 70, and the second score threshold can be 75.
[0093] In actual implementation, in order to improve the accuracy of target recognition and avoid recognition errors, it is necessary to determine whether the target identification of the third image is the same as that of the first image. If the target identification of the third image is the same as that of the first image, and the second matching score is higher than or equal to the second score threshold of the second base database, it means that the target in the target image is the same as the target in the third image, and it can be determined that the target in the target image has been successfully recognized.
[0094] In the above method, when the first matching score is lower than the first score threshold and the first matching score is higher than or equal to the activation threshold of the second base database, the third image with the highest matching degree with the target image and the second matching score between the target image and the third image are obtained through the second base database; when the target identifier of the third image is the same as that of the first image and the second matching score is higher than or equal to the second score threshold of the second base database, it is determined that the target recognition in the target image is successful. This method uses a double-base recognition method to comprehensively judge whether the target is successfully recognized through the first image and the first matching score obtained from the first base and the second base, as well as the third image and the second matching score. Compared with the single-base recognition method, the first score threshold of the first base can be lowered. For example, the previous score was 70, which can now be reduced to 65. It can also identify target images that failed to be recognized by the first base, significantly improving the recall rate of target recognition. On the tested traffic return data set, it can be increased by 6 to 8 points. In addition, since the judgment of whether the target identification of the first image and the third image is the same is added, the targets in the acquired images are consistent, avoiding misidentification inside and outside the base, and identifying one person as another person, improving the recognition effect of the accuracy of target recognition, and improving the experience of target recognition in the traffic scene.
[0095] See also Figure 5 A specific target identification method flow chart is shown in FIG. 1 . In this embodiment, a scene of recognizing a human face is taken as an example. Figure 5 As shown, first initialize SDK (Software Development Kit) and Handle, detect the front-end design framework (Detect-Feed Frame), update or restore the base library (imagecache refresh) and image (faceImg Cache); there is also a pass face recognition system (mFace PassManager recognize), which includes two base libraries (include double base search); specific initialization settings, set search Th1: the first base library recognition threshold recommended threshold 71 (corresponding to the aforementioned first score threshold of 71), set search Th2: the second base library recognition threshold recommended threshold 75.316 (corresponding to the aforementioned second score threshold of 75.316), set updataTh: the dynamic base library update threshold recommended threshold 75 (corresponding to the aforementioned second base library update threshold of 75), set searchLow: enable the lowest threshold of the dynamic base library recommended threshold 50 (corresponding to the aforementioned second base library enablement threshold of 50).
[0096] At the same time, the attribute requirements for updating the second base library are set (corresponding to the aforementioned preset image conditions), among which pose: yaw is less than 20, pitch is less than 20 (corresponding to the target pose parameter threshold of 20 in the aforementioned target image); blur: 0.6 (corresponding to the clarity threshold of 0.6 in the aforementioned target image); brightness: 40 to block out dark light (corresponding to the illumination intensity threshold of 40 in the aforementioned target image); occusion (abbreviated as occ): 0 according to the occlusion requirements for storage (corresponding to the occlusion degree threshold of 0 in the aforementioned target image). In addition, searchScore1 (corresponding to the aforementioned first matching score) and searchScore2 (corresponding to the aforementioned second matching score) in the figure. In addition, the max score hashMap in the figure (corresponding to the replacement threshold of the aforementioned target identifier).
[0097] Specifically, the first image with the highest matching degree with the target image and the first matching score searchScore1 between the target image and the first image are obtained through the first base database. If searchScore1>search Th1, it means that Base1 Success, that is, the first base database successfully identifies the target in the target image. If searchScore1>search Th1, and searchScore1>updata Th, then the Updata max score hashMap is updated to update the replacement threshold corresponding to the target identifier of the first image, and the matching score with the highest score is updated to the replacement threshold; then it is also necessary to determine whether the target image meets the preset image conditions, that is, to determine whether Abs(pose)<20; &&blur<0.6; &&brightness>40; &&occ==0; if the above conditions are met, the image in the second base database (base2) is updated, and the database of the face recognition access system is adjusted at the same time.
[0098] If searchScore1 < search Th1, first determine the magnitude relationship between the first matching score searchScore1 and the activation threshold search Low of the second database. If searchScore1 < search Low, the recognition fails; if searchScore1 > search Low, determine the recognition result of the target to be recognized through the second database. Specifically, obtain the third image with the highest matching degree with the target image from the second database, as well as the second matching score searchScore2 between the target image and the third image. Determine the magnitude relationship between the second matching score searchScore2 and the second score threshold search Th2. If searchScore2 < search Th2, the recognition fails; if searchScore2 > search Th2, it is also necessary to determine whether the target identifier base2token of the third image is the same as the target identifier base1token of the first image. If base2token == base1token, then base2 Success, that is, it is determined that the target recognition in the target image is successful; if base2token is different from base1token, the recognition fails.
[0099] The specific target recognition method provided by the above embodiment has the same technical features as the target recognition method provided by the foregoing embodiment, so it can also solve the same technical problems and achieve the same technical effects.
[0100] Embodiment Five:
[0101] An embodiment of the present invention provides a target recognition device, as Figure 6 shown. The device includes:
[0102] An acquisition module 61, configured to obtain a first image with the highest matching degree with a target image from a first database, as well as a first matching score between the target image and the first image; wherein, a second image with the same target identifier as the first image is stored in a second database;
[0103] A replacement module 62, configured to determine that the target recognition in the target image is successful when the first matching score is higher than the first score threshold of the first database; when the first matching score meets a preset score condition and the target image meets a preset image condition, replace the second image with the target image;
[0104] A recognition module 63, configured to determine the recognition result of the target to be recognized through the second database when the first matching score is lower than the first score threshold.
[0105] The embodiment of the present invention provides a target recognition device, which obtains the first image with the highest matching degree with the target image and the first matching score between the target image and the first image through the first base library; when the first matching score is higher than the first score threshold of the first base library, it is determined that the target in the target image is successfully recognized; when the first matching score meets the preset score condition and the target image meets the preset image condition, the second image is replaced with the target image; when the first matching score is lower than the first score threshold, the recognition result of the target to be recognized is determined through the second base library. In this method, two base libraries are set up in total. If the target can be successfully recognized through the first base library and the target image meets certain conditions, the target image can be updated to the second base library, so that the image in the second base library contains more comprehensive and accurate features of the target; when the target recognition fails through the first base library, it can be recognized based on the second base library; thereby improving the accuracy and recognition effect of target recognition.
[0106] Furthermore, the above-mentioned preset score conditions include: the first matching score is higher than the first score threshold, and the first matching score is higher than the update threshold of the second base library; wherein the update threshold is used to: when the first matching score is higher than the update threshold, allow the image in the second base library to be updated.
[0107] Furthermore, the above-mentioned preset score condition also includes: the first matching score is higher than the replacement threshold corresponding to the target identifier of the first image; wherein the replacement threshold is used to: when the first matching score is higher than the replacement threshold, allow the image corresponding to the target identifier to be replaced.
[0108] Furthermore, the above-mentioned device also includes a threshold updating module, which is used to update the replacement threshold to the first matching score when the first matching score is higher than the replacement threshold corresponding to the target identifier of the first image.
[0109] Furthermore, the above-mentioned preset image conditions include one or more of the following: the posture parameters of the target in the target image meet the preset posture parameter threshold; the clarity of the target image meets the preset clarity threshold; the light intensity of the target image meets the preset light intensity threshold; the occlusion degree of the target in the target image meets the preset occlusion degree threshold.
[0110] Furthermore, the above-mentioned identification module is also used to: when the first matching score is lower than the first score threshold, and the first matching score is higher than or equal to the activation threshold of the second base database, determine the identification result of the target to be identified through the second base database; wherein the activation threshold is used to: if the first matching score is higher than or equal to the activation threshold, allow the identification result of the target to be identified to be determined through the second base database.
[0111] Furthermore, the above-mentioned recognition module is also used to: obtain a third image with the highest degree of matching with the target image, and a second matching score between the target image and the third image through the second base database; when the target identifier of the third image is the same as that of the first image, and the second matching score is higher than or equal to the second score threshold of the second base database, it is determined that the target recognition in the target image is successful.
[0112] The target recognition device provided in the embodiment of the present invention has the same technical features as the target recognition method provided in the above embodiment, so it can also solve the same technical problems and achieve the same technical effects.
[0113] Embodiment six:
[0114] An embodiment of the present invention provides an electronic system, which includes: an image acquisition device, a processing device and a storage device; the image acquisition device is used to obtain preview video frames or image data; a computer program is stored on the storage device, and the computer program executes the steps of the above-mentioned target recognition method when the processed device is running.
[0115] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the electronic system described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0116] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processing device, the steps of the target recognition method described above are executed.
[0117] The computer program products of the target identification method, device and electronic system provided in the embodiments of the present invention include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be found in the method embodiments and will not be repeated here.
[0118] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0119] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0120] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, 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 storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned 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, etc., which can store program codes.
[0121] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0122] Finally, it should be noted that the above embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A target recognition method, characterized in that: The method comprises: Obtaining a first image with the highest matching degree with the target image and a first matching score between the target image and the first image through the first base database; wherein a second image with the same target identifier as the first image is stored in the second base database; the images in the second base database are clearer than the images in the first base database, and the features of the images contained are more comprehensive; When the first matching score is higher than the first score threshold of the first base database, it is determined that the target in the target image is successfully recognized; when the first matching score meets a preset score condition and the target image meets a preset image condition, the second image is replaced with the target image; When the first matching score is lower than the first score threshold, the recognition result of the target to be recognized is determined through the second base database.
2. The method according to claim 1, characterized in that: The preset score condition includes: the first matching score is higher than the first score threshold, and the first matching score is higher than the update threshold of the second base database; The update threshold is used to allow updating of images in the second base database when the first matching score is higher than the update threshold.
3. The method according to claim 2, characterized in that The preset score conditions also include: The first matching score is higher than a replacement threshold corresponding to the target identifier of the first image; wherein the replacement threshold is used to allow replacement of the image corresponding to the target identifier when the first matching score is higher than the replacement threshold.
4. The method according to claim 1, characterized in that: After the step of replacing the second image with the target image, the method further comprises: When the first matching score is higher than a replacement threshold corresponding to the target identifier of the first image, the replacement threshold is updated to the first matching score.
5. The method according to any one of claims 1 to 4, characterized in that: The preset image conditions include one or more of the following: The posture parameter of the target in the target image meets a preset posture parameter threshold; The clarity of the target image meets a preset clarity threshold; The illumination intensity of the target image meets a preset illumination intensity threshold; The occlusion degree of the target in the target image meets a preset occlusion degree threshold.
6. The method according to any one of claims 1 to 4, characterized in that: When the first matching score is lower than the first score threshold, the step of determining the recognition result of the target to be recognized through the second base database includes: When the first matching score is lower than the first score threshold, and the first matching score is higher than or equal to the activation threshold of the second base database, determining the recognition result of the target to be recognized through the second base database; The activation threshold is used to allow the identification result of the target to be identified to be determined through the second base database if the first matching score is higher than or equal to the activation threshold.
7. The method according to claim 1 or 6, characterized in that: The step of determining the recognition result of the target to be recognized through the second base database includes: Acquire, through the second base database, a third image having the highest matching degree with the target image, and a second matching score between the target image and the third image; When the target identifiers of the third image and the first image are the same, and the second matching score is higher than or equal to the second score threshold of the second base database, it is determined that the target in the target image is successfully recognized.
8. A target recognition device, characterized in that: The device comprises: an acquisition module, configured to acquire, through a first base database, a first image with the highest matching degree with a target image, and a first matching score between the target image and the first image; wherein a second image with the same target identifier as the first image is stored in a second base database; and the images in the second base database are clearer than those in the first base database, and contain more comprehensive features of the images; a replacement module, configured to determine that the target in the target image is successfully recognized when the first matching score is higher than a first score threshold of the first base database; and to replace the second image with the target image when the first matching score satisfies a preset score condition and the target image satisfies a preset image condition; An identification module is used to determine an identification result of the target to be identified through the second base database when the first matching score is lower than the first score threshold.
9. An electronic system, characterized in that: The electronic system includes: a processing device and a storage device; The storage device stores a computer program, and when the computer program is executed by the processing device, the target recognition method according to any one of claims 1 to 7 is executed.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the target recognition method according to any one of claims 1 to 7 are executed.
Citation Information
Patent Citations
Object recognition method, device and system
CN107886079A