CN112970025A - Image searching method, image searching device, storage medium and electronic equipment - Google Patents

Image searching method, image searching device, storage medium and electronic equipment Download PDF

Info

Publication number
CN112970025A
CN112970025A CN201880099183.3A CN201880099183A CN112970025A CN 112970025 A CN112970025 A CN 112970025A CN 201880099183 A CN201880099183 A CN 201880099183A CN 112970025 A CN112970025 A CN 112970025A
Authority
CN
China
Prior art keywords
keyword
keyword set
image
library
set library
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201880099183.3A
Other languages
Chinese (zh)
Inventor
杨阳
林立安
郑忠
刘金
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai Technology Co Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd, Shenzhen Huantai Technology Co Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Publication of CN112970025A publication Critical patent/CN112970025A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Processing Or Creating Images (AREA)

Abstract

An image search method, an apparatus, a storage medium, and an electronic device, the image search method including receiving search information input by a user, the search information including a first keyword (110); acquiring a first keyword set (120) from a keyword set library according to the first keyword; a target image (130) is searched from a plurality of first images according to the first set of keywords.

Description

Image searching method, image searching device, storage medium and electronic equipment Technical Field
The present disclosure relates to the field of electronic technologies, and in particular, to an image searching method and apparatus, a storage medium, and an electronic device.
Background
With the development of electronic technology, electronic devices such as smart phones have become more and more rich in functions. For example, a photographing function of an electronic device has become an indispensable function in daily life of a user.
When a user uses the electronic device to take a picture, the taken picture is usually stored on the electronic device. As a result, more and more images are stored on electronic devices. When a user wants to search for a certain target image stored on the electronic device, it is difficult to view the target image one by one among a large number of images, which takes a long time, and even the target image that the user wants cannot be found due to the carelessness of the user.
Disclosure of Invention
The embodiment of the application provides an image searching method, an image searching device, a storage medium and electronic equipment, and can improve comprehensiveness and accuracy of searching images by the electronic equipment.
The embodiment of the application provides an image searching method, which comprises the following steps:
receiving search information input by a user, wherein the search information comprises a first keyword;
acquiring a first keyword set from a keyword set library according to the first keyword, wherein the keyword set library comprises a plurality of keyword sets, and the first keyword set comprises the first keyword and at least one second keyword;
searching a target image from a plurality of first images according to the first keyword set, wherein the target image comprises a first image element, and the first image element is matched with the first keyword or the second keyword.
An embodiment of the present application further provides an image search apparatus, including:
the receiving module is used for receiving search information input by a user, and the search information comprises a first keyword;
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a first keyword set from a keyword set library according to a first keyword, the keyword set library comprises a plurality of keyword sets, and the first keyword set comprises the first keyword and at least one second keyword;
a search module configured to search a target image from a plurality of first images according to the first keyword set, where the target image includes a first image element, and the first image element matches with the first keyword or the second keyword.
An embodiment of the present application further provides a storage medium, where a computer program is stored in the storage medium, and when the computer program runs on a computer, the computer is caused to execute the following steps:
receiving search information input by a user, wherein the search information comprises a first keyword;
acquiring a first keyword set from a keyword set library according to the first keyword, wherein the keyword set library comprises a plurality of keyword sets, and the first keyword set comprises the first keyword and at least one second keyword;
searching a target image from a plurality of first images according to the first keyword set, wherein the target image comprises a first image element, and the first image element is matched with the first keyword or the second keyword.
An embodiment of the present application further provides an electronic device, which includes a processor and a memory, where the memory stores a computer program, and the processor calls the computer program stored in the memory to perform the following steps:
receiving search information input by a user, wherein the search information comprises a first keyword;
acquiring a first keyword set from a keyword set library according to the first keyword, wherein the keyword set library comprises a plurality of keyword sets, and the first keyword set comprises the first keyword and at least one second keyword;
searching a target image from a plurality of first images according to the first keyword set, wherein the target image comprises a first image element, and the first image element is matched with the first keyword or the second keyword.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments will be briefly introduced below. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
Fig. 1 is a schematic view of an application scenario of an image search method according to an embodiment of the present application.
Fig. 2 is a schematic flowchart of a first image searching method according to an embodiment of the present application.
Fig. 3 is a schematic flowchart of a second image searching method according to an embodiment of the present application.
Fig. 4 is a schematic flowchart of a third image searching method according to an embodiment of the present application.
Fig. 5 is a fourth flowchart illustrating an image searching method according to an embodiment of the present application.
Fig. 6 is a fifth flowchart illustrating an image searching method according to an embodiment of the present application.
Fig. 7 is a sixth flowchart illustrating an image searching method according to an embodiment of the present application.
Fig. 8 is a seventh flowchart illustrating an image searching method according to an embodiment of the present application.
Fig. 9 is a schematic view of a first structure of an image searching apparatus according to an embodiment of the present application.
Fig. 10 is a schematic diagram of a second structure of an image searching apparatus according to an embodiment of the present application.
Fig. 11 is a schematic structural diagram of a third image searching apparatus according to an embodiment of the present application.
Fig. 12 is a schematic diagram of a fourth structure of an image searching apparatus according to an embodiment of the present application.
Fig. 13 is a schematic structural diagram of a first electronic device according to an embodiment of the present application.
Fig. 14 is a schematic structural diagram of a second electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without inventive step, are within the scope of the present application.
Referring to fig. 1, fig. 1 is a schematic view of an application scenario of an image search method provided in an embodiment of the present application. The electronic device stores a plurality of images thereon. For example, an album of the electronic apparatus stores n images such as image 1, image 2, image 3, image 4, and up to image n (n is a positive integer). When a user views the photo album, n images stored in the photo album are gradually displayed on the display screen according to a display mode set by the user.
The user may enter search information, such as the search keyword "dog," in the view interface of the album. Subsequently, the electronic apparatus searches the images stored in the album for images related to "dog" and displays the searched target image on the display screen. For example, if the images 1 and 4 are images related to a "dog" among n images stored in the album, the images 1 and 4 may be displayed on a display screen in the search result of the electronic device for the user to view.
The embodiment of the application provides an image searching method, which can be applied to electronic equipment. The electronic device can be a smart phone, a tablet computer, a notebook computer and the like.
The embodiment of the application provides an image searching method, which comprises the following steps:
receiving search information input by a user, wherein the search information comprises a first keyword;
acquiring a first keyword set from a keyword set library according to the first keyword, wherein the keyword set library comprises a plurality of keyword sets, and the first keyword set comprises the first keyword and at least one second keyword;
searching a target image from a plurality of first images according to the first keyword set, wherein the target image comprises a first image element, and the first image element is matched with the first keyword or the second keyword.
In some embodiments, before the step of obtaining the first keyword set from the keyword set library according to the first keyword, the method further includes:
acquiring scene information of the electronic equipment at present, wherein the scene information comprises at least one of system language information of the electronic equipment and geographical area information of the electronic equipment;
the step of obtaining a first keyword set from a keyword set library according to the first keyword comprises the following steps:
and acquiring a first keyword set from a keyword set library according to the first keyword, the scene information and a first mapping relation, wherein the first mapping relation comprises a mapping relation among the keyword, the scene information and the first keyword set.
In some embodiments, before the step of obtaining the first keyword set from the keyword set library according to the first keyword, the scenario information, and the first mapping relationship, the method further includes:
acquiring a keyword set library from the electronic equipment;
judging whether the keyword set library is matched with the scene information;
the step of obtaining a first keyword set from a keyword set library according to the first keyword, the scene information and the first mapping relation comprises:
if the keyword set library is matched with the scene information, acquiring a first keyword set from the keyword set library according to the first keyword, the scene information and a first mapping relation;
and if the keyword set library is not matched with the scene information, updating the keyword set library, and acquiring a first keyword set from the updated keyword set library according to the first keyword, the scene information and the first mapping relation.
In some embodiments, the step of updating the keyword set library comprises:
acquiring a first moment when the keyword set library is updated last time;
calculating a time interval between the first time and the current time;
when the time interval is larger than a preset time interval, downloading a first keyword set library from a server, and replacing the keyword set library with the first keyword set library to complete the updating of the keyword set library;
and when the time interval is not greater than the preset time interval, downloading a second keyword set library from a server, and adding the second keyword set library into the keyword set library to complete the updating of the keyword set library.
In some embodiments, before the step of receiving the search information input by the user, the method further includes:
acquiring a plurality of keywords;
generating a first keyword set and a second mapping relation between the keywords and the first keyword set according to the keywords;
the step of obtaining a first keyword set from a keyword set library according to the first keyword comprises the following steps:
and acquiring a first keyword set from a keyword set library according to the first keyword and a second mapping relation between the keyword and the first keyword set.
In some embodiments, the step of obtaining a plurality of keywords comprises:
identifying a second image through an image identification algorithm model to identify second image elements from the second image;
acquiring a third keyword corresponding to the second image element;
receiving first setting information input by a user, wherein the first setting information comprises a fourth keyword associated with the third keyword;
the step of generating a first keyword set and a second mapping relation between the keywords and the first keyword set according to the plurality of keywords comprises the following steps:
and generating a first keyword set and a second mapping relation between the keywords and the first keyword set according to the third keyword and the fourth keyword.
In some embodiments, the step of obtaining a plurality of keywords comprises:
receiving second setting information input by a user, wherein the second setting information comprises a fifth keyword and a sixth keyword related to the fifth keyword;
the step of generating a first keyword set and a second mapping relation between the keywords and the first keyword set according to the plurality of keywords comprises the following steps:
and generating a first keyword set and a second mapping relation between the keywords and the first keyword set according to the fifth keyword and the sixth keyword.
In some embodiments, the step of searching for a target image from a plurality of first images according to the first set of keywords comprises:
sequentially identifying each first image through an image identification algorithm so as to identify a plurality of image elements from the first image;
determining whether the plurality of image elements include an image element that is the same as the first image element;
and if the plurality of image elements comprise the same image element as the first image element, determining the first image as a target image.
Referring to fig. 2, fig. 2 is a schematic flowchart of a first image searching method according to an embodiment of the present application. The image searching method comprises the following steps:
and 110, receiving search information input by a user, wherein the search information comprises a first keyword.
The electronic device may receive search information input by a user. For example, a search box may be displayed in a photo album interface of the electronic device or a viewing interface of another image management application installed in the electronic device, and the user may enter search information in the search box.
The search information input by the user comprises a first keyword. The first keyword represents an object that a user wants to search for. For example, if the object that the user wants to search is a dog, the search information input by the user may include a first keyword "dog".
The number of the first keywords included in the search information may be one or more. For example, if the user wants to search for images related to dogs and cats at the same time, the first keywords "dog", "cat" may be included in the search information input by the user at the same time.
Wherein the first keyword may represent an arbitrary object. For example, the first keyword may represent an animal such as "dog", "cat", etc., the first keyword may also represent a landscape such as "sea", "beach", etc., the first keyword may also represent a plant such as "cherry blossom", "rose", etc., and the first keyword may also represent an item such as "car", "house", "road", etc.
And 120, acquiring a first keyword set from the keyword set library according to the first keyword.
The electronic device may be preset with a keyword collection library. The keyword set library includes a plurality of keyword sets. Each keyword set comprises a plurality of keywords with incidence relations. For example, the keyword collection library may be a keyword classification relationship dictionary provided in the electronic device. Each of the keyword sets may be a keyword classification relationship in the keyword classification relationship dictionary.
For example, the keyword classification relationship dictionary may include a plurality of keyword classification relationships: animal-dog-husky-haha, animal-cat-english, plant-flower-rose, etc.
After receiving search information input by a user, the electronic equipment acquires a first keyword set from the keyword set library according to a first keyword in the search information. Wherein the first keyword set comprises the first keyword and at least one second keyword. The second keyword is a keyword having an association relationship with the first keyword.
For example, if a first keyword in the search information input by the user is "dog", the first keyword set acquired by the electronic device may be: animal-dog-husky-haha. Wherein, the keywords "animal", "Husky" and "Erha" are all the second keywords.
And 130, searching a target image from the plurality of first images according to the first keyword set.
After the electronic equipment acquires the first keyword set, the target image can be searched from the plurality of first images according to the first keyword set.
Wherein the first image may be an image stored on an electronic device. The first image may be an image stored on the electronic device by the user through photographing, may also be an image downloaded from the network by the user, and may also be an image sent by another user received by the user.
The target image includes a first image element. The first image element may be any element such as a landscape, an animal, a building, an article, and the like.
The first image element matches the first keyword or the second keyword. That is, the first image element is the same as the object represented by the first keyword or the second keyword. For example, if the first keyword is "dog", the second keyword includes "animal", "husky", "two-ha", and the first image element may be an object such as an animal, a dog, a husky, and the like. The first image is the target image as long as the image elements in the first image include any one of objects such as animals, dogs, husks and the like.
After the target image is searched by the electronic equipment, the target image can be displayed on a display screen of the electronic equipment for being viewed by a user. For example, after the electronic device searches for the target image, the searched target image may be displayed on an album interface of the electronic device.
In the image searching method, the electronic device may expand a first keyword in search information input by a user to expand the first keyword into a first keyword set, where the first keyword set includes the first keyword and a second keyword. When a plurality of first images are searched, the electronic equipment matches each keyword in the first keyword set, so that image searching is more comprehensive, and a searching result can more accurately meet the expectation of a user.
In some embodiments, referring to fig. 3, fig. 3 is a second flowchart of an image searching method provided in the embodiments of the present application.
Before the step 120 of obtaining the first keyword set from the keyword set library according to the first keyword, the method further includes the following steps:
140, obtaining scene information of the electronic device, where the scene information includes at least one of system language information of the electronic device and geographical area information of the electronic device;
step 120, before obtaining the first keyword set from the keyword set library according to the first keyword, comprising the following steps:
and 121, acquiring a first keyword set from a keyword set library according to the first keyword, the scene information and a first mapping relation, wherein the first mapping relation comprises a mapping relation among the keyword, the scene information and the first keyword set.
The electronic device can acquire the current scene information. The scene information comprises at least one of system language information of the electronic equipment and geographical area information of the electronic equipment.
Wherein the system language information of the electronic device represents information of a language currently used by a system of the electronic device. For example, the system language information of the electronic device may be chinese, english, russian, japanese, or the like.
The geographical area information of the electronic equipment indicates an area where the geographical position of the electronic equipment is currently located. For example, the geographical area information of the electronic device may be china, or may be usa, russia, japan, or the like. The electronic device may be provided with a positioning System, such as a Global Positioning System (GPS), and the electronic device may obtain a geographical location of the electronic device through the positioning System.
A first mapping relation among the keywords, the scene information and the first keyword set can be preset in the electronic equipment. For example, the first mapping relationship may be a mapping relationship as shown in table 1:
TABLE 1
Keyword Scene information First set of keywords
Dog Chinese character Animal-dog-husky-haha
Cat (cat) China Animal-cat-yingqian
Rose Chinese character Plant-flower-rose-red rose
…… …… ……
After the electronic device obtains the current scene information, a first keyword set can be obtained from a keyword set library according to the first keyword, the scene information and the first mapping relation.
For example, if the first keyword is "dog", the scene information where the electronic device is currently located is "chinese", the acquired first keyword set is: animal-dog-husky-haha.
In some embodiments, referring to fig. 4, fig. 4 is a third flowchart illustrating an image searching method provided in an embodiment of the present application.
Before the step 121 of obtaining the first keyword set from the keyword set library according to the first keyword, the scene information and the first mapping relationship, the method further includes the following steps:
150, obtaining a keyword set library from the electronic equipment;
160, judging whether the keyword set library is matched with the scene information;
step 121, obtaining a first keyword set from a keyword set library according to the first keyword, the scene information and the first mapping relationship, including the following steps:
1211, if the keyword set library matches the scene information, obtaining a first keyword set from the keyword set library according to the first keyword, the scene information, and a first mapping relationship;
1212, if the keyword set library is not matched with the scene information, updating the keyword set library, and obtaining a first keyword set from the updated keyword set library according to the first keyword, the scene information, and the first mapping relationship.
The electronic device may retrieve a library of keyword sets stored in the electronic device. And then, the electronic equipment compares the acquired keyword set library with the scene information where the electronic equipment is currently located to judge whether the keyword set library is matched with the scene information.
The matching of the keyword set library and the scene information shows that the language used by the keyword set library is the same as the language in the scene information or is matched with the geographic area in the scene information.
And if the language used by the keyword set library is the same as the language in the scene information or is consistent with the geographic area in the scene information, judging that the keyword set library is matched with the scene information. And if the language used by the keyword set library is different from the language in the scene information and is not consistent with the geographic area in the scene information, judging that the keyword set library is not matched with the scene information.
For example, if the language used by the keyword set library is chinese and the system language of the electronic device is also chinese, the keyword set library matches with the scene information where the electronic device is located. For another example, if the language used by the keyword set library is chinese, the system language of the electronic device is english, and the geographic area where the electronic device is located is usa, the keyword set library is not matched with the scene information where the electronic device is located.
And if the keyword set library is matched with the scene information, the electronic equipment acquires a first keyword set from the keyword set library according to the first keyword, the scene information and a first mapping relation.
And if the keyword set library is not matched with the scene information, the electronic equipment updates the keyword set library, so that the updated keyword set library is matched with the scene information where the electronic equipment is located. And then, the electronic equipment acquires a first keyword set from the updated keyword set library according to the first keyword, the scene information and the first mapping relation.
In some embodiments, when the electronic device updates the keyword set library, the following steps are performed:
acquiring a first moment when the keyword set library is updated last time;
calculating a time interval between the first time and the current time;
when the time interval is larger than a preset time interval, downloading a first keyword set library from a server, and replacing the keyword set library with the first keyword set library to complete the updating of the keyword set library;
and when the time interval is not greater than the preset time interval, downloading a second keyword set library from a server, and adding the second keyword set library into the keyword set library to complete the updating of the keyword set library.
When the electronic device updates the keyword set library each time, the time when the electronic device updates can be written in the keyword set library. Therefore, the first time when the keyword set library is updated last time can be recorded in the keyword set library.
The electronic device may obtain a first time when the keyword set library is updated last time, and compare the first time with a current time to calculate a time interval between the first time and the current time. For example, the calculated time interval may be 3 months.
Subsequently, the electronic device may compare the calculated time interval with a preset time interval to determine whether the time interval is greater than the preset time interval. The preset time interval may be a duration preset in the electronic device. For example, the preset time interval may be 2 months.
And when the time interval is greater than the preset time interval, the electronic equipment does not update the keyword set library for a long time. At this time, the electronic equipment downloads the first keyword set library from the server and replaces the first keyword set library with the first keyword set library to complete the updating of the keyword set library. The first keyword set library may be a full-scale compressed package of the keyword set library, that is, the first keyword set library includes all keyword sets.
For example, if the time interval calculated by the electronic device is 3 months and the preset time interval is 2 months, the electronic device downloads the first keyword set library and replaces the first keyword set library with the first keyword set library to complete the updating of the keyword set library.
And when the time interval is not greater than the preset time interval, the fact that the time that the electronic equipment does not update the keyword set library is short is indicated. At this time, the electronic equipment downloads a second keyword set library from the server, and adds the second keyword set library to the keyword set library to complete the updating of the keyword set library. The second keyword set library may be an incremental compression package of the keyword set library, that is, the second keyword set library only includes a part of keyword sets.
For example, if the time interval calculated by the electronic device is 1 month and the preset time interval is 2 months, the electronic device downloads the second keyword set library from the server and adds the second keyword set library to the keyword set library to complete updating of the keyword set library.
In some embodiments, referring to fig. 5, fig. 5 is a fourth flowchart illustrating an image searching method according to an embodiment of the present disclosure.
Before receiving the search information input by the user in step 110, the method further comprises the following steps:
170, obtaining a plurality of keywords;
180, generating a first keyword set and a second mapping relation between the keywords and the first keyword set according to the keywords;
step 120, obtaining a first keyword set from a keyword set library according to the first keyword, comprising the following steps:
and 122, acquiring a first keyword set from the keyword set library according to the first keyword and a second mapping relation between the keyword and the first keyword set.
The electronic equipment can acquire a plurality of keywords and generate a first keyword set and a second mapping relation between the keywords and the first keyword set according to the keywords. Wherein, the keywords have an incidence relation.
For example, the electronic device may obtain the keywords "animal", "dog", and then the electronic device generates a second mapping as shown in table 2:
TABLE 2
Keyword one Keyword two …… First set of keywords
Animal(s) production Dog …… Animal-dog
…… …… …… ……
After receiving search information input by a user, the electronic equipment can acquire a first keyword set from a keyword set library according to a first keyword in the search information and a second mapping relation between the keyword and the first keyword set.
For example, if a first keyword in the search information input by the user is "dog", the electronic device may acquire that the first keyword set is: animal-dog.
In some embodiments, referring to fig. 6, fig. 6 is a fifth flowchart illustrating an image searching method provided in an embodiment of the present application.
Step 170, obtaining a plurality of keywords, including the following steps:
171, recognizing the second image by the image recognition algorithm model to recognize the second image element from the second image;
172, obtaining a third keyword corresponding to the second image element;
173, receiving first setting information input by a user, wherein the first setting information comprises a fourth keyword associated with the third keyword;
step 180, generating a first keyword set and a second mapping relationship between the keywords and the first keyword set according to the plurality of keywords, comprising the following steps:
181, generating a first keyword set and a second mapping relationship between the keywords and the first keyword set according to the third keyword and the fourth keyword.
An image recognition algorithm model is arranged in the electronic equipment. The electronic device may identify the second image through the image recognition algorithm model to identify second image elements from the second image.
The second image may be any image, such as an image captured by a user through an electronic device, an image downloaded from a network, and the like. The second image element is an image element included in the second image. The second image element may be any element of a landscape, an animal, a building, an article, etc.
The correspondence between an image element and an object represented by the image element may be set in advance in the electronic device. For example, the image element dog corresponds to the object "dog", and the image element cat corresponds to the object "cat".
After recognizing the second image element from the second image, the electronic device may obtain a third keyword corresponding to the second image element according to the second image element. Wherein the third keyword is an object represented by the second image element. For example, if the second image element recognized by the electronic device is a dog, the corresponding third keyword "dog" may be acquired.
The electronic device may display the acquired third keyword on a display screen for presentation to the user. The user can input the first setting information to the electronic device according to the incidence relation between the keywords to be established. It should be noted that, the user here may include a program developer, that is, the program developer may set the keyword set on the electronic device.
Wherein the first setting information may include a setting command. The setting command is used for indicating the electronic equipment to generate a keyword set and a mapping relation between the keywords and the keyword set.
The first setting information may further include a fourth keyword associated with the third keyword. And the fourth keyword and the third keyword are associated to represent that the fourth keyword and the third keyword have a classification relation. The number of the fourth keyword may be one or more. For example, if the third keyword acquired by the electronic device is "dog", the first setting information input by the user may include the fourth keyword "animal", and may also include the fourth keywords "hassk", "biha", and the like. For another example, if the third keyword is "red rose", the fourth keyword may be "rose", "flower", "plant", etc.
And then, the electronic equipment generates a first keyword set and a second mapping relation between the keywords and the first keyword set according to the third keyword and the fourth keyword.
For example, the second mapping generated by the electronic device may be the mapping shown in table 3:
TABLE 3
Third key word Fourth keyword First set of keywords
Dog Animal(s) production Animal-dog
…… …… ……
The electronic device may perform the above steps multiple times to generate multiple first keyword sets in the electronic device, thereby forming a keyword set library on the electronic device.
In some embodiments, referring to fig. 7, fig. 7 is a sixth flowchart illustrating an image searching method provided in an embodiment of the present application.
Step 170, obtaining a plurality of keywords, including the following steps:
174, receiving second setting information input by a user, wherein the second setting information comprises a fifth keyword and a sixth keyword associated with the fifth keyword;
step 180, generating a first keyword set and a second mapping relationship between the keywords and the first keyword set according to the plurality of keywords, comprising the following steps:
181, generating a first keyword set and a second mapping relationship between the keywords and the first keyword set according to the fifth keyword and the sixth keyword.
The electronic device may receive second setting information input by the user. It should be noted that, the user here may include a program developer, that is, the program developer may set the keyword set on the electronic device. The second setting information may include a setting command. The setting command is used for indicating the electronic equipment to generate a keyword set and a mapping relation between the keywords and the keyword set.
The second setting information may further include a fifth keyword and a sixth keyword associated with the fifth keyword. And the sixth keywords and the fifth keywords have classification relations. The number of the fifth keyword and the number of the sixth keyword may be one or more.
For example, the second setting information input by the user may include a fifth keyword "dog", and a sixth keyword "animal". The second setting information may also include fifth keywords "red rose", "blue rose", "pink rose", and sixth keywords "rose", "flower".
And then, the electronic equipment generates a first keyword set and a second mapping relation between the keywords and the first keyword set according to the fifth keyword and the sixth keyword.
For example, the second mapping relationship generated by the electronic device may be the mapping relationship as shown in table 4:
TABLE 4
Fifth keyword Sixth keyword First set of keywords
Dog Animal(s) production Animal-dog
…… …… ……
The electronic device may perform the above steps multiple times to generate multiple first keyword sets in the electronic device, thereby forming a keyword set library on the electronic device.
In some embodiments, referring to fig. 8, fig. 8 is a seventh flowchart illustrating an image searching method according to an embodiment of the present disclosure.
Step 130, searching a target image from a plurality of first images according to the first keyword set, including the following steps:
131, sequentially identifying each first image through an image identification algorithm to identify a plurality of image elements from the first image;
132, determining whether the plurality of image elements include an image element identical to the first image element;
133, if the plurality of image elements include the same image element as the first image element, determining the first image as a target image.
The electronic device may identify each first image in turn by an image identification algorithm to identify a plurality of image elements from the first image.
Subsequently, the electronic device compares each image element with the first image element in turn to determine whether the plurality of image elements includes the same image element as the first image element. Wherein the first image element is the same as the object represented by the first keyword or the second keyword. For example, if the first keyword is "dog" and the second keyword is "animal", the first image element may be a dog and an animal.
If the electronic device determines that the image elements include the same image element as the first image element, for example, the image elements include an image element of a dog, the first image is determined as a target image.
If the electronic device determines that the image elements do not include the same image element as the first image element, for example, the image elements do not include an image element of a dog or any image element of an animal, the first image is excluded from the target image, that is, the first image is not the target image.
The electronic device may perform the above-mentioned identification and determination on each first image in turn to determine whether each first image is a target image, thereby completing the search in the plurality of first images.
It is to be understood that the terms "first," "second," and the like in the embodiments of the present application are used merely for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order, such that the described elements may be interchanged under appropriate circumstances.
In particular implementation, the present application is not limited by the execution sequence of the described steps, and some steps may be performed in other sequences or simultaneously without conflict.
As can be seen from the above, the image searching method provided in the embodiment of the present application includes: receiving search information input by a user, wherein the search information comprises a first keyword; acquiring a first keyword set from a keyword set library according to the first keyword, wherein the keyword set library comprises a plurality of keyword sets, and the first keyword set comprises the first keyword and at least one second keyword; searching a target image from a plurality of first images according to the first keyword set, wherein the target image comprises a first image element, and the first image element is matched with the first keyword or the second keyword. In the image searching method, the electronic equipment can expand the first keywords in the searching information input by the user into the first keyword set, and when a plurality of first images are searched, each keyword in the first keyword set is matched, so that the image searching is more comprehensive, and the searching result can more accurately accord with the expectation of the user.
The embodiment of the application also provides an image searching device, and the image searching device can be integrated in electronic equipment. The electronic device can be a smart phone, a tablet computer, a notebook computer and the like.
An embodiment of the present application provides an image search apparatus, including:
the receiving module is used for receiving search information input by a user, and the search information comprises a first keyword;
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a first keyword set from a keyword set library according to a first keyword, the keyword set library comprises a plurality of keyword sets, and the first keyword set comprises the first keyword and at least one second keyword;
a search module configured to search a target image from a plurality of first images according to the first keyword set, where the target image includes a first image element, and the first image element matches with the first keyword or the second keyword.
In some embodiments, the image search apparatus further comprises:
the second acquisition module is used for acquiring scene information of the electronic equipment at present, wherein the scene information comprises at least one of system language information of the electronic equipment and geographical area information of the electronic equipment;
the first obtaining module is used for obtaining a first keyword set from a keyword set library according to the first keyword, the scene information and a first mapping relation, wherein the first mapping relation comprises a mapping relation among the keyword, the scene information and the first keyword set.
In some embodiments, the image search apparatus further comprises:
the third acquisition module is used for acquiring a keyword set library from the electronic equipment;
the judging module is used for judging whether the keyword set library is matched with the scene information or not;
the first obtaining module is configured to:
if the keyword set library is matched with the scene information, acquiring a first keyword set from the keyword set library according to the first keyword, the scene information and a first mapping relation;
and if the keyword set library is not matched with the scene information, updating the keyword set library, and acquiring a first keyword set from the updated keyword set library according to the first keyword, the scene information and the first mapping relation.
Referring to fig. 9, fig. 9 is a schematic diagram of a first structure of an image searching apparatus according to an embodiment of the present application. The image search apparatus 200 includes: the device comprises a receiving module 201, a first obtaining module 202 and a searching module 203.
The receiving module 201 is configured to receive search information input by a user, where the search information includes a first keyword.
A search box may be displayed in a photo album interface of the electronic device or a viewing interface of another image management application installed in the electronic device, and a user may enter search information in the search box. The receiving module 201 receives search information input by a user.
The search information input by the user comprises a first keyword. The first keyword represents an object that a user wants to search for. For example, if the object that the user wants to search is a dog, the search information input by the user may include a first keyword "dog".
The number of the first keywords included in the search information may be one or more. For example, if the user wants to search for images related to dogs and cats at the same time, the first keywords "dog", "cat" may be included in the search information input by the user at the same time.
Wherein the first keyword may represent an arbitrary object. For example, the first keyword may represent an animal such as "dog", "cat", etc., the first keyword may also represent a landscape such as "sea", "beach", etc., the first keyword may also represent a plant such as "cherry blossom", "rose", etc., and the first keyword may also represent an item such as "car", "house", "road", etc.
The first obtaining module 202 is configured to obtain a first keyword set from a keyword set library according to the first keyword.
The electronic device may be preset with a keyword collection library. The keyword set library includes a plurality of keyword sets. Each keyword set comprises a plurality of keywords with incidence relations. For example, the keyword collection library may be a keyword classification relationship dictionary provided in the electronic device. Each of the keyword sets may be a keyword classification relationship in the keyword classification relationship dictionary.
For example, the keyword classification relationship dictionary may include a plurality of keyword classification relationships: animal-dog-husky-haha, animal-cat-english, plant-flower-rose, etc.
After the receiving module 201 receives search information input by a user, the first obtaining module 202 obtains a first keyword set from the keyword set library according to a first keyword in the search information. Wherein the first keyword set comprises the first keyword and at least one second keyword. The second keyword is a keyword having an association relationship with the first keyword.
For example, if the first keyword in the search information input by the user is "dog", the first keyword set acquired by the first acquiring module 202 may be: animal-dog-husky-haha. Wherein, the keywords "animal", "Husky" and "Erha" are all the second keywords.
And the searching module 203 is used for searching a target image from the plurality of first images according to the first keyword set.
After the first obtaining module 202 obtains the first keyword set, the searching module 203 may search the target image from the plurality of first images according to the first keyword set.
Wherein the first image may be an image stored on an electronic device. The first image may be an image stored on the electronic device by the user through photographing, may also be an image downloaded from the network by the user, and may also be an image sent by another user received by the user.
The target image includes a first image element. The first image element may be any element such as a landscape, an animal, a building, an article, and the like.
The first image element matches the first keyword or the second keyword. That is, the first image element is the same as the object represented by the first keyword or the second keyword. For example, if the first keyword is "dog", the second keyword includes "animal", "husky", "two-ha", and the first image element may be an object such as an animal, a dog, a husky, and the like. The first image is the target image as long as the image elements in the first image include any one of objects such as animals, dogs, husks and the like.
After the search module 203 searches for the target image, the target image may be displayed on a display screen of the electronic device for a user to view. For example, after the searching module 203 searches for the target image, the searched target image may be displayed on an album interface of the electronic device.
The image search apparatus may expand a first keyword in search information input by a user to expand the first keyword into a first keyword set, the first keyword set including the first keyword and a second keyword. When a plurality of first images are searched, each keyword in the first keyword set can be matched, so that the image search can be more comprehensive, and the search result can more accurately meet the expectation of a user.
In some embodiments, referring to fig. 10, fig. 10 is a schematic diagram of a second structure of an image search apparatus provided in the embodiments of the present application.
The image search apparatus 200 further includes: a second obtaining module 204.
A second obtaining module 204, configured to obtain scene information of a current location of an electronic device, where the scene information includes at least one of system language information of the electronic device and geographic area information of the electronic device;
the first obtaining module 202 is configured to obtain a first keyword set from a keyword set library according to the first keyword, the scenario information, and a first mapping relationship, where the first mapping relationship includes a mapping relationship among the keyword, the scenario information, and the first keyword set.
The second obtaining module 204 may obtain scene information where the electronic device is currently located. The scene information comprises at least one of system language information of the electronic equipment and geographical area information of the electronic equipment.
Wherein the system language information of the electronic device represents information of a language currently used by a system of the electronic device. For example, the system language information of the electronic device may be chinese, english, russian, japanese, or the like.
The geographical area information of the electronic equipment indicates an area where the geographical position of the electronic equipment is currently located. For example, the geographical area information of the electronic device may be china, or may be usa, russia, japan, or the like. A positioning System, such as a Global Positioning System (GPS), may be disposed in the electronic device, and the second obtaining module 204 may obtain the geographic location of the electronic device through the positioning System in the electronic device.
A first mapping relation among the keywords, the scene information and the first keyword set can be preset in the electronic equipment. After the second obtaining module 204 obtains the current scene information, the first obtaining module 202 may obtain a first keyword set from the keyword set library according to the first keyword, the scene information, and the first mapping relationship.
For example, if the first keyword is "dog", and the scene information where the electronic device is currently located is "chinese", the first keyword set acquired by the first acquiring module 202 may be: animal-dog-husky-haha.
In some embodiments, referring to fig. 11, fig. 11 is a schematic structural diagram of a third image searching apparatus provided in the embodiments of the present application.
The image search apparatus 200 further includes: a third obtaining module 205 and a judging module 206.
A third obtaining module 205, configured to obtain a keyword set library from the electronic device;
a judging module 206, configured to judge whether the keyword set library matches the scene information;
the first obtaining module 202 is configured to:
if the keyword set library is matched with the scene information, acquiring a first keyword set from the keyword set library according to the first keyword, the scene information and a first mapping relation;
and if the keyword set library is not matched with the scene information, updating the keyword set library, and acquiring a first keyword set from the updated keyword set library according to the first keyword, the scene information and the first mapping relation.
The third obtaining module 205 may obtain a keyword set library stored in the electronic device. Subsequently, the determining module 206 compares the acquired keyword set library with the current scene information of the electronic device to determine whether the keyword set library is matched with the scene information.
The matching of the keyword set library and the scene information shows that the language used by the keyword set library is the same as the language in the scene information or is matched with the geographic area in the scene information.
And if the language used by the keyword set library is the same as the language in the scene information or is consistent with the geographic area in the scene information, judging that the keyword set library is matched with the scene information. And if the language used by the keyword set library is different from the language in the scene information and is not consistent with the geographic area in the scene information, judging that the keyword set library is not matched with the scene information.
For example, if the language used by the keyword set library is chinese and the system language of the electronic device is also chinese, the keyword set library matches with the scene information where the electronic device is located. For another example, if the language used by the keyword set library is chinese, the system language of the electronic device is english, and the geographic area where the electronic device is located is usa, the keyword set library is not matched with the scene information where the electronic device is located.
If the keyword set library is matched with the scene information, the first obtaining module 202 obtains a first keyword set from the keyword set library according to the first keyword, the scene information and the first mapping relationship.
If the keyword set library is not matched with the scene information, the first obtaining module 202 updates the keyword set library, so that the updated keyword set library is matched with the scene information where the electronic device is located. Subsequently, the first obtaining module 202 obtains a first keyword set from the updated keyword set library according to the first keyword, the scene information, and the first mapping relationship.
In some embodiments, when the first obtaining module 202 updates the keyword set library, the following steps are performed:
acquiring a first moment when the keyword set library is updated last time;
calculating a time interval between the first time and the current time;
when the time interval is larger than a preset time interval, downloading a first keyword set library from a server, and replacing the keyword set library with the first keyword set library to complete the updating of the keyword set library;
and when the time interval is not greater than the preset time interval, downloading a second keyword set library from a server, and adding the second keyword set library into the keyword set library to complete the updating of the keyword set library.
The first obtaining module 202 may write the time when the keyword set library is updated into the keyword set library each time the keyword set library is updated. Therefore, the first time when the keyword set library is updated last time can be recorded in the keyword set library.
The first obtaining module 202 may obtain a first time when the keyword set library is updated last time, and compare the first time with a current time to calculate a time interval between the first time and the current time. For example, the calculated time interval may be 3 months.
Subsequently, the first obtaining module 202 may compare the calculated time interval with a preset time interval to determine whether the time interval is greater than the preset time interval. The preset time interval may be a duration preset in the electronic device. For example, the preset time interval may be 2 months.
And when the time interval is greater than the preset time interval, indicating that the keyword set library is not updated for a longer time. At this time, the first obtaining module 202 downloads the first keyword set library from the server, and replaces the first keyword set library with the first keyword set library to complete the updating of the keyword set library. The first keyword set library may be a full-scale compressed package of the keyword set library, that is, the first keyword set library includes all keyword sets.
For example, if the calculated time interval is 3 months and the preset time interval is 2 months, the first obtaining module 202 downloads the first keyword set library from the server, and replaces the first keyword set library with the first keyword set library to complete the updating of the keyword set library.
And when the time interval is not greater than the preset time interval, the time for not updating the keyword set library is shorter. At this time, the first obtaining module 202 downloads the second keyword set library from the server, and adds the second keyword set library to the keyword set library to complete the updating of the keyword set library. The second keyword set library may be an incremental compression package of the keyword set library, that is, the second keyword set library only includes a part of keyword sets.
For example, if the calculated time interval is 1 month and the preset time interval is 2 months, the first obtaining module 202 downloads the second keyword set library from the server, and adds the second keyword set library to the keyword set library to complete updating of the keyword set library.
In some embodiments, referring to fig. 12, fig. 12 is a schematic diagram illustrating a fourth structure of an image searching apparatus provided in an embodiment of the present application.
The image search apparatus 200 further includes: a fourth obtaining module 207 and a generating module 208.
A fourth obtaining module 207, configured to obtain a plurality of keywords;
a generating module 208, configured to generate a first keyword set and a second mapping relationship between the keywords and the first keyword set according to the plurality of keywords;
the first obtaining module 202 is configured to obtain a first keyword set from a keyword set library according to the first keyword and a second mapping relationship between the keyword and the first keyword set.
The fourth obtaining module 207 may obtain a plurality of keywords, and the generating module 208 generates the first keyword set and the second mapping relationship between the keywords and the first keyword set according to the plurality of keywords. Wherein, the keywords have an incidence relation.
After the receiving module 201 receives the search information input by the user, the first obtaining module 202 may obtain the first keyword set from the keyword set library according to the first keyword in the search information and the second mapping relationship between the keyword and the first keyword set.
In some embodiments, the fourth obtaining module 207 is configured to perform the following steps:
identifying a second image through an image identification algorithm model so as to identify second image elements from the second image;
acquiring a third keyword corresponding to the second image element;
receiving first setting information input by a user, wherein the first setting information comprises a fourth keyword associated with the third keyword;
the generating module 208 is configured to generate a first keyword set and a second mapping relationship between the keywords and the first keyword set according to the third keyword and the fourth keyword.
An image recognition algorithm model is arranged in the electronic equipment. The fourth obtaining module 207 may identify the second image by the image recognition algorithm model to identify the second image element from the second image.
The second image may be any image, such as an image captured by a user through an electronic device, an image downloaded from a network, and the like. The second image element is an image element included in the second image. The second image element may be any element of a landscape, an animal, a building, an article, etc.
The correspondence between an image element and an object represented by the image element may be set in advance in the electronic device. For example, the image element dog corresponds to the object "dog", and the image element cat corresponds to the object "cat".
After recognizing the second image element from the second image, the fourth obtaining module 207 may obtain a third keyword corresponding to the second image element according to the second image element. Wherein the third keyword is an object represented by the second image element. For example, if the second image element identified by the fourth obtaining module 207 is a dog, the corresponding third keyword "dog" may be obtained.
The fourth obtaining module 207 may display the obtained third keyword on a display screen for presentation to the user. The user can input the first setting information to the electronic device according to the incidence relation between the keywords to be established.
Wherein the first setting information may include a setting command. The setting command is used for indicating the generation of the keyword set and the mapping relation between the keywords and the keyword set.
The first setting information may further include a fourth keyword associated with the third keyword. And the fourth keyword and the third keyword are associated to represent that the fourth keyword and the third keyword have a classification relation. The number of the fourth keyword may be one or more. For example, if the third keyword acquired by the fourth acquiring module 207 is "dog", the first setting information input by the user may include the fourth keyword "animal", and may also include the fourth keywords "hassk", "biha", and the like. For another example, if the third keyword is "red rose", the fourth keyword may be "rose", "flower", "plant", etc.
Then, the generating module 208 generates the first keyword set and a second mapping relationship between the keywords and the first keyword set according to the third keyword and the fourth keyword.
The fourth obtaining module 207 and the generating module 208 may perform the above steps multiple times to generate multiple first keyword sets in the electronic device, so as to form a keyword set library on the electronic device.
In some embodiments, the fourth obtaining module 207 is configured to receive second setting information input by a user, where the second setting information includes a fifth keyword and a sixth keyword associated with the fifth keyword;
the generating module 208 is configured to generate a first keyword set and a second mapping relationship between the keywords and the first keyword set according to the fifth keyword and the sixth keyword.
The fourth obtaining module 207 may receive second setting information input by the user. The second setting information may include a setting command. The setting command is used for indicating the generation of the keyword set and the mapping relation between the keywords and the keyword set.
The second setting information may further include a fifth keyword and a sixth keyword associated with the fifth keyword. And the sixth keywords and the fifth keywords have classification relations. The number of the fifth keyword and the number of the sixth keyword may be one or more.
For example, the second setting information input by the user may include a fifth keyword "dog", and a sixth keyword "animal". The second setting information may also include fifth keywords "red rose", "blue rose", "pink rose", and sixth keywords "rose", "flower".
Then, the generating module 208 generates the first keyword set and a second mapping relationship between the keywords and the first keyword set according to the fifth keyword and the sixth keyword.
The fourth obtaining module 207 and the generating module 208 may perform the above steps multiple times to generate multiple first keyword sets in the electronic device, so as to form a keyword set library on the electronic device.
In some embodiments, the search module 203 is configured to perform the following steps:
sequentially identifying each first image through an image identification algorithm so as to identify a plurality of image elements from the first image;
judging whether the plurality of image elements comprise the same image element as the first image element;
and if the plurality of image elements comprise the same image element as the first image element, determining the first image as a target image.
The search module 203 may identify each first image in turn by an image identification algorithm to identify a plurality of image elements from the first image.
Subsequently, the search module 203 compares each image element with the first image element in turn to determine whether the plurality of image elements includes the same image element as the first image element. Wherein the first image element is the same as the object represented by the first keyword or the second keyword. For example, if the first keyword is "dog" and the second keyword is "animal", the first image element may be a dog and an animal.
If the searching module 203 determines that the image elements include the same image element as the first image element, for example, the image elements include an image element of a dog, the first image is determined as the target image.
If the searching module 203 determines that the image elements do not include the same image element as the first image element, for example, the image elements do not include an image element of a dog or any image element of an animal, the first image is excluded from the target image, that is, the first image is not the target image.
The searching module 203 may perform the above-mentioned identification and judgment on each first image in turn to judge whether each first image is a target image, thereby completing the search in the plurality of first images.
In specific implementation, the modules may be implemented as independent entities, or may be combined arbitrarily and implemented as one or several entities.
As can be seen from the above, in the image searching apparatus 200 provided in the embodiment of the present application, the receiving module 201 receives search information input by a user, where the search information includes a first keyword; the first obtaining module 202 obtains a first keyword set from a keyword set library according to the first keyword, where the keyword set library includes a plurality of keyword sets, and the first keyword set includes the first keyword and at least one second keyword; the search module 203 searches a target image from a plurality of first images according to the first keyword set, the target image including a first image element, the first image element matching the first keyword or the second keyword. The image searching device can expand the first keywords in the searching information input by the user into the first keyword set, and when a plurality of first images are searched, each keyword in the first keyword set is matched, so that the image searching is more comprehensive, and the searching result can more accurately accord with the expectation of the user.
The embodiment of the application also provides the electronic equipment. The electronic device can be a smart phone, a tablet computer, a notebook computer and the like.
Referring to fig. 13, fig. 13 is a schematic view of a first structure of an electronic device according to an embodiment of the present application. The electronic device 300 comprises a processor 301 and a memory 302. The processor 301 is electrically connected to the memory 302.
The processor 301 is a control center of the electronic device 300, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or calling a computer program stored in the memory 302 and calling data stored in the memory 302, thereby performing overall monitoring of the electronic device.
In this embodiment, the processor 301 in the electronic device 300 loads instructions corresponding to one or more processes of the computer program into the memory 302 according to the following steps, and the processor 301 runs the computer program stored in the memory 302, so as to implement various functions:
receiving search information input by a user, wherein the search information comprises a first keyword;
acquiring a first keyword set from a keyword set library according to the first keyword, wherein the keyword set library comprises a plurality of keyword sets, and the first keyword set comprises the first keyword and at least one second keyword;
searching a target image from a plurality of first images according to the first keyword set, wherein the target image comprises a first image element, and the first image element is matched with the first keyword or the second keyword.
In some embodiments, before obtaining the first keyword set from the keyword set library according to the first keyword, the processor 301 further performs the following steps:
acquiring scene information of the electronic equipment at present, wherein the scene information comprises at least one of system language information of the electronic equipment and geographical area information of the electronic equipment;
when a first keyword set is obtained from the keyword set library according to the first keyword, the processor 301 executes the following steps:
and acquiring a first keyword set from a keyword set library according to the first keyword, the scene information and a first mapping relation, wherein the first mapping relation comprises a mapping relation among the keyword, the scene information and the first keyword set.
In some embodiments, before obtaining the first keyword set from the keyword set library according to the first keyword, the scenario information and the first mapping relationship, the processor 301 further performs the following steps:
acquiring a keyword set library from the electronic equipment;
judging whether the keyword set library is matched with the scene information;
when a first keyword set is obtained from a keyword set library according to the first keyword, the scene information, and the first mapping relationship, the processor 301 executes the following steps:
if the keyword set library is matched with the scene information, acquiring a first keyword set from the keyword set library according to the first keyword, the scene information and a first mapping relation;
and if the keyword set library is not matched with the scene information, updating the keyword set library, and acquiring a first keyword set from the updated keyword set library according to the first keyword, the scene information and the first mapping relation.
In some embodiments, when updating the keyword pool, the processor 301 performs the following steps:
acquiring a first moment when the keyword set library is updated last time;
calculating a time interval between the first time and the current time;
when the time interval is larger than a preset time interval, downloading a first keyword set library from a server, and replacing the keyword set library with the first keyword set library to complete the updating of the keyword set library;
and when the time interval is not greater than the preset time interval, downloading a second keyword set library from a server, and adding the second keyword set library into the keyword set library to complete the updating of the keyword set library.
In some embodiments, before receiving the search information input by the user, the processor 301 further performs the following steps:
acquiring a plurality of keywords;
generating a first keyword set and a second mapping relation between the keywords and the first keyword set according to the keywords;
when a first keyword set is obtained from the keyword set library according to the first keyword, the processor 301 executes the following steps:
and acquiring a first keyword set from a keyword set library according to the first keyword and a second mapping relation between the keyword and the first keyword set.
In some embodiments, when obtaining a plurality of keywords, processor 301 performs the following steps:
identifying a second image through an image identification algorithm model to identify second image elements from the second image;
acquiring a third keyword corresponding to the second image element;
receiving first setting information input by a user, wherein the first setting information comprises a fourth keyword associated with the third keyword;
when generating the first keyword set and the second mapping relationship between the keywords and the first keyword set according to the plurality of keywords, the processor 301 executes the following steps:
and generating a first keyword set and a second mapping relation between the keywords and the first keyword set according to the third keyword and the fourth keyword.
In some embodiments, when obtaining a plurality of keywords, processor 301 performs the following steps:
receiving second setting information input by a user, wherein the second setting information comprises a fifth keyword and a sixth keyword related to the fifth keyword;
when generating the first keyword set and the second mapping relationship between the keywords and the first keyword set according to the plurality of keywords, the processor 301 executes the following steps:
and generating a first keyword set and a second mapping relation between the keywords and the first keyword set according to the fifth keyword and the sixth keyword.
In some embodiments, when searching for a target image from a plurality of first images according to the first set of keywords, the processor 301 performs the following steps:
sequentially identifying each first image through an image identification algorithm so as to identify a plurality of image elements from the first image;
determining whether the plurality of image elements include an image element that is the same as the first image element;
and if the plurality of image elements comprise the same image element as the first image element, determining the first image as a target image.
Memory 302 may be used to store computer programs and data. The memory 302 stores computer programs containing instructions executable in the processor. The computer program may constitute various functional modules. The processor 301 executes various functional applications and data processing by calling a computer program stored in the memory 302.
In some embodiments, referring to fig. 14, fig. 14 is a schematic view of a second structure of an electronic device provided in the embodiments of the present application. The electronic device 300 further includes: a display 303, a control circuit 304, an input unit 305, a sensor 306, and a power supply 307. The processor 301 is electrically connected to the display 303, the control circuit 304, the input unit 305, the sensor 306, and the power source 307.
The display screen 303 may be used to display information entered by or provided to the user as well as various graphical user interfaces of the electronic device, which may be comprised of images, text, icons, video, and any combination thereof.
The control circuit 304 is electrically connected to the display 303, and is configured to control the display 303 to display information.
The input unit 305 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint), and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control. Wherein, the input unit 305 may include a fingerprint recognition module.
The sensor 306 is used to collect external environmental information. The sensor 306 may include one or more of an ambient light sensor, an acceleration sensor, a gyroscope, and the like.
The power supply 307 is used to power the various components of the electronic device 300. In some embodiments, the power supply 307 may be logically coupled to the processor 301 through a power management system, such that functions of managing charging, discharging, and power consumption are performed through the power management system.
Although not shown in fig. 14, the electronic device 300 may further include a camera, a radio frequency circuit, an audio circuit, and the like, which are not described in detail herein.
As can be seen from the above, an embodiment of the present application provides an electronic device, where the electronic device performs the following steps: receiving search information input by a user, wherein the search information comprises a first keyword; acquiring a first keyword set from a keyword set library according to the first keyword, wherein the keyword set library comprises a plurality of keyword sets, and the first keyword set comprises the first keyword and at least one second keyword; searching a target image from a plurality of first images according to the first keyword set, wherein the target image comprises a first image element, and the first image element is matched with the first keyword or the second keyword. The electronic equipment can expand the first keywords in the search information input by the user into the first keyword set, and when a plurality of first images are searched, each keyword in the first keyword set is matched, so that the image search can be more comprehensive, and the search result can more accurately accord with the expectation of the user.
An embodiment of the present application further provides a storage medium, where a computer program is stored in the storage medium, and when the computer program runs on a computer, the computer executes the image search method according to any of the above embodiments.
It should be noted that, all or part of the steps in the methods of the above embodiments may be implemented by hardware related to instructions of a computer program, which may be stored in a computer-readable storage medium, which may include, but is not limited to: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
The image searching method, the image searching device, the storage medium and the electronic device provided by the embodiment of the application are described in detail above. The principle and the implementation of the present application are explained herein by applying specific examples, and the above description of the embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (20)

  1. An image search method comprising:
    receiving search information input by a user, wherein the search information comprises a first keyword;
    acquiring a first keyword set from a keyword set library according to the first keyword, wherein the keyword set library comprises a plurality of keyword sets, and the first keyword set comprises the first keyword and at least one second keyword;
    searching a target image from a plurality of first images according to the first keyword set, wherein the target image comprises a first image element, and the first image element is matched with the first keyword or the second keyword.
  2. The image searching method according to claim 1, wherein before the step of obtaining the first keyword set from the keyword set library according to the first keyword, the method further comprises:
    acquiring scene information of the electronic equipment at present, wherein the scene information comprises at least one of system language information of the electronic equipment and geographical area information of the electronic equipment;
    the step of obtaining a first keyword set from a keyword set library according to the first keyword comprises the following steps:
    and acquiring a first keyword set from a keyword set library according to the first keyword, the scene information and a first mapping relation, wherein the first mapping relation comprises a mapping relation among the keyword, the scene information and the first keyword set.
  3. The image searching method according to claim 2, wherein before the step of obtaining the first keyword set from the keyword set library according to the first keyword, the scene information and the first mapping relationship, the method further comprises:
    acquiring a keyword set library from the electronic equipment;
    judging whether the keyword set library is matched with the scene information;
    the step of obtaining a first keyword set from a keyword set library according to the first keyword, the scene information and the first mapping relation comprises:
    if the keyword set library is matched with the scene information, acquiring a first keyword set from the keyword set library according to the first keyword, the scene information and a first mapping relation;
    and if the keyword set library is not matched with the scene information, updating the keyword set library, and acquiring a first keyword set from the updated keyword set library according to the first keyword, the scene information and the first mapping relation.
  4. The image searching method according to claim 3, wherein the step of updating the keyword set library includes:
    acquiring a first moment when the keyword set library is updated last time;
    calculating a time interval between the first time and the current time;
    when the time interval is larger than a preset time interval, downloading a first keyword set library from a server, and replacing the keyword set library with the first keyword set library to complete the updating of the keyword set library;
    and when the time interval is not greater than the preset time interval, downloading a second keyword set library from a server, and adding the second keyword set library into the keyword set library to complete the updating of the keyword set library.
  5. The image searching method according to claim 1, wherein the step of receiving the search information input by the user further comprises, before the step of:
    acquiring a plurality of keywords;
    generating a first keyword set and a second mapping relation between the keywords and the first keyword set according to the keywords;
    the step of obtaining a first keyword set from a keyword set library according to the first keyword comprises the following steps:
    and acquiring a first keyword set from a keyword set library according to the first keyword and a second mapping relation between the keyword and the first keyword set.
  6. The image searching method according to claim 5, wherein the step of acquiring a plurality of keywords comprises:
    identifying a second image through an image identification algorithm model to identify second image elements from the second image;
    acquiring a third keyword corresponding to the second image element;
    receiving first setting information input by a user, wherein the first setting information comprises a fourth keyword associated with the third keyword;
    the step of generating a first keyword set and a second mapping relation between the keywords and the first keyword set according to the plurality of keywords comprises the following steps:
    and generating a first keyword set and a second mapping relation between the keywords and the first keyword set according to the third keyword and the fourth keyword.
  7. The image searching method according to claim 5, wherein the step of acquiring a plurality of keywords comprises:
    receiving second setting information input by a user, wherein the second setting information comprises a fifth keyword and a sixth keyword related to the fifth keyword;
    the step of generating a first keyword set and a second mapping relation between the keywords and the first keyword set according to the plurality of keywords comprises the following steps:
    and generating a first keyword set and a second mapping relation between the keywords and the first keyword set according to the fifth keyword and the sixth keyword.
  8. The image searching method according to claim 1, wherein the step of searching for a target image from a plurality of first images according to the first keyword set comprises:
    sequentially identifying each first image through an image identification algorithm so as to identify a plurality of image elements from the first image;
    determining whether the plurality of image elements include an image element that is the same as the first image element;
    and if the plurality of image elements comprise the same image element as the first image element, determining the first image as a target image.
  9. An image search apparatus comprising:
    the receiving module is used for receiving search information input by a user, and the search information comprises a first keyword;
    the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a first keyword set from a keyword set library according to a first keyword, the keyword set library comprises a plurality of keyword sets, and the first keyword set comprises the first keyword and at least one second keyword;
    a search module configured to search a target image from a plurality of first images according to the first keyword set, where the target image includes a first image element, and the first image element matches with the first keyword or the second keyword.
  10. The image search apparatus according to claim 9, further comprising:
    the second acquisition module is used for acquiring scene information of the electronic equipment at present, wherein the scene information comprises at least one of system language information of the electronic equipment and geographical area information of the electronic equipment;
    the first obtaining module is used for obtaining a first keyword set from a keyword set library according to the first keyword, the scene information and a first mapping relation, wherein the first mapping relation comprises a mapping relation among the keyword, the scene information and the first keyword set.
  11. The image search apparatus according to claim 10, further comprising:
    the third acquisition module is used for acquiring a keyword set library from the electronic equipment;
    the judging module is used for judging whether the keyword set library is matched with the scene information or not;
    the first obtaining module is configured to:
    if the keyword set library is matched with the scene information, acquiring a first keyword set from the keyword set library according to the first keyword, the scene information and a first mapping relation;
    and if the keyword set library is not matched with the scene information, updating the keyword set library, and acquiring a first keyword set from the updated keyword set library according to the first keyword, the scene information and the first mapping relation.
  12. A storage medium having stored therein a computer program which, when run on a computer, causes the computer to perform the steps of:
    receiving search information input by a user, wherein the search information comprises a first keyword;
    acquiring a first keyword set from a keyword set library according to the first keyword, wherein the keyword set library comprises a plurality of keyword sets, and the first keyword set comprises the first keyword and at least one second keyword;
    searching a target image from a plurality of first images according to the first keyword set, wherein the target image comprises a first image element, and the first image element is matched with the first keyword or the second keyword.
  13. An electronic device comprising a processor and a memory, the memory having stored therein a computer program, the processor being adapted to perform the following steps by calling the computer program stored in the memory:
    receiving search information input by a user, wherein the search information comprises a first keyword;
    acquiring a first keyword set from a keyword set library according to the first keyword, wherein the keyword set library comprises a plurality of keyword sets, and the first keyword set comprises the first keyword and at least one second keyword;
    searching a target image from a plurality of first images according to the first keyword set, wherein the target image comprises a first image element, and the first image element is matched with the first keyword or the second keyword.
  14. The electronic device of claim 13, wherein prior to retrieving the first keyword set from the keyword set library based on the first keyword, the processor is further configured to:
    acquiring scene information of the electronic equipment at present, wherein the scene information comprises at least one of system language information of the electronic equipment and geographical area information of the electronic equipment;
    when a first keyword set is obtained from a keyword set library according to the first keyword, the processor is used for executing the following steps:
    and acquiring a first keyword set from a keyword set library according to the first keyword, the scene information and a first mapping relation, wherein the first mapping relation comprises a mapping relation among the keyword, the scene information and the first keyword set.
  15. The electronic device of claim 14, wherein before obtaining the first keyword set from the keyword set library according to the first keyword, the context information, and the first mapping relationship, the processor is further configured to perform the following steps:
    acquiring a keyword set library from the electronic equipment;
    judging whether the keyword set library is matched with the scene information;
    when a first keyword set is obtained from a keyword set library according to the first keyword, the scene information and the first mapping relation, the processor is used for executing the following steps:
    if the keyword set library is matched with the scene information, acquiring a first keyword set from the keyword set library according to the first keyword, the scene information and a first mapping relation;
    and if the keyword set library is not matched with the scene information, updating the keyword set library, and acquiring a first keyword set from the updated keyword set library according to the first keyword, the scene information and the first mapping relation.
  16. The electronic device of claim 15, wherein, when updating the library of keyword sets, the processor is configured to perform the steps of:
    acquiring a first moment when the keyword set library is updated last time;
    calculating a time interval between the first time and the current time;
    when the time interval is larger than a preset time interval, downloading a first keyword set library from a server, and replacing the keyword set library with the first keyword set library to complete the updating of the keyword set library;
    and when the time interval is not greater than the preset time interval, downloading a second keyword set library from a server, and adding the second keyword set library into the keyword set library to complete the updating of the keyword set library.
  17. The electronic device of claim 13, wherein prior to receiving user-entered search information, the processor is further configured to:
    acquiring a plurality of keywords;
    generating a first keyword set and a second mapping relation between the keywords and the first keyword set according to the keywords;
    when a first keyword set is obtained from a keyword set library according to the first keyword, the processor is used for executing the following steps:
    and acquiring a first keyword set from a keyword set library according to the first keyword and a second mapping relation between the keyword and the first keyword set.
  18. The electronic device of claim 17, wherein in obtaining a plurality of keywords, the processor is configured to:
    identifying a second image through an image identification algorithm model to identify second image elements from the second image;
    acquiring a third keyword corresponding to the second image element;
    receiving first setting information input by a user, wherein the first setting information comprises a fourth keyword associated with the third keyword;
    when generating a first keyword set and a second mapping relation between the keywords and the first keyword set according to the keywords, the processor is configured to execute the following steps:
    and generating a first keyword set and a second mapping relation between the keywords and the first keyword set according to the third keyword and the fourth keyword.
  19. The electronic device of claim 17, wherein in obtaining a plurality of keywords, the processor is configured to:
    receiving second setting information input by a user, wherein the second setting information comprises a fifth keyword and a sixth keyword related to the fifth keyword;
    when generating a first keyword set and a second mapping relation between the keywords and the first keyword set according to the keywords, the processor is configured to execute the following steps:
    and generating a first keyword set and a second mapping relation between the keywords and the first keyword set according to the fifth keyword and the sixth keyword.
  20. The electronic device of claim 13, wherein, in searching for a target image from a plurality of first images according to the first set of keywords, the processor is configured to perform the steps of:
    sequentially identifying each first image through an image identification algorithm so as to identify a plurality of image elements from the first image;
    determining whether the plurality of image elements include an image element that is the same as the first image element;
    and if the plurality of image elements comprise the same image element as the first image element, determining the first image as a target image.
