Image searching method and device, electronic equipment and storage medium
By setting multiple similarity thresholds in the image search method to filter the image, the problems of low image search accuracy and low efficiency in the prior art are solved, and higher search accuracy and efficiency are achieved.
Patent Information
- Application Number
- CN202311363725.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-19
- Publication Date
- 2025-04-22
AI Technical Summary
When searching for characters, existing image search methods lead to missed or missed searches when searching for characters, and are inefficient.
By setting the first similarity threshold and the second similarity threshold, the similarity calculation between the search image and the image in the image base library is obtained, the first image list and the second image list are filtered, and the images in these lists are finally determined by filtering the search results.
It effectively improves the accuracy of image search, reduces the probability of wrong search or missed search, and improves the efficiency of the image search method.
Smart Images

Figure CN119862293A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to an image search method, device, electronic equipment and storage medium. Background Art
[0002] With the development of search technology, there are more and more search methods. In traditional image search technology, when searching images by text description or by image, when searching for people, due to the high similarity between people, the search results may be missed or the searched person images may not be the required target person images. Therefore, the existing image search methods have the problems of low search accuracy, wrong search or missed search, and low efficiency. Summary of the invention
[0003] The embodiment of the present invention provides an image search method, which aims to solve the problems of low precision and wrong search and missed search when the existing image search method searches for images through images. After calculating the similarity between the image to be searched and the base library in the image base library through the first similarity threshold and the second similarity threshold, a first image list and a second image list are obtained, and then the images in the first image list and the second image list are filtered through the third similarity threshold to obtain a third image list, and finally the final search results are determined based on the images in the second image list and the images in the third image list. In this way, the accuracy of image search can be effectively improved, thereby reducing the probability of wrong search or missed search, and improving the efficiency of the image search method.
[0004] In a first aspect, an embodiment of the present invention provides an image search method, characterized in that the method comprises the following steps:
[0005] Obtaining the image of the target person to be searched;
[0006] Performing a first similarity calculation between the image to be searched and the base images in the image base library, adding base images whose similarity is greater than a first similarity threshold and less than a second similarity threshold to a first image list, and adding base images whose similarity is greater than the second similarity threshold to a second image list, wherein the second similarity is greater than the first similarity;
[0007] After the first similarity calculation is completed, a second similarity calculation is performed based on the first image list and the second image list, and base library images in the first image list whose similarity is greater than a third similarity threshold are added to a third image list;
[0008] After the second similarity calculation is completed, the search results of the image to be searched are determined based on the second image list and the third image list.
[0009] Optionally, before obtaining the image to be searched of the target person, the process includes:
[0010] Acquire target facial features and target morphological features of the target person;
[0011] Based on the target facial features and the target morphological features, an image to be searched of the target person is determined.
[0012] Optionally, the performing a first similarity calculation between the image to be searched and a base image in the image base library, adding base images having a similarity greater than a first similarity threshold and less than a second similarity threshold to the first image list, and before adding base images having a similarity greater than the second similarity threshold to the second image list, comprises:
[0013] Comparing the person in the target area based on the image to be searched to obtain the first similarity threshold, wherein the target area is determined by the flow of people in the target area;
[0014] Based on the image to be searched and the first similarity threshold, a second similarity threshold is determined in the target area.
[0015] Optionally, performing a first similarity calculation on the image to be searched and a base image in the image base library, adding base images having a similarity greater than a first similarity threshold and less than a second similarity threshold to a first image list, and adding base images having a similarity greater than the second similarity threshold to a second image list includes:
[0016] Comparing the target facial features and target morphological features of the target person with the image to be searched and the base images in the image base library, and adding the base images whose comparison results are greater than the first similarity threshold and less than the second similarity threshold to the first image list;
[0017] The target facial features and target morphological features of the target person are compared between the image to be searched and the base images in the image base library, and the base images whose comparison results are greater than the second similarity threshold are added to the second image list.
[0018] Optionally, after the first similarity calculation is completed, performing a second similarity calculation based on the first image list and the second image list, and adding the base image in the first image list whose similarity is greater than a third similarity threshold to the third image list, comprises:
[0019] Comparing the target facial features and target morphological features of the target person with the images in the first image list and the images in the second image list;
[0020] According to the comparison result, the base library images in the first image list whose similarity is greater than a third similarity threshold are added to the third image list.
[0021] Optionally, after the second similarity calculation is completed, determining search results of the image to be searched based on the second image list and the third image list includes:
[0022] Determine a to-be-filtered image list based on the second image list and the third image list;
[0023] Acquire time information and space information corresponding to the images in the to-be-filtered image list, and time information and space information corresponding to the to-be-searched image;
[0024] Based on the time information and the space information, a search result of the image to be searched is determined.
[0025] Optionally, determining the search result of the image to be searched based on the time information and the spatial information includes:
[0026] By comparing the images in the to-be-filtered image list with the to-be-searched image, the images in the to-be-filtered image list that are in the same time period as the to-be-searched image but correspond to different locations are eliminated to obtain a filtered image list;
[0027] Based on the filtered image list, search results of the image to be searched are obtained.
[0028] In a second aspect, an embodiment of the present invention further provides an image search device, the image search device comprising:
[0029] A first acquisition module is used to acquire the image to be searched of the target person;
[0030] A first calculation module is used to perform a first similarity calculation between the image to be searched and a base image in the image base library, add base images whose similarity is greater than a first similarity threshold and less than a second similarity threshold to a first image list, and add base images whose similarity is greater than the second similarity threshold to a second image list, wherein the second similarity is greater than the first similarity;
[0031] A second calculation module is used to perform a second similarity calculation based on the first image list and the second image list after the first similarity calculation is completed, and add the base image in the first image list whose similarity is greater than a third similarity threshold to a third image list;
[0032] The first determination module is used to determine the search results of the image to be searched based on the second image list and the third image list after the second similarity calculation is completed.
[0033] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the image search method provided in the embodiment of the present invention when executing the computer program.
[0034] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the image search method provided in the embodiment of the invention are implemented.
[0035] In an embodiment of the present invention, the image to be searched of the target person is obtained, the image to be searched and the base image in the image base library are subjected to a first similarity calculation, the base image with a similarity greater than the first similarity threshold and less than the second similarity threshold is added to the first image list, and the base image with a similarity greater than the second similarity threshold is added to the second image list. After the first similarity calculation is completed, a second similarity calculation is performed based on the first image list and the second image list, and the base image in the first image list with a similarity greater than the third similarity threshold is added to the third image list. After the second similarity calculation is completed, the search results of the image to be searched are determined based on the second image list and the third image list. After the similarity calculation is performed between the image to be searched and the base image in the image base library by the first similarity threshold and the second similarity threshold, the first image list and the second image list are obtained, and then the images in the first image list and the second image list are filtered by the third similarity threshold to obtain the third image list, and finally the final search results are determined according to the images in the second image list and the images in the third image list. In this way, the accuracy of image search can be effectively improved, thereby reducing the probability of wrong search or missed search, and improving the efficiency of the image search method. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 is a flow chart of an image search method provided by an embodiment of the present invention;
[0038] Figure 2 is a structural schematic diagram of an image search device provided in an embodiment of the present invention;
[0039] Figure 3It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] like Figure 1 As shown, Figure 1 : is a flowchart of an image search method provided by an embodiment of the present invention, the image search method comprising the steps of:
[0042] 101. Obtain the image of the target person to be searched.
[0043] In the embodiment of the present invention, the above-mentioned image search method can be applied to any search engine that can perform image input search. The user can input the above-mentioned image to be searched into the search engine through the search bar attached to the above-mentioned search engine, and the above-mentioned search engine calls the above-mentioned image search method to search the image to be searched, and outputs the search results and presents them on the interactive interface. The above-mentioned interactive interface can be a visual display interface when the user exchanges data with the search engine. The user can provide the search engine with image input information on the interactive interface, view data retrieval results, and other operations.
[0044] The target person may be an object that the user needs to perform an image search on, and the image to be searched may be an image uploaded in the search bar when the user performs a search operation in preparation for the search, or may be an image that has been searched and browsed by the user in the search history. The search engine may be deployed in a data search terminal, and the data search terminal stores business database information. Specifically, the business database information may be search information of the image to be searched. The data search terminal may be an electronic device with data storage, data search processing and analysis functions, and the data search terminal may specifically be a server, computer or mobile phone with data storage, data search processing and analysis functions.
[0045] In a possible embodiment, when the user searches on the data search terminal, the image information of the image to be searched uploaded by the user can be acquired and stored in the service database of the data search terminal.
[0046] 102. Perform a first similarity calculation between the image to be searched and the base images in the image base library, add the base images whose similarity is greater than a first similarity threshold and less than a second similarity threshold to the first image list, and add the base images whose similarity is greater than the second similarity threshold to the second image list.
[0047] In an embodiment of the present invention, the above-mentioned image database may be a collection of images. Specifically, the collection may include but is not limited to the sum of images in the database corresponding to the above-mentioned data search terminal or the above-mentioned search engine. The size of the above-mentioned image database may be determined according to actual conditions. Generally speaking, it can be determined according to the deployment range of the monitoring equipment. For example, the size of the image database corresponding to the monitoring equipment deployed in the block may be the sum of the number of images monitored by all the monitoring equipment in the block.
[0048] The above-mentioned base library image may be an image in the above-mentioned image base library, and the above-mentioned first similarity calculation may be an operation of adding base library images whose similarity is greater than the first similarity threshold and less than the second similarity threshold to the first image list, and adding base library images whose similarity is greater than the second similarity threshold to the second image list. Specifically, the above-mentioned first similarity threshold may be obtained experimentally based on the similarity ratio between the above-mentioned image to be searched and the base library image, and the above-mentioned similarity ratio may be the ratio of the above-mentioned image to be searched to the standard base library image. The above-mentioned standard base library image may be a face image with standard face posture data obtained according to the experiment. In the actual implementation scheme, the above-mentioned first similarity threshold may be set according to the ratio. The above-mentioned second similarity threshold is calculated based on the first similarity threshold and the above-mentioned image to be searched. It should be noted that the above-mentioned second similarity threshold is greater than the first similarity threshold, that is, the image filtered out according to the second similarity threshold is closer to the above-mentioned image to be searched in terms of features than the image filtered out by the first similarity threshold.
[0049] The first image list may be a set of images filtered out according to the first similarity threshold and the second similarity threshold, and the second image list may be a set of images filtered out according to the second similarity threshold.
[0050] In a possible embodiment, after obtaining the image to be searched input by the user, the above-mentioned data search terminal or the above-mentioned search engine compares the input image to be searched with the base image in the image base library in the database, and divides the base image in the image base library into a first image list and a second image list according to a first similarity threshold and a second similarity threshold.
[0051] 103. After the first similarity calculation is completed, a second similarity calculation is performed based on the first image list and the second image list, and base images in the first image list whose similarity is greater than a third similarity threshold are added to the third image list.
[0052] In the embodiment of the present invention, the second similarity calculation may be an operation of adding images in the first image list whose similarity is greater than the third similarity threshold to the third image list according to the third similarity threshold. The third similarity threshold may be obtained according to actual experiments. Specifically, the third similarity threshold may be set higher according to actual needs, such as if images meeting the features of the images to be searched must be filtered out.
[0053] The third image list may be a set of images obtained by filtering the images in the first image list according to the third similarity threshold. It should be noted that the images in the third image list may include images in the first image list and images in the second image list, and conversely, the images in the first image list may also correspond to the images in the second image list.
[0054] In a possible embodiment, after acquiring the first image list, the data search terminal or the search engine adds the images in the first image list to the third image list according to a third similarity threshold.
[0055] 104. After the second similarity calculation is completed, based on the second image list and the third image list, a search result of the image to be searched is determined.
[0056] In an embodiment of the present invention, the search results may be a set of images whose features are related to the image to be searched and output on an interactive interface after the data search terminal or the search engine obtains the image to be searched input by the user.
[0057] In a possible embodiment, after the above-mentioned data search terminal or the above-mentioned search engine performs a search by calling the above-mentioned image search method, before outputting the search results, it will filter the pre-output search results, and filter and screen the repeated or highly similar images in the search results to ensure that the output search results can be more streamlined.
[0058] In an embodiment of the present invention, the image to be searched of the target person is obtained, the image to be searched and the base image in the image base library are subjected to a first similarity calculation, the base image with a similarity greater than the first similarity threshold and less than the second similarity threshold is added to the first image list, and the base image with a similarity greater than the second similarity threshold is added to the second image list. After the first similarity calculation is completed, a second similarity calculation is performed based on the first image list and the second image list, and the base image with a similarity greater than the third similarity threshold in the first image list is added to the third image list. After the second similarity calculation is completed, the search results of the image to be searched are determined based on the second image list and the third image list. After the similarity calculation is performed between the image to be searched and the base library in the image base library by the first similarity threshold and the second similarity threshold, the first image list and the second image list are obtained, and then the images in the first image list and the second image list are filtered by the third similarity threshold to obtain the third image list, and finally the final search results are determined according to the images in the second image list and the images in the third image list. In this way, the accuracy of image search can be effectively improved, thereby reducing the probability of wrong search or missed search, and improving the efficiency of the image search method.
[0059] Optionally, before the step of acquiring the image to be searched of the target person, the target facial features and target morphological features of the target person may be acquired first, and then the image to be searched of the target person may be determined based on the target facial features and target morphological features.
[0060] In the embodiment of the present invention, the above-mentioned target facial features may refer to the external features of the human face and the shape, size, position and other information of the internal organs, which can largely determine the facial features of a person. Specifically, the human face can be monitored and its features can be extracted, and then the extracted features can be stored in the above-mentioned database for preservation. The above-mentioned target morphological features may refer to the features of the target person in appearance and posture, for example, they may be features of a person's clothing, behavior, action details and other aspects. A person often has his own action and behavior habits, which are often captured in the monitoring screen and stored as target morphological feature types and stored in the above-mentioned database.
[0061] In a possible embodiment, after analyzing the target facial features and target morphological features described by the user, the above-mentioned data search terminal or the above-mentioned search engine confirms the corresponding image in the database image base, and then outputs it to the above-mentioned interactive interface for the user to select and view, so as to confirm the image to be searched. Subsequently, according to needs, the selected image to be searched can be re-input into the above-mentioned data search terminal or the above-mentioned search engine for image search, and then the final search result is output.
[0062] Optionally, before performing a first similarity calculation between the image to be searched and the base database images in the image base database, adding the base database images having a similarity greater than a first similarity threshold and less than a second similarity threshold to the first image list, and adding the base database images having a similarity greater than the second similarity threshold to the second image list, it is also possible to compare persons in the target area based on the image to be searched to obtain a first similarity threshold, and then determine a second similarity threshold in the target area based on the image to be searched and the first similarity threshold.
[0063] In the embodiment of the present invention, the target area is determined by the flow of people in the target area. Specifically, the area where the target person often appears can be set as the target area. By searching for the target person in the target area, the search efficiency can be effectively improved. For example, when the target person often appears in a square, the images obtained by the monitoring equipment around the square are called and searched in the corresponding image base, thereby improving the search efficiency.
[0064] In a possible embodiment, when a user performs an image search through the above-mentioned data search terminal or the above-mentioned search engine, the above-mentioned data search terminal or the above-mentioned search engine analyzes the image to be searched input by the user to obtain the target area where the target person often stays, and determines the image base library address corresponding to the target area, and searches the image base library according to the address, and uses the base library map in the image base library to compare with the image to be searched, and obtains a first similarity threshold based on the similarity ratio between the above-mentioned image to be searched and the base library map, and calculates it based on the first similarity threshold and the persons in the target area corresponding to the image to be searched. Specifically, the second similarity threshold is determined when a value greater than the first similarity threshold is obtained by comparing the persons in the target area with the image to be searched, and it can be ensured that two different target persons will not be obtained at the same time in the target area.
[0065] Optionally, in the steps of performing a first similarity calculation between the image to be searched and the base library images in the image base library, adding the base library images whose similarity is greater than a first similarity threshold and less than a second similarity threshold to the first image list, and adding the base library images whose similarity is greater than the second similarity threshold to the second image list, the image to be searched and the base library images in the image base library can also be compared for target facial features and target morphological features of the target person, and the base library images whose comparison results are greater than the first similarity threshold and less than the second similarity threshold can be added to the first image list, and then the image to be searched and the base library images in the image base library can be compared for target facial features and target morphological features of the target person, and the base library images whose comparison results are greater than the second similarity threshold can be added to the second image list.
[0066] In an embodiment of the present invention, the comparison process may be a process of calculating the similarity between the image to be searched and the base image according to the target facial features and the target morphological features. Specifically, the similarity between the facial features of the human face and the facial features of the base image and the morphological features of the person in the image to be searched and the morphological features of the person in the base image may be used for calculation, and the similarity values of the facial features and the similarity values of the morphological features may be obtained respectively, and the final similarity may be determined according to the facial weight ratio and the morphological weight ratio. The final similarity may be obtained according to the following formula:
[0067] P=(∑M×0.7+Y×0.3)×0.01
[0068] Among them, P is the final similarity between the image to be searched and the base image, M is the similarity value of facial features obtained by comparing the image to be searched with the base image, and Y is the similarity value of morphological features obtained by comparing the image to be searched with the base image. It can be obtained from the formula that when M and Y are larger, P is larger, indicating that the features of the base image are closer to the features of the image to be searched.
[0069] In a possible embodiment, when a user performs an image search through the above-mentioned data search terminal or the above-mentioned search engine, the above-mentioned data search terminal or the above-mentioned search engine compares the input image to be searched with the base library images in the image base library, compares the similarity values of the target facial features and the target morphological features, and compares the calculated similarity values with the above-mentioned first similarity threshold and the second similarity threshold, and according to the rule that the base library images whose comparison results are greater than the first similarity threshold and less than the second similarity threshold are added to the first image list, and the base library images whose comparison results are greater than the second similarity threshold are added to the second image list, the base library images in the selected image base library are classified.
[0070] Optionally, after the first similarity calculation is completed, a second similarity calculation is performed based on the first image list and the second image list, and the base library images in the first image list whose similarity is greater than a third similarity threshold are added to the third image list. The images in the first image list can also be compared with the images in the second image list for target facial features and target morphological features of the target person. Based on the comparison results, the base library images in the first image list whose similarity is greater than the third similarity threshold are added to the third image list.
[0071] In an embodiment of the present invention, after the data search terminal or the search engine compares the input image to be searched with the base image in the image base library to obtain the first image list and the second image list, the images in the first image list are compared with the third similarity threshold, and according to the rule that the base images with similarity greater than the third similarity threshold are added to the third image list, the images in the first image list are filtered, and the filtered images in the first image list are added to the third image list as images in the third image list. Specifically, according to the comparison between the first image list and the second image list, the images in the first image list are compared with the images in the second image list in a one-to-many manner, the images in the first image list are filtered, and according to the similarity calculation between the first image list and the second image list, it is determined whether the images in the first image list can be added to the third image list. The above similarity calculation process is the same as the above similarity calculation process between the first image list and the second image list.
[0072] For example, an image in the first image list is selected, and the image is compared with all the images in the second list. According to the above-mentioned similarity calculation method, the similarity between the image and all the images in the second list is averaged, and the average is compared with a preset third similarity threshold. When the average exceeds the third similarity threshold, the picture is added to the third image list.
[0073] More specifically, when calculating the similarity, when calculating the similarity of the target facial features in the image, the calculation can be based on the facial expression and the position of the facial features, etc. For example, when the image in the first image list is a smiling face, and the image in the second image list is a crying face, when calculating the similarity at this time, the matching degree will not be high due to the different expressions, resulting in a decrease in the similarity. Therefore, corrections can be made based on weighted calculations. For example, when the monitored target facial features have mismatched expressions, but the position and proportion of the facial features match, the matching degree of the expression can be improved when calculating the similarity of the target facial features according to the specific implementation plan, thereby improving the calculated similarity.
[0074] Optionally, after the second similarity calculation is completed, in the step of determining the search results of the image to be searched based on the second image list and the third image list, it is also possible to determine the image list to be filtered based on the second image list and the third image list, and then obtain the images in the image list to be filtered and the time information and spatial information corresponding to the images to be searched, and finally determine the search results of the image to be searched based on the time information and the spatial information.
[0075] In an embodiment of the present invention, the above-mentioned to-be-filtered image list may be an image list obtained by deduplicating the second image list and the third image list. Specifically, images in the second image list that are similar to those in the third image list may be deduplicated or one image may be retained, and finally the filtered second image list and the third image list may be integrated into a filtered image list.
[0076] The time information may be the time recorded when the monitoring device acquires the image, and may be saved through the data search terminal or the database corresponding to the search engine. The spatial information may be the location recorded when the monitoring device acquires the image, or may directly use the address where the monitoring device is installed, or may be saved through the data search terminal or the database corresponding to the search engine.
[0077] In a possible embodiment, when a user performs a search operation, the above-mentioned data search terminal or the above-mentioned search engine filters the search results finally output according to the above-mentioned image list to be filtered and the time information and spatial information corresponding to the image to be searched, and presents the final search results through the above-mentioned interactive interface.
[0078] Optionally, in the step of determining the search results of the image to be searched based on the time information and the space information, the images in the list of images to be filtered can be compared with the image to be searched, and images that are in the same time but corresponding to different locations as the image to be searched can be eliminated to obtain a filtered image list, and then the search results of the image to be searched can be obtained based on the filtered image list.
[0079] In the embodiment of the present invention, the elimination may be an operation of filtering the images in the list of images to be filtered according to a rule of retaining at least one image from images corresponding to different locations within the same time period.
[0080] In a possible embodiment, since it is impossible for a person to appear in multiple different places at the same time, during an image search operation, if it is obtained that the target person appears in multiple different places at the same time, it proves that the monitoring image of only one place can be the search result image. Therefore, the above-mentioned data search terminal or the above-mentioned search engine will analyze the person in the search image in this case, obtain the place where the person often appears, and perform a fusion analysis of the above-mentioned multiple different places based on the place, and determine which place's monitoring image is most likely to be the target search result based on the straight-line distance between the above-mentioned frequently appearing place and the above-mentioned multiple different places.
[0081] In another possible embodiment, since a person may appear in multiple different places at different times, during the image search operation, if the target person appears in multiple different places at different times, the target facial features in different places are analyzed to determine that the target person appearing in the different places is the same. In another possible embodiment, when the searched image and the image to be searched are in the same time and place, the image is directly determined as the search result that is finally output.
[0082] like Figure 2 As shown, an embodiment of the present invention further provides an image search device, characterized in that it includes:
[0083] The first acquisition module 201 is used to acquire the image to be searched of the target person;
[0084] A first calculation module 202 is used to perform a first similarity calculation between the image to be searched and the base image in the image base library, add the base images whose similarity is greater than a first similarity threshold and less than a second similarity threshold to the first image list, and add the base images whose similarity is greater than the second similarity threshold to the second image list, wherein the second similarity is greater than the first similarity;
[0085] A second calculation module 203 is configured to perform a second similarity calculation based on the first image list and the second image list after the first similarity calculation is completed, and add the base image in the first image list whose similarity is greater than a third similarity threshold to a third image list;
[0086] The first determination module 203 is configured to determine the search results of the to-be-searched image based on the second image list and the third image list after the second similarity calculation is completed.
[0087] Optionally, the above device includes:
[0088] The second acquisition module is used to acquire the target facial features and target morphological features of the target person;
[0089] The second determination module is used to determine the image to be searched of the target person based on the target facial features and the target morphological features.
[0090] Optionally, the above device further comprises:
[0091] A first comparison module, configured to compare people in a target area based on the image to be searched, and obtain a first similarity threshold, wherein the target area is determined by the flow of people in the target area;
[0092] A third determination module is configured to determine a second similarity threshold in the target area based on the image to be searched and the first similarity threshold.
[0093] Optionally, the first calculation module 202 includes:
[0094] A first comparison submodule is used to compare the image to be searched with the base image in the image base library for target facial features and target morphological features of the target person, and add the base image whose comparison result is greater than the first similarity threshold and less than the second similarity threshold to the first image list;
[0095] The second comparison submodule is used to compare the target facial features and target morphological features of the target person with the image to be searched and the base library images in the image base library, and add the base library images whose comparison results are greater than the second similarity threshold to the second image list.
[0096] Optionally, the second calculation module 203 includes:
[0097] A third comparison submodule, used for comparing the target facial features and target morphological features of the target person between the images in the first image list and the images in the second image list;
[0098] According to the comparison result, the base library images in the first image list whose similarity is greater than a third similarity threshold are added to the third image list.
[0099] Optionally, the first determining module 203 includes:
[0100] A first determining submodule, configured to determine a to-be-filtered image list based on the second image list and the third image list;
[0101] A first acquisition submodule is used to acquire time information and space information corresponding to the images in the list of images to be filtered, and time information and space information corresponding to the image to be searched;
[0102] The first determination submodule is used to determine the search result of the image to be searched based on the time information and the space information.
[0103] Optionally, the first determining submodule includes:
[0104] A comparison unit, configured to compare the images in the to-be-filtered image list with the to-be-searched image, and to remove the images in the to-be-filtered image list that are in the same time period and correspond to different locations as the to-be-searched image, so as to obtain a filtered image list;
[0105] The acquisition unit is used to obtain the search results of the image to be searched based on the filtered image list.
[0106] like Figure 3 As shown, an embodiment of the present invention further provides an electronic device, characterized in that it includes a processor, and the processor can execute any one of the above-mentioned image search methods.
[0107] Specifically, it includes a processor 301 and a memory 302, and a computer program for executing the image search method stored in the memory 302 and capable of running on the processor 301, wherein:
[0108] The processor 301 runs the computer program of the image search method stored in the memory 302 to perform the following steps:
[0109] Obtaining the image of the target person to be searched;
[0110] Performing a first similarity calculation between the image to be searched and the base images in the image base library, adding base images whose similarity is greater than a first similarity threshold and less than a second similarity threshold to a first image list, and adding base images whose similarity is greater than the second similarity threshold to a second image list, wherein the second similarity is greater than the first similarity;
[0111] After the first similarity calculation is completed, a second similarity calculation is performed based on the first image list and the second image list, and base library images in the first image list whose similarity is greater than a third similarity threshold are added to a third image list;
[0112] After the second similarity calculation is completed, the search results of the image to be searched are determined based on the second image list and the third image list.
[0113] Optionally, in the image search method, it is characterized in that before the processor 301 executes the step of acquiring the image to be searched of the target person, it includes:
[0114] Acquire target facial features and target morphological features of the target person;
[0115] Based on the target facial features and the target morphological features, an image to be searched of the target person is determined.
[0116] Optionally, in the image search method, it is characterized in that the processor 301 executes the steps of performing a first similarity calculation between the image to be searched and the base library images in the image base library, adding the base library images whose similarity is greater than the first similarity threshold and less than the second similarity threshold to the first image list, and adding the base library images whose similarity is greater than the second similarity threshold to the second image list, including:
[0117] Comparing the person in the target area based on the image to be searched to obtain the first similarity threshold, wherein the target area is determined by the flow of people in the target area;
[0118] Based on the image to be searched and the first similarity threshold, a second similarity threshold is determined in the target area.
[0119] Optionally, in the image search method, it is characterized in that the processor 301 executes the steps of performing a first similarity calculation between the image to be searched and a base image in the image base library, adding the base images having a similarity greater than a first similarity threshold and less than a second similarity threshold to the first image list, and adding the base images having a similarity greater than the second similarity threshold to the second image list, including:
[0120] Comparing the target facial features and target morphological features of the target person with the image to be searched and the base images in the image base library, and adding the base images whose comparison results are greater than the first similarity threshold and less than the second similarity threshold to the first image list;
[0121] The target facial features and target morphological features of the target person are compared between the image to be searched and the base images in the image base library, and the base images whose comparison results are greater than the second similarity threshold are added to the second image list.
[0122] Optionally, in the image search method, it is characterized in that the processor 301 performs the step of performing a second similarity calculation based on the first image list and the second image list after the first similarity calculation is completed, and adding the base image in the first image list whose similarity is greater than a third similarity threshold to the third image list, including:
[0123] The images in the first image list are compared with the images in the second image list for target facial features and target morphological features of the target person, and based on the comparison results, the base library images whose similarity in the first image list is greater than a third similarity threshold are added to the third image list.
[0124] Optionally, in the image search method, it is characterized in that after the processor 301 completes the second similarity calculation, the step of determining the search results of the image to be searched based on the second image list and the third image list includes:
[0125] Determine a to-be-filtered image list based on the second image list and the third image list;
[0126] Acquire time information and space information corresponding to the images in the to-be-filtered image list, and time information and space information corresponding to the to-be-searched image;
[0127] Based on the time information and the space information, a search result of the image to be searched is determined.
[0128] Optionally, in the image search method, it is characterized in that the processor 301 performs the step of determining the search result of the image to be searched based on the time information and the spatial information, including:
[0129] By comparing the images in the to-be-filtered image list with the to-be-searched image, the images in the to-be-filtered image list that are in the same time period as the to-be-searched image but correspond to different locations are eliminated to obtain a filtered image list;
[0130] Based on the filtered image list, search results of the image to be searched are obtained.
[0131] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the image search method or the application-side image search method provided in the embodiment of the present invention are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0132] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0133] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.
Claims
1. An image search method, characterized in that: The method comprises the following steps: Obtaining the image of the target person to be searched; Performing a first similarity calculation between the image to be searched and the base images in the image base library, adding base images whose similarity is greater than a first similarity threshold and less than a second similarity threshold to a first image list, and adding base images whose similarity is greater than the second similarity threshold to a second image list, wherein the second similarity is greater than the first similarity; After the first similarity calculation is completed, a second similarity calculation is performed based on the first image list and the second image list, and base library images in the first image list whose similarity is greater than a third similarity threshold are added to a third image list; After the second similarity calculation is completed, the search results of the image to be searched are determined based on the second image list and the third image list.
2. The image search method according to claim 1, wherein: Before obtaining the image to be searched of the target person, the following steps are included: Acquire target facial features and target morphological features of the target person; Based on the target facial features and the target morphological features, an image to be searched of the target person is determined.
3. The image search method according to claim 1 or 2, characterized in that: Before performing a first similarity calculation between the image to be searched and the base image in the image base library, adding the base images whose similarity is greater than a first similarity threshold and less than a second similarity threshold to the first image list, and adding the base images whose similarity is greater than the second similarity threshold to the second image list, the method comprises: Comparing the person in the target area based on the image to be searched to obtain the first similarity threshold, wherein the target area is determined by the flow of people; Based on the image to be searched and the first similarity threshold, a second similarity threshold is determined in the target area.
4. The image search method according to any one of claims 1 to 3, characterized in that: The first similarity calculation is performed between the image to be searched and the base image in the image base library, the base images whose similarity is greater than a first similarity threshold and less than a second similarity threshold are added to the first image list, and the base images whose similarity is greater than the second similarity threshold are added to the second image list, including: Comparing the target facial features and target morphological features of the target person with the image to be searched and the base images in the image base library, and adding the base images whose comparison results are greater than the first similarity threshold and less than the second similarity threshold to the first image list; The target facial features and target morphological features of the target person are compared between the image to be searched and the base images in the image base library, and the base images whose comparison results are greater than the second similarity threshold are added to the second image list.
5. The image search method according to any one of claims 1 to 4, characterized in that: After the first similarity calculation is completed, performing a second similarity calculation based on the first image list and the second image list, and adding the base library images in the first image list whose similarity is greater than a third similarity threshold to the third image list, comprises: Comparing the target facial features and target morphological features of the target person with the images in the first image list and the images in the second image list; According to the comparison result, the base library images in the first image list whose similarity is greater than a third similarity threshold are added to the third image list.
6. The image search method according to any one of claims 1 to 5, characterized in that: After the second similarity calculation is completed, based on the second image list and the third image list, determining the search results of the image to be searched includes: Determine a to-be-filtered image list based on the second image list and the third image list; Acquire time information and space information corresponding to the images in the to-be-filtered image list, and time information and space information corresponding to the to-be-searched image; Based on the time information and the space information, a search result of the image to be searched is determined.
7. The image search method according to claim 6, characterized in that: The step of determining the search result of the image to be searched based on the time information and the space information includes: By comparing the images in the to-be-filtered image list with the to-be-searched image, the images in the to-be-filtered image list that are in the same time period as the to-be-searched image but correspond to different locations are eliminated to obtain a filtered image list; Based on the filtered image list, a search result of the image to be searched is obtained.
8. An image search device, characterized in that: The image search device comprises: A first acquisition module is used to acquire the image to be searched of the target person; A first calculation module is used to perform a first similarity calculation between the image to be searched and a base image in the image base library, add base images whose similarity is greater than a first similarity threshold and less than a second similarity threshold to a first image list, and add base images whose similarity is greater than the second similarity threshold to a second image list, wherein the second similarity is greater than the first similarity; A second calculation module is used to perform a second similarity calculation based on the first image list and the second image list after the first similarity calculation is completed, and add the base image in the first image list whose similarity is greater than a third similarity threshold to a third image list; The first determination module is used to determine the search results of the image to be searched based on the second image list and the third image list after the second similarity calculation is completed.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the image search method according to any one of claims 1 to 7 when executing the computer program.
10. 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 processor, the steps in the image search method according to any one of claims 1 to 7 are implemented.