CN106708940B - Method and device for processing pictures - Google Patents

Method and device for processing pictures Download PDF

Info

Publication number
CN106708940B
CN106708940B CN201611042535.0A CN201611042535A CN106708940B CN 106708940 B CN106708940 B CN 106708940B CN 201611042535 A CN201611042535 A CN 201611042535A CN 106708940 B CN106708940 B CN 106708940B
Authority
CN
China
Prior art keywords
picture
visual
index
text
keyword set
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.)
Active
Application number
CN201611042535.0A
Other languages
Chinese (zh)
Other versions
CN106708940A (en
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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201611042535.0A priority Critical patent/CN106708940B/en
Publication of CN106708940A publication Critical patent/CN106708940A/en
Application granted granted Critical
Publication of CN106708940B publication Critical patent/CN106708940B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/5866Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using information manually generated, e.g. tags, keywords, comments, manually generated location and time information

Abstract

The application discloses a method and a device for processing pictures. One embodiment of the method comprises: acquiring a picture and text information related to the picture; analyzing the picture to obtain a first keyword set, analyzing the text information to obtain a second keyword set, and generating a text index for indicating the picture according to the first keyword set and the second keyword set; selecting keywords for representing visual features of the picture from the first keyword set to generate a visual index for indicating the picture; and storing the text index and the visual index. The embodiment realizes high-accuracy index establishment and storage.

Description

Method and device for processing pictures
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for processing pictures.
Background
The existing image searching platform can greatly improve the image searching efficiency by establishing an index related to an image.
However, search results presented to a user by existing photo search platforms often lack relevance to text for searches or photos for searches submitted by the user, often because of the low accuracy of the index created and stored.
Disclosure of Invention
In a first aspect, the present application provides a method for processing a picture, the method comprising: acquiring a picture and text information related to the picture; analyzing the picture to obtain a first keyword set, analyzing the text information to obtain a second keyword set, and generating a text index for indicating the picture according to the first keyword set and the second keyword set; selecting keywords for representing visual features of the picture from the first keyword set to generate a visual index for indicating the picture; and storing the text index and the visual index.
In some embodiments, the above method further comprises: and in response to receiving a picture for searching sent by a user terminal, analyzing the picture for searching to extract visual features, matching the visual features of the picture for searching with the visual index, and displaying the picture indicated by the matched visual index as a searching result.
In some embodiments, the above method further comprises: and in response to receiving a text for searching sent by the user terminal, analyzing the text for searching to generate a third key word set, matching the third key word set with the text index, and displaying a picture indicated by the matched text index as a searching result.
In some embodiments, the matching the visual characteristics of the picture for search with the visual index includes: calculating the matching degree of the visual features of the picture for searching and each visual index in the visual indexes; and a picture indicated by the visual index, of the visual indexes, with a degree of matching with the visual features of the picture for search not lower than a first threshold is taken as a picture identical to the picture for search, and a picture indicated by the visual index with a degree of matching with the visual features of the picture for search lower than the first threshold and not lower than a second threshold is taken as a picture similar to the picture for search.
In some embodiments, the displaying the picture indicated by the matched visual index as the search result includes: and displaying the same picture and/or similar picture as the picture for searching as a searching result.
In some embodiments, the visual characteristics include at least one of: color, texture, shape.
In a second aspect, the present application provides an apparatus for processing pictures, the apparatus comprising: the device comprises an acquisition unit, a processing unit and a display unit, wherein the acquisition unit is configured to acquire a picture and text information related to the picture; a text index generating unit configured to analyze the picture to obtain a first keyword set, analyze the text information to obtain a second keyword set, and generate a text index for indicating the picture according to the first keyword set and the second keyword set; a visual index generating unit configured to select a keyword for representing a visual feature of the picture from the first keyword set to generate a visual index for indicating the picture; and the storage unit is configured to store the text index and the visual index.
In some embodiments, the above apparatus further comprises: and the first processing unit is used for analyzing the picture for searching to extract visual features, matching the visual features of the picture for searching with the visual indexes and displaying the picture indicated by the matched visual indexes as a searching result in response to receiving the picture for searching sent by the user terminal.
In some embodiments, the above apparatus further comprises: and the second processing unit is configured to, in response to receiving a text for search sent by the user terminal, analyze the text for search to generate a third keyword set, match the third keyword set with the text index, and display a picture indicated by the matched text index as a search result.
In some embodiments, the first processing unit includes: a calculating subunit configured to calculate a degree of matching between the visual features of the picture for search and each of the visual indexes; and a processing subunit configured to take, as a picture identical to the picture for search, a picture indicated by the visual index of which the degree of matching with the visual features of the picture for search is not lower than a first threshold value in the visual index, and take, as a picture similar to the picture for search, a picture indicated by the visual index of which the degree of matching with the visual features of the picture for search is lower than the first threshold value and is not lower than a second threshold value.
In some embodiments, the first processing unit includes: and the display subunit is configured to display the same picture and/or the similar picture as the picture for searching as a search result.
In some embodiments, the visual characteristics include at least one of: color, texture, shape.
According to the method and the device for processing the picture, the obtained picture is analyzed to obtain the first keyword set, the obtained text information related to the picture is analyzed to obtain the second keyword set, then the text index used for indicating the picture is generated according to the first keyword set and the second keyword set, then the keywords used for representing the visual characteristics of the picture are selected from the first keyword set to generate the visual index used for indicating the picture, and finally the text index and the visual index are stored, so that the first keyword set and the second keyword set are effectively utilized, and high-accuracy index establishment and storage are realized.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for processing pictures according to the present application;
FIG. 3 is a flow diagram of yet another embodiment of a method for processing pictures according to the present application;
FIG. 4 is a flow diagram of yet another embodiment of a method for processing pictures according to the present application;
FIG. 5 is a schematic block diagram of one embodiment of an apparatus for processing pictures according to the present application;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing a server according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary system architecture 100 to which embodiments of the method for processing pictures or the apparatus for processing pictures of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, networks 104, 106, a server 105, and a database 107. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 106 serves as a medium for providing communication links between server 105 and database 107. The networks 104, 106 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a picture transmission application, a picture search tool, a web browser application, an instant messaging tool, and the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The database 107 may be a picture database storing at least one picture.
The server 105 may be a server that provides various services. For example, the server 105 may obtain pictures and text information related to the pictures from the terminal devices 101, 102, 103 and/or the database 107; the acquired pictures and the text information can be analyzed and the like to generate text indexes and visual indexes for indicating the pictures; the generated text index and visual index may also be stored.
It should be noted that the method for processing pictures provided in the embodiments of the present application is generally performed by the server 105, and accordingly, the apparatus for processing pictures is generally disposed in the server 105.
It should be understood that the number of terminal devices, networks, servers, and databases in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, servers, and databases, as desired for implementation. In the case where the server 105 acquires a picture and text information related to the picture from the local, the terminal apparatuses 101, 102, 103 and the database 107 may be unnecessary.
With continued reference to fig. 2, fig. 2 illustrates a flow 200 of one embodiment of a method for processing pictures according to the present application. The method for processing the pictures comprises the following steps:
step 201, acquiring a picture and text information related to the picture.
In the present embodiment, the electronic device (for example, the server 105 shown in fig. 1) on which the method for processing pictures operates may acquire the pictures and the text information related to the pictures through a wired connection manner or a wireless connection manner. Here, the above-described picture may be a picture in any format supported by the method for processing a picture, for example, a picture in a format of PNG, JPEG, GIF, or the like.
In some optional implementations of this embodiment, the electronic device may obtain the picture and the text information from a database (e.g., the database 107 shown in fig. 1) and/or a user terminal (e.g., the terminal devices 101, 102, 103 shown in fig. 1) communicatively connected thereto; the electronic device may also locally obtain the picture and the text information. Here, the electronic device may store the acquired picture and the acquired text information in a memory or a hard disk.
Step 202, analyzing the picture to obtain a first keyword set, analyzing the text information to obtain a second keyword set, and generating a text index for indicating the picture according to the first keyword set and the second keyword set.
In this embodiment, the electronic device may analyze the picture by using an image recognition technology, so as to extract one or more keywords, and then generate the first keyword set based on the extracted keywords. As an example, a picture showing a night scene comprises stars and a meniscus, and the background color is black; the above-mentioned electronic equipment analyzes this picture through the image recognition technology, and can obtain keywords "star", "moon", "sickle", "black", "yellow", "curved", "five tips", "evening" and "banana", and the above-mentioned electronic equipment can regard the above-mentioned keywords "star", "moon", "sickle", "black", "yellow", "curved", "five tips", "evening" and "banana" as the keywords in the first keyword set.
In this embodiment, the electronic device may analyze the text information by using various analysis means, so as to extract one or more keywords, and then generate the second key set based on the extracted keywords.
In this embodiment, the electronic device may generate a text index for indicating the picture according to the first keyword set and the second keyword set. As an example, the electronic device may generate the text index by merging the first keyword set and the second keyword set.
In some optional implementations of the embodiment, the electronic device may generate a text index for indicating the picture by merging the first keyword set and the second keyword set and removing duplicate keywords.
In some optional implementation manners of this embodiment, under the condition that no weight is set for each keyword in the first keyword set and the second keyword set, the electronic device may merge the first keyword set and the second keyword set to obtain a keyword group, then the electronic device may remove repeated keywords in the keyword group, then the electronic device may set a weight for each keyword in the keyword group based on a correlation between each keyword in the keyword group and the picture, and then the electronic device may generate the text index based on a keyword in the keyword group whose weight is not lower than a preset value.
In some optional implementation manners of this embodiment, an analysis manner of the text information may be a statistical analysis manner. For example, the occurrence frequencies of the words existing in the text information may be counted and ranked, and then, one or more words with the highest occurrence frequency may be selected as the keywords.
In some optional implementation manners of this embodiment, an analysis manner of the text information may also be a semantic analysis manner. As an example, the text information may be processed by a full segmentation method or the like to segment the content of the text information into words; and then, performing importance calculation on the obtained words (for example, adopting a Term Frequency-Inverse Document Frequency method (TF-IDF)), and obtaining the keywords based on the result of the importance calculation.
By using the full segmentation method, all possible words matched with the language word stock can be segmented firstly, and then the optimal segmentation result is determined by using the statistical language model. Taking the text "stars and moon in the night sky" as an example, the language lexicon matching can be firstly carried out, and all matched words, namely night, night sky, stars and moon, can be found; the words are represented in the form of word lattices (word lattices), then path search is performed based on the word lattices, and an optimal path is found based on a statistical language model (such as an N-Gram model). And if the result shows that the language model of the night sky stars and the moon has the highest score, the night sky stars and the moon are the optimal segmentation of the stars and the moon in the night sky. The N-Gram Model is a common Language Model, and may be referred to as a Chinese Language Model (CLM) for Chinese. The N-Gram model is based on the assumption that the occurrence of the nth word is only related to the first N-1 words and not to any other words, and the probability of the whole sentence is the product of the occurrence probabilities of the words, which can be obtained by directly counting the number of times that the N words occur simultaneously from the corpus.
After the content is divided into words by using a full segmentation method, the words can be subjected to importance calculation by using a word frequency-reverse file frequency method, and then the words are selected as key words or subjected to importance scoring based on the importance. The main idea of the word frequency-inverse document frequency method is that if a word or phrase appears frequently (TF) in one article and rarely appears in other articles, the word or phrase is considered to have good category discrimination capability and is suitable for classification. The Inverse Document Frequency (IDF) mainly means that if fewer documents contain a certain word or phrase, the larger the IDF is, the word or phrase has a good category distinguishing capability. Thus, using the word frequency-inverse document frequency method, the importance of a word or phrase within an article can be calculated.
It should be noted that the various methods of the semantic analysis are well-known technologies that are widely researched and applied at present, and are not described herein again.
In some optional implementation manners of this embodiment, the electronic device may set weights for the keywords related to the picture analyzed by the image analysis technology and the keywords related to the text information analyzed by various analysis means, and may generate the first keyword set and the second keyword set based on the keywords whose weights are not lower than the threshold value. The size of the weight and the relevance of the keywords and the picture content are related, the higher the relevance is, the higher the weight value is, and the lower the relevance is, the lower the weight value is. As an example, the electronic device analyzes the picture showing the night scene by using an image recognition technology to obtain keywords of "stars", "moons", "sickles", "black", "yellow", "bends", "five tips", "evening" and "bananas"; wherein the weight of "stars" and "moon" may be 0.5, the weight of "black" and "yellow" may be 0.4, the weight of "bends" may be 0.3, the weight of "evening" and "sickle" may be 0.2, the weight of "five tips" may be 0.1, the weight of "banana" may be 0; if the threshold is 0.2, the electronic device may generate the first set of keywords based on the keywords "stars", "moon", "black", "yellow", "crook", "evening", and "sickle".
Step 203, selecting keywords for representing visual features of the picture from the first keyword set to generate a visual index for indicating the picture.
In this embodiment, the electronic device may select a keyword from the first keyword set, the keyword being used to characterize a visual feature of the picture (e.g., yellow, black, bend, etc.), so as to generate a visual index indicating the picture.
In some optional implementations of the embodiment, the visual feature may include at least one of: color, texture, shape.
Step 204, storing the text index and the visual index.
In this embodiment, the electronic device may store the text index and the visual index in a memory or a hard disk of the electronic device, and may also store the text index and the visual index in a database communicatively connected to the electronic device.
The method provided by the embodiment of the application analyzes the acquired picture to obtain the first keyword set, analyzes the acquired text information related to the picture to obtain the second keyword set, generates the text index for indicating the picture according to the first keyword set and the second keyword set, selects the keywords for representing the visual characteristics of the picture from the first keyword set to generate the visual index for indicating the picture, and finally stores the text index and the visual index, so that the first keyword set and the second keyword set are effectively utilized, and the index establishment and storage with high accuracy are realized.
With further reference to fig. 3, which shows a flow 300 of yet another embodiment of a method for processing pictures, the flow 300 of the method for processing pictures, comprising the steps of:
step 301, acquiring a picture and text information related to the picture.
In the present embodiment, the electronic device (for example, the server 105 shown in fig. 1) on which the method for processing pictures operates may acquire the pictures and the text information related to the pictures through a wired connection manner or a wireless connection manner. Here, the above-described picture may be a picture in any format supported by the method for processing a picture, for example, a picture in a format of PNG, JPEG, GIF, or the like.
Step 302, analyzing the picture to obtain a first keyword set, analyzing the text information to obtain a second keyword set, and generating a text index for indicating the picture according to the first keyword set and the second keyword set.
In this embodiment, the electronic device may analyze the picture by using an image recognition technology, so as to extract one or more keywords, and then generate the first keyword set based on the extracted keywords. And the electronic device may analyze the text information by using various analysis means to extract one or more keywords, and then generate a second key set based on the extracted keywords. And the electronic equipment can generate a text index for indicating the picture by combining the first keyword set and the second keyword set.
Step 303, selecting keywords used for characterizing the visual features of the picture from the first keyword set to generate a visual index for indicating the picture.
In this embodiment, the electronic device may select a keyword from the first keyword set, the keyword being used to characterize a visual feature of the picture (e.g., yellow, black, bend, etc.), so as to generate a visual index indicating the picture.
Step 304, storing the text index and the visual index.
In this embodiment, the electronic device may store the text index and the visual index in a memory or a hard disk of the electronic device, and may also store the text index and the visual index in a database communicatively connected to the electronic device.
In step 305, in response to receiving the picture for searching sent by the user terminal, the picture for searching is analyzed to extract visual features.
In this embodiment, in response to the electronic device receiving a picture for search sent by a user terminal, the electronic device may analyze the picture for search through a visual search technique, so as to extract at least one visual feature (e.g., a visual feature such as a color, a texture, or a shape).
It should be noted that the above-mentioned visual search technology is generally a visual search technology based on picture content analysis. The visual search technology can correctly understand the picture content, realize picture searching, effectively improve the picture searching efficiency and the searching quality, be beneficial to assisting and recommending the searching result which is more in line with the user requirement, and improve the user satisfaction.
Step 306, matching the visual characteristics of the picture for searching with the visual index.
In this embodiment, the electronic device may match the visual features of the picture for search with the visual indexes by calculating a degree of matching between the visual features of the picture for search and each of the visual indexes. As an example, the electronic device may convert the visual features of the picture for search into a set of keywords for search, and may calculate a matching degree of the set of keywords for search with each of the visual indexes to obtain a matching degree of the visual features of the picture for search with each of the visual indexes. For example, if the set of search keywords includes 10 keywords and one of the visual indexes includes 9 keywords in the set of search keywords, it can be determined that the matching degree between the visual features of the picture for search and the visual indexes including the 9 keywords in the set of search keywords is a ratio of 9 to 10, that is, the matching degree is 90%.
In some optional implementations of the embodiment, the electronic device may use, as the same picture as the picture for search, a picture indicated by the visual index having a degree of matching with the visual features of the picture for search not lower than a first threshold (e.g., 95%) in the visual index, and may use, as a picture similar to the picture for search, a picture indicated by the visual index having a degree of matching with the visual features of the picture for search not lower than the first threshold and not lower than a second threshold (e.g., 70%). It should be noted that the first threshold and the second threshold may be set manually, and may be modified according to implementation requirements.
And 307, displaying the picture indicated by the matched visual index as a search result.
In this embodiment, the electronic device may sort the matched pictures indicated by the visual index having a non-zero matching degree with the visual features of the picture for search in an order from high matching degree to low matching degree, and then display the sorted pictures to the user terminal.
In some optional implementation manners of this embodiment, the electronic device may display the matched picture that is the same as the picture for search to the user terminal as a search result.
In some optional implementation manners of this embodiment, the electronic device may sort the matched pictures that are the same as or similar to the search picture in an order from high matching degree to low matching degree, and then display the sorted pictures that are the same as or similar to the search picture to the user terminal.
As can be seen from fig. 3, the flow 300 of the method for processing pictures in the present embodiment highlights step 305, step 306 and step 307 compared to the corresponding embodiment of fig. 2. Therefore, the scheme described in the embodiment can realize high-accuracy index establishment and storage; the method can realize image searching and optimized image searching process, and can also improve the image searching efficiency.
With further reference to fig. 4, a flow 400 of yet another embodiment of a method for processing a picture is shown. The process 400 for processing pictures includes the following steps:
step 401, acquiring a picture and text information related to the picture.
In the present embodiment, the electronic device (for example, the server 105 shown in fig. 1) on which the method for processing pictures operates may acquire the pictures and the text information related to the pictures through a wired connection manner or a wireless connection manner. Here, the above-described picture may be a picture in any format supported by the method for processing a picture, for example, a picture in a format of PNG, JPEG, GIF, or the like.
Step 402, analyzing the picture to obtain a first keyword set, analyzing the text information to obtain a second keyword set, and generating a text index for indicating the picture according to the first keyword set and the second keyword set.
In this embodiment, the electronic device may analyze the picture by using an image recognition technology, so as to extract one or more keywords, and then generate the first keyword set based on the extracted keywords. And the electronic device may analyze the text information by using various analysis means to extract one or more keywords, and then generate a second key set based on the extracted keywords. And the electronic equipment can generate a text index for indicating the picture by combining the first keyword set and the second keyword set.
In step 403, keywords for characterizing the visual features of the picture are selected from the first keyword set to generate a visual index for indicating the picture.
In this embodiment, the electronic device may select a keyword from the first keyword set, the keyword being used to characterize a visual feature of the picture (e.g., yellow, black, bend, etc.), so as to generate a visual index indicating the picture.
Step 404, storing the text index and the visual index.
In this embodiment, the electronic device may store the text index and the visual index in a memory or a hard disk of the electronic device, and may also store the text index and the visual index in a database communicatively connected to the electronic device.
Step 405, in response to receiving the text for search sent by the user terminal, analyzing the text for search to generate a third keyword set.
In this embodiment, the electronic device may analyze the text for search by using the same analysis method as the analysis method for analyzing the text information to generate the third keyword set.
Step 406, matching the third keyword set with the text index.
In this embodiment, the electronic device may match the third set of keywords with each of the text indexes. As an example, the electronic device may use a text index containing at least one keyword in the third set of keywords as the text index matched with the third set of keywords.
In some optional implementations of the embodiment, the electronic device may calculate a matching degree of the third set of keywords with each of the text indexes, and the electronic device may use a text index having a matching degree with the third set of keywords not lower than a third threshold (e.g., 70%) as the text index matching with the third set of keywords. As an example, the third keyword set includes keywords "stars", "moon", "black", and "yellow", one of the text indexes includes "stars" and "moon", and the matching degree of the text index including "stars" and "moon" with the third keyword set may be a ratio of 2 to 4, i.e., 50%. Here, the third threshold may be set manually, and may be modified according to implementation requirements.
Step 407, the picture indicated by the matched text index is displayed as a search result.
In this embodiment, the electronic device may present, as a search result, an image indicated by a text index containing at least one keyword in the third keyword set in the text index to the user terminal.
In some optional implementation manners of this embodiment, the electronic device may sort, in the text index, pictures indicated by the text index whose matching degree with the third keyword set is not lower than a third threshold value according to an order from top to bottom of the matching degree, and then display the sorted pictures to the user terminal.
As can be seen from fig. 4, the flow 400 of the method for processing pictures in the present embodiment highlights step 405, step 406 and step 407 compared to the corresponding embodiment of fig. 2. Therefore, the scheme described in the embodiment can realize high-accuracy index establishment and storage; by matching the third keyword set with each of the text indexes, the picture search process can be optimized, the correlation between the search result and the text for search can be improved, and the picture search efficiency can be improved.
With further reference to fig. 5, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of an apparatus for processing pictures, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be applied to various electronic devices.
As shown in fig. 5, the apparatus 500 for processing pictures of the present embodiment may include: an acquisition unit 501, a text index generation unit 502, a visual index generation unit 503, and a storage unit 504. The acquiring unit 501 is configured to acquire a picture and text information related to the picture; a text index generating unit 502 configured to analyze the picture to obtain a first keyword set, analyze the text information to obtain a second keyword set, and generate a text index for indicating the picture according to the first keyword set and the second keyword set; a visual index generating unit 503 configured to select a keyword for representing a visual feature of the picture from the first keyword set to generate a visual index for indicating the picture; a storage unit 504 configured to store the text index and the visual index.
In the apparatus 500 for processing pictures: the obtaining unit 501, the text index generating unit 502, the visual index generating unit 503, and the storage unit 504 can refer to the related descriptions of the implementation manners of step 201, step 202, step 203, and step 204 in the corresponding embodiment of fig. 2, and are not described herein again.
In some embodiments, the apparatus 500 may further include: and a first processing unit (not shown in the figure) configured to, in response to receiving a picture for search sent by a user terminal, analyze the picture for search to extract visual features, match the visual features of the picture for search with the visual index, and present a picture indicated by the matched visual index as a search result.
In some embodiments, the apparatus 500 may further include: and a second processing unit (not shown in the figure), configured to, in response to receiving a text for search sent by the user terminal, analyze the text for search to generate a third keyword set, match the third keyword set with the text index, and present a picture indicated by the matched text index as a search result.
In some embodiments, the first processing unit may include: a calculating subunit (not shown in the figure) configured to calculate a matching degree of the visual features of the picture for search and each of the visual indexes; and a processing subunit (not shown in the figure) configured to take, as the same picture as the picture for search, a picture indicated by the visual index of which the degree of matching with the visual features of the picture for search is not lower than a first threshold in the visual index, and take, as a picture similar to the picture for search, a picture indicated by the visual index of which the degree of matching with the visual features of the picture for search is lower than the first threshold and is not lower than a second threshold.
In some embodiments, the first processing unit may include: and a display subunit (not shown in the figure) configured to display the same picture and/or similar picture as the picture for search as a search result.
In some embodiments, the visual characteristics may include at least one of: color, texture, shape.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use in implementing a server according to embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the method of the present application when executed by a Central Processing Unit (CPU) 601.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an acquisition unit, a text index generation unit, a visual index generation unit, and a storage unit. The names of these units do not in some cases constitute a limitation to the unit itself, and for example, an acquisition unit may also be described as a "unit that acquires a picture and text information related to the picture".
As another aspect, the present application also provides a non-volatile computer storage medium, which may be the non-volatile computer storage medium included in the apparatus in the above embodiment; or it may be a non-volatile computer storage medium that exists separately and is not incorporated into the terminal. The non-volatile computer storage medium stores one or more programs that, when executed by a device, cause the device to: acquiring a picture and text information related to the picture; analyzing the picture to obtain a first keyword set, analyzing the text information to obtain a second keyword set, and generating a text index for indicating the picture according to the first keyword set and the second keyword set; selecting keywords for representing visual features of the picture from the first keyword set to generate a visual index for indicating the picture; and storing the text index and the visual index.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (12)

1. A method for processing pictures, the method comprising:
acquiring a picture and text information related to the picture;
analyzing the picture to obtain a first keyword set, analyzing the text information to obtain a second keyword set, and generating a text index for indicating the picture according to the first keyword set and the second keyword set;
selecting keywords from the first keyword set for characterizing visual features of the picture to generate a visual index for indicating the picture;
storing the text index and the visual index;
generating a text index for indicating the picture according to the first keyword set and the second keyword set, including: merging the first keyword set and the second keyword set to obtain a keyword group; selecting keywords in the keyword group based on the correlation between each keyword in the keyword group and the picture; and generating a text index used for indicating the picture based on the selected keywords.
2. The method of claim 1, further comprising:
and in response to receiving a picture for searching sent by a user terminal, analyzing the picture for searching to extract visual features, matching the visual features of the picture for searching with the visual index, and displaying the picture indicated by the matched visual index as a searching result.
3. The method of claim 1, further comprising:
and in response to receiving a text for searching sent by the user terminal, analyzing the text for searching to generate a third key word set, matching the third key word set with the text index, and displaying a picture indicated by the matched text index as a searching result.
4. The method of claim 2, wherein matching the visual characteristics of the picture for search with the visual index comprises:
calculating the matching degree of the visual features of the picture for searching and each visual index in the visual indexes;
and regarding a picture indicated by the visual index with the matching degree of the visual features of the picture for searching not lower than a first threshold value in the visual index as a picture same as the picture for searching, and regarding a picture indicated by the visual index with the matching degree of the visual features of the picture for searching lower than the first threshold value and not lower than a second threshold value as a picture similar to the picture for searching.
5. The method of claim 4, wherein presenting the picture indicated by the matched visual index as a search result comprises:
and displaying the picture which is the same as and/or similar to the picture for searching as a searching result.
6. The method of claim 1, wherein the visual features comprise at least one of: color, texture, shape.
7. An apparatus for processing pictures, the apparatus comprising:
an acquisition unit configured to acquire a picture and text information related to the picture;
the text index generating unit is configured to analyze the picture to obtain a first keyword set, analyze the text information to obtain a second keyword set, and generate a text index for indicating the picture according to the first keyword set and the second keyword set;
a visual index generating unit, configured to select a keyword from the first keyword set, the keyword being used for characterizing a visual feature of the picture, so as to generate a visual index indicating the picture;
a storage unit configured to store the text index and the visual index;
generating a text index for indicating the picture according to the first keyword set and the second keyword set, including: merging the first keyword set and the second keyword set to obtain a keyword group; selecting keywords in the keyword group based on the correlation between each keyword in the keyword group and the picture; and generating a text index used for indicating the picture based on the selected keywords.
8. The apparatus of claim 7, further comprising:
the first processing unit is configured to, in response to receiving a picture for search sent by a user terminal, analyze the picture for search to extract visual features, match the visual features of the picture for search with the visual index, and display a picture indicated by the matched visual index as a search result.
9. The apparatus of claim 7, further comprising:
and the second processing unit is configured to, in response to receiving a text for search sent by the user terminal, analyze the text for search to generate a third keyword set, match the third keyword set with the text index, and display a picture indicated by the matched text index as a search result.
10. The apparatus of claim 8, wherein the first processing unit comprises:
the calculation subunit is configured to calculate the matching degree of the visual features of the picture for searching and each visual index in the visual indexes;
and the processing subunit is configured to regard, as the same picture as the picture for search, a picture indicated by the visual index, of which the degree of matching with the visual features of the picture for search is not lower than a first threshold, and regard, as a picture similar to the picture for search, a picture indicated by the visual index, of which the degree of matching with the visual features of the picture for search is lower than the first threshold and is not lower than a second threshold.
11. The apparatus of claim 10, wherein the first processing unit comprises:
and the display subunit is configured to display the same picture and/or similar picture as the picture for searching as a search result.
12. The apparatus of claim 7, wherein the visual features comprise at least one of: color, texture, shape.
CN201611042535.0A 2016-11-11 2016-11-11 Method and device for processing pictures Active CN106708940B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611042535.0A CN106708940B (en) 2016-11-11 2016-11-11 Method and device for processing pictures

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611042535.0A CN106708940B (en) 2016-11-11 2016-11-11 Method and device for processing pictures

Publications (2)

Publication Number Publication Date
CN106708940A CN106708940A (en) 2017-05-24
CN106708940B true CN106708940B (en) 2020-06-30

Family

ID=58933739

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611042535.0A Active CN106708940B (en) 2016-11-11 2016-11-11 Method and device for processing pictures

Country Status (1)

Country Link
CN (1) CN106708940B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107451194A (en) * 2017-06-30 2017-12-08 百度在线网络技术(北京)有限公司 A kind of image searching method and device
CN107491477B (en) * 2017-06-30 2021-02-19 百度在线网络技术(北京)有限公司 Emotion symbol searching method and device
CN107748754B (en) * 2017-09-15 2021-10-26 广州唯品会研究院有限公司 Knowledge graph perfecting method and device
CN110309324B (en) * 2018-03-09 2024-03-22 北京搜狗科技发展有限公司 Searching method and related device
CN108829784A (en) * 2018-05-31 2018-11-16 百度在线网络技术(北京)有限公司 Panorama recommended method, device, equipment and computer-readable medium
CN109635135A (en) * 2018-11-30 2019-04-16 Oppo广东移动通信有限公司 Image index generation method, device, terminal and storage medium
CN110381339B (en) * 2019-08-07 2021-08-27 腾讯科技(深圳)有限公司 Picture transmission method and device
CN111797765A (en) * 2020-07-03 2020-10-20 北京达佳互联信息技术有限公司 Image processing method, image processing apparatus, server, and storage medium
CN112527210A (en) * 2020-12-22 2021-03-19 南京中兴力维软件有限公司 Storage method and device of full data and computer readable storage medium
CN113779297A (en) * 2021-09-01 2021-12-10 北京橙色云科技有限公司 Information searching method and device based on picture and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101458695A (en) * 2008-12-18 2009-06-17 西交利物浦大学 Mixed picture index construct and enquiry method based on key word and content characteristic and use thereof
CN102567483A (en) * 2011-12-20 2012-07-11 华中科技大学 Multi-feature fusion human face image searching method and system
CN104504109A (en) * 2014-12-30 2015-04-08 百度在线网络技术(北京)有限公司 Image search method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7917514B2 (en) * 2006-06-28 2011-03-29 Microsoft Corporation Visual and multi-dimensional search

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101458695A (en) * 2008-12-18 2009-06-17 西交利物浦大学 Mixed picture index construct and enquiry method based on key word and content characteristic and use thereof
CN102567483A (en) * 2011-12-20 2012-07-11 华中科技大学 Multi-feature fusion human face image searching method and system
CN104504109A (en) * 2014-12-30 2015-04-08 百度在线网络技术(北京)有限公司 Image search method and device

Also Published As

Publication number Publication date
CN106708940A (en) 2017-05-24

Similar Documents

Publication Publication Date Title
CN106708940B (en) Method and device for processing pictures
CN108153901B (en) Knowledge graph-based information pushing method and device
KR101721338B1 (en) Search engine and implementation method thereof
CN106649890B (en) Data storage method and device
CN107590255B (en) Information pushing method and device
CN106960030B (en) Information pushing method and device based on artificial intelligence
US8788503B1 (en) Content identification
US10229190B2 (en) Latent semantic indexing in application classification
CN107797982B (en) Method, device and equipment for recognizing text type
CN108334489B (en) Text core word recognition method and device
CN110147425B (en) Keyword extraction method and device, computer equipment and storage medium
CN108874996B (en) Website classification method and device
CN110069698B (en) Information pushing method and device
CN106354856B (en) Artificial intelligence-based deep neural network enhanced search method and device
US9558185B2 (en) Method and system to discover and recommend interesting documents
CN107679070B (en) Intelligent reading recommendation method and device and electronic equipment
US11651015B2 (en) Method and apparatus for presenting information
US9256805B2 (en) Method and system of identifying an entity from a digital image of a physical text
CN110866102A (en) Search processing method
CN110737824A (en) Content query method and device
CN113486148A (en) PDF file conversion method and device, electronic equipment and computer readable medium
CN114255067A (en) Data pricing method and device, electronic equipment and storage medium
CN109902152B (en) Method and apparatus for retrieving information
CN113221572A (en) Information processing method, device, equipment and medium
US8549008B1 (en) Determining section information of a digital volume

Legal Events

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