CN201880099183.3A 2018-11-22 2018-11-22 Image searching method, image searching device, storage medium and electronic equipment Pending CN112970025A (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/116902 WO2020103074A1 (en) 2018-11-22 2018-11-22 Image searching method and apparatus, storage medium, and electronic device

Publications (1)

Publication Number Publication Date
CN112970025A true CN112970025A (en) 2021-06-15

Family

ID=70773778

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201880099183.3A Pending CN112970025A (en) 2018-11-22 2018-11-22 Image searching method, image searching device, storage medium and electronic equipment

Country Status (2)

Country Link
CN (1) CN112970025A (en)
WO (1) WO2020103074A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112417287B (en) * 2020-11-24 2024-07-16 乐聚(深圳)机器人技术有限公司 Building block searching method, model training method, device, equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101251844A (en) * 2007-02-21 2008-08-27 富士胶片株式会社 Apparatus and method for retrieval of contents
CN105630935A (en) * 2015-12-21 2016-06-01 魅族科技(中国)有限公司 Picture recommendation method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103838724B (en) * 2012-11-20 2018-04-13 百度在线网络技术(北京)有限公司 Image search method and device
CN104133816B (en) * 2013-05-03 2017-11-07 三星电子(中国)研发中心 The method and apparatus for searching for image

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101251844A (en) * 2007-02-21 2008-08-27 富士胶片株式会社 Apparatus and method for retrieval of contents
CN105630935A (en) * 2015-12-21 2016-06-01 魅族科技(中国)有限公司 Picture recommendation method and device

Also Published As

Publication number Publication date
WO2020103074A1 (en) 2020-05-28

Similar Documents

Publication Publication Date Title
US20220075806A1 (en) Natural language image search
US11335087B2 (en) Method and system for object identification
CN109189879B (en) Electronic book display method and device
WO2017045443A1 (en) Image retrieval method and system
RU2688757C1 (en) Device and method for analyzing imported video
US20130243249A1 (en) Electronic device and method for recognizing image and searching for concerning information
US20150161236A1 (en) Recording context for conducting searches
EP3309694A1 (en) Image information processing system
CN110347866B (en) Information processing method, information processing device, storage medium and electronic equipment
US10769196B2 (en) Method and apparatus for displaying electronic photo, and mobile device
US20070070217A1 (en) Image analysis apparatus and image analysis program storage medium
CN107885482B (en) Audio playing method and device, storage medium and electronic equipment
US20150347369A1 (en) Annotation display assistance device and method of assisting annotation display
CN111611490A (en) Resource searching method, device, equipment and storage medium
CN110825611A (en) Abnormal program analysis method and device and computer readable storage medium
CN111027622A (en) Picture label generation method and device, computer equipment and storage medium
CN107679128B (en) Information display method and device, electronic equipment and storage medium
CN111373724B (en) Electronic device and control method thereof
US11810177B2 (en) Clothing collocation
US8533196B2 (en) Information processing device, processing method, computer program, and integrated circuit
CN108052506B (en) Natural language processing method, device, storage medium and electronic equipment
CN107885827B (en) File acquisition method and device, storage medium and electronic equipment
CN111382281B (en) Recommendation method, device, equipment and storage medium for content based on media object
CN107688623A (en) Method, device and equipment for retrieving real object and storage medium
CN112970025A (en) Image searching method, image searching device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination