Image search method, device, system, computer equipment and storage medium
By screening images with similar horizontal deflection angles in the image library, the problem of few feature values in side facial images is solved, efficient and accurate image search is achieved, and the application efficiency of scenarios such as access control systems is improved.
Patent Information
- Application Number
- CN202311295356.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-08
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2043-10-08
AI Technical Summary
Traditional image search technology requires frontal facial images for identification and verification, while profile facial images have fewer feature values, which affects the accuracy of search results.
By obtaining the feature data of the image, the preset similarity conditions are used to search for a similar image result set from the image library, and the preliminary screening image is screened within the preset angle range based on the horizontal deflection angle difference to determine whether it is in the target angle range to confirm the target image.
The accuracy and efficiency of image search have been improved, especially in scenarios such as access control systems, which has improved the efficiency of personnel entry and exit.
Smart Images

Figure CN117197875B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer vision technology, and in particular to an image search method, apparatus, system, computer equipment, and storage medium. Background Art
[0002] Traditional image search technologies typically require frontal facial images for recognition and verification. However, in real life, frontal facial images are often unavailable. For example, in many security scenarios, walking subjects are photographed from various angles, making frontal facial images difficult to obtain.
[0003] The current common search method in the industry involves extracting facial features from a single facial image to generate a model. This model is then compared with facial feature data within a specified range, searching for snapshots that meet a similarity threshold. However, fewer facial feature values can be extracted from profile facial images, directly impacting the accuracy of search results. Summary of the Invention
[0004] In order to address the deficiencies of the prior art, the purpose of this application is to provide an image search method, apparatus, system, computer equipment and storage medium to achieve the purpose of efficiently searching for target images, and the searched target images are highly accurate.
[0005] To achieve the above objectives, this application adopts the following technical solutions:
[0006] In a first aspect, the present application provides an image search method, the method comprising:
[0007] Acquire feature data of the first image, and search the image library for a first image result set whose similarity with the first image meets a preset similarity condition based on the feature data of the first image; search the first image result set for whether there is a preliminary screening image, and the angle difference between the horizontal deflection angle of the preliminary screening image and the horizontal deflection angle of the first image is within a preset angle range; if the preliminary screening image exists, determine whether the horizontal deflection angle of the preliminary screening image is within a target angle range, and if so, confirm the preliminary screening image as the target image.
[0008] The above technical solution brings at least the following beneficial effects: by searching for a target image with a smaller horizontal deflection angle in the image library through the first image with a larger horizontal deflection angle, the identity of a specific person is determined with high accuracy.
[0009] In some embodiments, searching in the first image result set whether there is a preliminary screening image includes: searching in the first image result set whether there is a second image, and the angle difference between the horizontal deflection angle of the second image and the horizontal deflection angle of the first image is in a first angle range; if the second image exists, the second image is confirmed as the preliminary screening image; if the second image does not exist, searching in the first image result set whether there is a third image, and the angle difference between the horizontal deflection angle of the third image and the horizontal deflection angle of the first image is in a second angle range, and the second angle range is different from the first angle range; if the third image exists, the third image is confirmed as the preliminary screening image.
[0010] In some embodiments, the second angle interval is determined in the following manner: the second angle interval is obtained by increasing or decreasing a preset offset according to the first angle interval.
[0011] In some embodiments, the method further includes: if the horizontal deflection angle of the preliminary screening image is outside the target angle range, using the preliminary screening image to update the first image.
[0012] In some embodiments, updating the first image using the primary screening image includes: determining a target primary screening image in the primary screening image that has the highest similarity to the first image; and updating the first image using the target primary screening image.
[0013] In some embodiments, before screening the image with the highest similarity from the preliminary screening images and updating it as the first image, the method further includes: determining the number of updates for updating the first image based on the preliminary screening images; if the number of updates does not reach an upper limit, screening the image with the highest similarity and updating it as the first image.
[0014] In a second aspect, the present application provides an image search device, which includes: an acquisition module for acquiring feature data of a first image; a preprocessing module for searching from an image library for a first image result set whose similarity with the first image meets a preset similarity condition; a screening module for searching in the first image result set whether there is a preliminary screening image, and the angle difference between the horizontal deflection angle of the preliminary screening image and the horizontal deflection angle of the first image is within a preset angle range; a confirmation module for determining whether the horizontal deflection angle of the preliminary screening image is within a target angle range, and if so, confirming the preliminary screening image as a target image.
[0015] In a third aspect, the present application provides a computer device comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; the memory is used to store computer programs, and when the processor is used to execute the computer programs stored in the memory, the computer device executes the image search method as described in the first aspect and any possible one thereof.
[0016] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored therein. When the computer program is executed by a computer device, the computer device executes the image search method as described in the first aspect and any possible image search method thereof.
[0017] In a fifth aspect, the present application provides an image search system, the system comprising the computer device and the image acquisition device according to the third aspect, wherein:
[0018] The image acquisition device is used to acquire a first image and send the first image to a computer device.
[0019] The beneficial effects of the second to fifth aspects mentioned above can be referred to the corresponding description of the first aspect and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 Schematic diagram of the flow of the image search method in the embodiment of the present application;
[0021] Figure 2 This is a schematic diagram of the display interface of the controller in an embodiment of the present application;
[0022] Figure 3 This is a flowchart of a method for performing image search based on a first image in an embodiment of the present application;
[0023] Figure 4 This is a flowchart of updating the first image using the first image result set in an embodiment of the present application;
[0024] Figure 5 This is a logic judgment diagram of the image search method in the embodiment of the present application;
[0025] Figure 6 A connection block diagram of an image search device in an embodiment of the present application;
[0026] Figure 7 This is a schematic diagram of a computer device in an embodiment of the present application;
[0027] Figure 8 Schematic diagram of an image search system in an embodiment of the present application. DETAILED DESCRIPTION
[0028] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0029] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. "First", "second", "third", and "fourth" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first", "second", "third", and "fourth" may explicitly or implicitly include at least one of such features. The singular forms "a", "an", and "the" used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0030] In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application, and to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application are further described in detail below with reference to the accompanying drawings.
[0031] It should be noted that the serial numbers of the steps in the embodiments of the present application do not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0032] See Figure 1 , is a flow chart of an image search method provided in an embodiment of the present application. The image search method may include the following steps:
[0033] Step S100: Acquire feature data of a first image, and search an image library for a first image result set whose similarity with the first image meets a preset similarity condition based on the feature data of the first image.
[0034] In practical applications, the first image may be at least one or more images from which a search request is initiated, and the subsequent image search process is performed based on the manually input first image.
[0035] In addition, the first image may also be a frame image captured from a video stream, or an image framed and selected from a video stream, which is used as the first image to perform a subsequent image search process.
[0036] Exemplarily, the first image contains at least characteristic data of a specific person, wherein the characteristic data includes at least facial features (the face of the specific person, such as the eyes, mouth, and cheeks, so as to obtain the pupil distance of the eyes, the vector distance from the eyes to the mouth, and the proportion of the cheeks to the entire face, etc.). Based on the first image containing the above-mentioned characteristic data, an image library is searched for images whose similarity to the first image meets a preset similarity condition, and the images meeting the preset similarity condition are output as a first image result set. The preset similarity condition can be adjusted according to actual conditions. For example, a similarity threshold can be set. When there is an image in the image library with a similarity to the first image greater than the set similarity threshold, it can be considered that the preset similarity condition is met.
[0037] After acquiring the feature data of the first image, a vector is generated from the extracted feature data, and finally the vector is converted into a model value. Similarity is a floating-point number between 0 and 1, generated by comparing the model value generated by the first image with the models generated by each image in the image library. The closer the similarity is to 1, the more similar the two images are.
[0038] Through the above configuration, based on the comparison results of the feature data of the first image with the feature data of each image in the image library, a first image result set whose similarity meets the preset similarity conditions is obtained. This narrows the search scope in the image search process, reduces unnecessary computing power waste, and improves the efficiency of image search.
[0039] As an optional implementation method, in order to improve the efficiency of image search, the search range of the image library can be selected according to different segments, so as to reduce the computational complexity of the execution entity of the method for implementing the image search in the embodiment of the present application, thereby improving the efficiency of image search.
[0040] Exemplarily, different segments may include time segments. If the first image is a frame captured from a video stream, or an image selected from a frame in a video stream, a time segment before and after the shooting time is defined based on the shooting time of the first image. Based on the feature data of the first image, an image database is searched for images that fall within the time segment and whose similarity to the first image meets a preset similarity condition, and these images are used as the first image result set. This narrows the search scope in the image search process, reduces unnecessary computing power waste, and improves the efficiency of image search.
[0041] In another example, different segments can include spatial segments. If the first image is a frame captured from a video stream, or an image selected from a frame within a video stream, a spatial segment surrounding the shooting area of the first image is defined based on the shooting area. Based on the feature data of the first image, an image database is searched for images that fall within the spatial segment and whose similarity to the first image meets a preset similarity condition, and these images are used as the first image result set. This narrows the search scope in the image search process, reduces unnecessary computing power waste, and improves image search efficiency.
[0042] As another optional implementation, since the image library contains a large number of images, when the first image result set is obtained by screening according to the preset similarity conditions, the number of images contained in the first image result set is still relatively large. In this case, the first image result set can be preprocessed; wherein the preprocessing includes at least one of the following or any combination: clarity processing, image grayscale processing, and pupil distance processing. This ensures that the initial screening images obtained from the first image result set have higher image quality. Filtering out some lower-quality images can reduce the computational complexity during the image search process and improve the efficiency of the image search.
[0043] Exemplarily, the pupillary distance processing process includes: after obtaining the first result image set, filtering out images that do not meet the pupillary distance threshold based on the pupillary distance of the faces in the first result image set. The pupillary distance refers to the distance between the pupils of the eyes. The smaller the pupillary distance, the greater the deflection angle of the face of the specific person in the image. Since the purpose of image search is to find frontal facial images of the same specific person as the first image, filtering can be performed based on pupillary distance. For example, if the filtering rule is that the pupillary distance is greater than 10 mm, images with a pupillary distance greater than 10 mm will be selected.
[0044] Exemplarily, the clarity processing process includes: after obtaining the first result image set, performing clarity detection on the first result image set, and filtering out portions of the image that do not meet a clarity threshold.
[0045] Exemplarily, the image grayscale processing process includes: after obtaining the first result image set, performing image grayscale detection on each image in the first result image set, and filtering out some images that do not meet the image grayscale threshold.
[0046] It should be noted that, in the above preprocessing process, multiple preprocessing methods of the first image result set can be independently executed simultaneously (which can be understood as having multiple pipelines with different processing logics, each pipeline working simultaneously), thereby improving the efficiency of image search.
[0047] In addition, in the above-mentioned preprocessing process, multiple preprocessing methods of the first image result set can be processed according to a preset sequence string (for example, pupil distance, clarity processing, and image grayscale processing are performed on the first image result set in sequence), and there is no specific limitation on the order of the various preprocessing methods in the sequence string.
[0048] Optionally, in addition to clarity processing, image grayscale processing, and pupil distance processing, other pre-processing methods may be added, such as image quality processing, to filter images based on their visibility and total score, thereby filtering out images of poor quality.
[0049] In an embodiment of the present application, after preprocessing the first image result set according to the above method, the number of images in the first image result set is reduced, and each image in the first image result set is ensured to have high quality, thereby avoiding unnecessary waste of resources during the image search process.
[0050] Step S200: Searching whether there is a preliminary screening image in the first image result set, where the angle difference between the horizontal deflection angle of the preliminary screening image and the horizontal deflection angle of the first image is within a preset angle range.
[0051] It should be noted that the image search method in the embodiments of the present application sets a preset angle interval, and uses images in the first image result set whose angle difference from the horizontal deflection angle of the first image is within the preset angle interval as preliminary screening images. Because a large angle difference may result in a low probability that the searched image is the same person as the first image, and a small angle difference may reduce search efficiency, the preset angle interval is set to search for preliminary screening images whose angle difference from the horizontal deflection angle of the first image is within the preset angle interval, thereby ensuring the accuracy and efficiency of the image search.
[0052] Step S300: If there is a preliminary screening image, determine whether the horizontal deflection angle of the preliminary screening image is within the target angle range. If it is within the target angle range, confirm the preliminary screening image as the target image.
[0053] It should be noted that the subsequent image search process only makes sense if the horizontal deflection angle of the first image is outside the target angle range. When the horizontal deflection angle of the first image is within the target angle range, the first image is directly output as the target image, and the identity of the specific person is identified based on the target image.
[0054] The target angle range is used to characterize that the initial screening image is a frontal facial image of a specific person.
[0055] For example, when the target angle range is greater than or equal to -10° and less than or equal to 10°, if the horizontal deflection angle of the first image is within the target angle range, it means that the camera has captured a frontal facial image of a specific person. The identity of the specific person can be identified based on the first image without executing a subsequent image search process, thereby avoiding waste of resources.
[0056] The target angle range is adjustable within the execution entity of the aforementioned image search method. The execution entity of the image search method may be a controller of a system such as an access control management system, a building management system, a company attendance system, or a public security management system, such as a backend server or controller. The image search method provided in the embodiments of the present application may be implemented by at least one of software, hardware circuitry, and logic circuitry within the execution entity.
[0057] Taking a public security management scenario as an example, a video stream is captured from cameras deployed in a city, and a frame containing an image of a specific person is selected from the video stream as the first image. The horizontal deflection angle of the first image is outside the target angle range, meaning that the first image is a profile image of the specific person's face. A search is then performed from the image library for a set of first image results whose similarity to the first image meets a preset similarity condition. A search is then performed within the set of first image results to determine whether a preliminary screening image exists. If a preliminary screening image exists, the initial screening image is determined to determine whether its horizontal deflection angle is within the target angle range. If so, the preliminary screening image is identified as the target image.
[0058] In an embodiment of the present application, the provided image search method can also be used in the application scenario of an access control system. A camera is installed on at least one side of the gate of the access control system. When a specific person enters the camera's acquisition range, the camera acquires a first image. The camera can send the acquired first image to an electronic device at the background control end, and the electronic device accurately detects the position and size of the face in the first image. Among them, face detection can adopt a face detection algorithm based on deep learning. In the face detection algorithm based on deep learning, a large amount of face sample data is first collected, and then the face area is annotated. The detection model is trained using a deep learning network, and the first image is input into the detection model, so that an end-to-end image of the side face area of the face can be obtained. Of course, the face detection method can also be a traditional feature comparison method, which will not be described here.
[0059] Optionally, when the camera has core processing capabilities, the camera can directly detect feature data of the first image when capturing the first image, and send the feature data of the first image to the electronic device at the background control end.
[0060] Compared to related technologies, the camera is required to capture a frontal facial image of a specific person in order to implement the subsequent image search process. Because the camera is set on the side of the gate, it is more difficult to capture a frontal facial image of a specific person through the camera. Generally, the specific person needs to adjust their body posture or head posture, resulting in low efficiency in the application scenario of the access control system for people entering and exiting the gate. The image search method in the embodiment of the present application can greatly improve the efficiency of people entering and exiting the gate in the application scenario of the access control system.
[0061] When at least one preliminary screening image is found from the first image result set based on the feature data of the first image, and the difference between the horizontal deflection angle of the preliminary screening image and the horizontal deflection angle of the first image is within a preset angle range, if the horizontal deflection angle of the preliminary screening image is within the target angle range, it is considered that the target image has been found, the search may be stopped, and the obtained target image may be displayed on the display interface of the controller.
[0062] like Figure 2 As shown, the controller's display interface includes at least a target image display area, a first image display area, and a comparison area. The first image display area is used to display the first image, and the target image display area is used to display multiple target images. When the number of target images is greater than or equal to one, the target images can be defined as target image 1, target image 2, ..., target image n, and arranged sequentially within the target image display area. The comparison area is used to simultaneously display the first image and any target image.
[0063] For example, when an operator selects any target image in the target image display area, the selected target image is displayed in the comparison area, so that the operator can compare the first image with the selected target image. At the same time, the identity information of the person in the selected target image can also be displayed in the comparison area.
[0064] Optionally, a target image number threshold can be set on the controller, that is, when the number of target images is greater than the target image number threshold, each image in the target image is sorted in descending order according to similarity, so that target images with higher similarity than the image number threshold are presented on the display interface.
[0065] like Figure 3 As shown, searching for the presence of a preliminary screening image in the first image result set specifically includes:
[0066] Step S201: Searching for a second image in the first image result set, wherein the angle difference between the horizontal deflection angle of the second image and the horizontal deflection angle of the first image is within a first angle range; if the second image exists, confirming the second image as a preliminary screening image.
[0067] When there is a second image in the first image result set that can be used as a primary screening image, the first angle interval is equal to the preset angle interval.
[0068] Exemplarily, in order to search for a preliminary screening image in the first image result set, assuming that the horizontal deflection angle of the first image is 90°, the first angle range is greater than or equal to -30° and less than or equal to 15°, the first image result set is searched to obtain the second image, wherein the horizontal deflection angle of the second image is greater than or equal to 60° and less than or equal to 105°.
[0069] As can be seen, in step S201, the first image result set is searched based on the horizontal deflection angle and the first angle range of the first image to obtain the second image. The second image and the first image can be considered to be images of the same specific person from different angles. The above image search method does not process or modify the feature data of the first image in any way, thereby increasing the reliability of the output preliminary screening image.
[0070] Step S202: If the second image does not exist, search the first image result set for a third image, wherein the angle difference between the horizontal deflection angle of the third image and the horizontal deflection angle of the first image is in a second angle interval, and the second angle interval is different from the first angle interval.
[0071] Step S203: If the third image exists, the third image is confirmed as the primary screening image.
[0072] In the absence of the second image, the controller can increase or decrease the preset offset according to the first angle interval to obtain the second angle interval.
[0073] Exemplarily, the first angle interval is greater than or equal to -30° and less than or equal to 15°. If the second image does not exist, the controller adjusts the first angle interval according to a preset offset to obtain a second angle interval. For example, if the preset offset is ±10°, the adjusted second angle interval may be greater than or equal to -40° and less than or equal to 5°; or the adjusted second angle interval may be greater than or equal to -20° and less than or equal to 25°.
[0074] It should be noted that while the embodiments of this application illustrate a single adjustment within the first angle interval, this does not necessarily mean that only the first angle interval can be adjusted once. Optionally, if the third image does not exist, the first image result set is searched for a fourth image, where the horizontal deflection angle difference between the fourth image and the first image falls within a third angle interval. The first angle interval is increased or decreased by a preset offset to obtain the third angle interval, and the third angle interval is different from the second angle interval. Each preset offset can be adjusted based on actual conditions and can be the same or different.
[0075] The above settings can ensure that the obtained second image, third image and fourth image all have a high degree of similarity with the first image, and the deflection angle difference is within a certain reasonable range, thereby improving the accuracy of image search.
[0076] The image search method proposed in the embodiment of the present application also includes: if the horizontal deflection angle of the preliminary screening image is outside the target angle range, the first image is updated using the first image result set.
[0077] It should be noted that in order to avoid the situation where the target image cannot be obtained from the first image result set, based on the above considerations, the image with the highest similarity to the first image in the preliminary screening image is updated to the first image, and the image search method such as steps S100 to S300 is continued until the target image of the expected specific person, such as a frontal facial image, is searched out, thereby improving the accuracy of the image search. The above image search method has higher fault tolerance.
[0078] like Figure 4 As shown, the method of updating the first image using the preliminary screening image specifically includes:
[0079] Step S401: If the horizontal deflection angle of the primary screening image is outside the preset angle range, determine the number of updates for the first image based on the primary screening image.
[0080] Exemplarily, when the second image searched according to the first image result set is used as the primary screening image, if the horizontal deflection angle of the primary screening image is outside the target angle range, the primary screening image is used to update the first image.
[0081] For example, when the second image does not exist, the third image is searched in the first image result set, and the third image is used as the primary screening image, it is also possible to determine whether the third image serving as the primary screening image is within the target angle range. If the horizontal deflection angle of the primary screening image is outside the preset angle range, the first image is updated using the third image serving as the primary screening image.
[0082] It should be noted that in order to avoid unlimited updating of the first image, the number of updates is set as in step S401. If the number of updates reaches the upper limit, the image search process ends even if the target image is not obtained, thereby avoiding waste of resources during the image search process.
[0083] Step S402: If the number of updates does not reach the upper limit, determine the target preliminary screening image with the highest similarity to the first image among the preliminary screening images.
[0084] Step S403: Update the first image using the target preliminary screening image.
[0085] For example, the image in the preliminary screening image satisfies a preset similarity condition with the first image. Therefore, by selecting the image with the highest similarity to the first image from the preliminary screening image as the target preliminary screening image, it can be considered that the target preliminary screening image and the first image contain the same specific person.
[0086] Optionally, in addition to the above-mentioned method of updating the first image by using the highest similarity, a more suitable image can be selected as the target primary screening image based on the weights of the similarity and the horizontal deflection angle of the primary screening image, and the target primary screening image can be used to update the first image.
[0087] Among them, the logical judgment diagram of image search can be as follows Figure 5 shown.
[0088] like Figure 6 As shown, an embodiment of the present application further provides an image search device, the device comprising:
[0089] The acquisition module 11 is configured to acquire feature data of the first image.
[0090] The pre-processing module 12 is configured to search the image library for a first image result set whose similarity with the first image meets a preset similarity condition.
[0091] The screening module 13 is configured to search the first image result set for a preliminary screening image, wherein the angle difference between the horizontal deflection angle of the preliminary screening image and the horizontal deflection angle of the first image is within a preset angle range.
[0092] The confirmation module 14 is used to determine whether the horizontal deflection angle of the primary screening image is within the target angle range. If it is within the target angle range, the primary screening image is confirmed as the target image.
[0093] Optionally, the screening module 13 is specifically used to: search whether there is a second image in the first image result set, and the angle difference between the horizontal deflection angle of the second image and the horizontal deflection angle of the first image is in a first angle range; if the second image exists, the second image is confirmed as a preliminary screening image; if the second image does not exist, search whether there is a third image in the first image result set, and the angle difference between the horizontal deflection angle of the third image and the horizontal deflection angle of the first image is in a second angle range, and the second angle range is different from the first angle range; if the third image exists, the third image is confirmed as a preliminary screening image.
[0094] Optionally, if the horizontal deflection angle of the preliminary screening image is outside the target angle range, the screening module 13 is further configured to: update the first image using the preliminary screening image; if the horizontal deflection angle of the preliminary screening image is outside the target angle range, the screening module 13 determines a number of updates to update the first image based on the preliminary screening image. If the number of updates does not reach an upper limit, the screening module 13 determines a target preliminary screening image in the preliminary screening image that has the highest similarity to the first image, and uses the target preliminary screening image to update the first image.
[0095] like Figure 7 As shown, an embodiment of the present application further provides a computer device, which includes: a processor 21, a communication interface 22, a memory 23 and a communication bus 24, wherein the processor 21, the communication interface 22, and the memory 23 communicate with each other through the communication bus 24.
[0096] Memory 23, for storing computer programs;
[0097] The processor 21 is configured to implement the steps in the image search method when executing the computer program stored in the memory 23 .
[0098] The communication bus 24 mentioned in the computer device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 24 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the figure shows only one thick line, but this does not mean that there is only one bus or only one type of bus.
[0099] like Figure 8 As shown, the embodiment of the present application also provides an image search system, including Figure 7 In addition to the corresponding computer device 31 in the embodiment shown, the following further comprises:
[0100] The image acquisition device 32 is used to acquire the first image. If the image acquisition device 32 has core processing capabilities, the image acquisition device 32 can directly detect feature data of the first image when acquiring the first image, and send the feature data of the first image to the computer device 31.
[0101] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the image search method are implemented.
[0102] Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transfer of computer programs from one location to another. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and storage medium can be located in an ASIC. Alternatively, the ASIC can be located in a user device. Of course, the processor and storage medium can also exist as discrete components in a communication device.
[0103] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be implemented using hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0104] Each embodiment in this specification is described in a related manner. Similar portions between the various embodiments can be referenced to each other. Each embodiment focuses on the differences between the other embodiments. In particular, the device, system, computer device, and computer-readable storage medium embodiments are generally similar to the method embodiments, so their descriptions are relatively simple. For related portions, reference can be made to the descriptions of the method embodiments.
[0105] It should be understood that those skilled in the art can make improvements or changes based on the above description, and all such improvements and changes should fall within the scope of protection of the claims appended to this application.
Claims
1. A method for image search, characterized in that: The method comprises: Acquiring feature data of a first image, and searching an image library for a first image result set whose similarity to the first image satisfies a preset similarity condition based on the feature data of the first image; Searching the first image result set for a preliminary screening image, wherein the difference between the horizontal deflection angle of the preliminary screening image and the horizontal deflection angle of the first image is within a preset angle range; If the primary screening image exists, determining whether the horizontal deflection angle of the primary screening image is within a target angle range; if so, confirming the primary screening image as a target image, wherein the target angle range is used to indicate that the primary screening image is a frontal facial image of a specific person; If the horizontal deflection angle of the primary screening image is outside the target angle range, the first image is updated using the primary screening image.
2. The method according to claim 1, characterized in that The searching for whether there is a preliminary screening image in the first image result set includes: Searching the first image result set for a second image, wherein a horizontal deflection angle difference between the second image and the first image is within a first angle range; If the second image exists, confirming the second image as the primary screening image; If the second image does not exist, searching the first image result set for a third image, wherein the angular difference between the horizontal deflection angle of the third image and the horizontal deflection angle of the first image is within a second angular interval, and the second angular interval is different from the first angular interval; If the third image exists, the third image is confirmed as the primary screening image.
3. The method according to claim 2, characterized in that The second angle interval is determined according to the following method: The second angle interval is obtained by increasing or decreasing a preset offset according to the first angle interval.
4. The method according to claim 3, characterized in that The updating of the first image by using the primary screening image includes: determining, among the primary screening images, a target primary screening image having the highest similarity to the first image; The first image is updated using the target preliminary screening image.
5. The method according to claim 3, characterized in that Before updating the first image using the primary screening image, the method further includes: determining an update number for updating the first image according to the primary screening image; If the number of updates does not reach the upper limit, the image with the highest similarity is selected and updated as the first image.
6. An image search device, characterized in that: The device comprises: an acquisition module, configured to acquire feature data of the first image; A pre-processing module, configured to search an image library for a first image result set whose similarity to the first image satisfies a preset similarity condition; a screening module configured to search the first image result set for a preliminary screening image, wherein the difference between the horizontal deflection angle of the preliminary screening image and the horizontal deflection angle of the first image is within a preset angle range; a confirmation module, configured to determine whether the horizontal deflection angle of the preliminary screening image is within a target angle range, and if so, confirm the preliminary screening image as a target image, wherein the target angle range is used to indicate that the preliminary screening image is a frontal facial image of a specific person; If the horizontal deflection angle of the primary screening image is outside the target angle range, the screening module is further configured to update the first image using the primary screening image.
7. A computer device, characterized in that: include: A processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus; The memory is used to store computer programs; The processor is configured to implement the steps of the method according to any one of claims 1 to 5 when executing the computer program stored in the memory.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a computer device, the steps of any one of the methods of claims 1 to 5 are implemented.
9. An image search system, characterized in that: The system comprises a computer device and an image acquisition device according to claim 7, wherein: The image acquisition device is used to acquire a first image and send the first image to the computer device.
Citation Information
Patent Citations
Face detection and recognition method and device
CN108960156A
Mutual information rearrangement method and device for image retrieval, equipment and medium
CN116010634A