CN110427513B - Picture recommendation method and system - Google Patents

Picture recommendation method and system Download PDF

Info

Publication number
CN110427513B
CN110427513B CN201910621483.XA CN201910621483A CN110427513B CN 110427513 B CN110427513 B CN 110427513B CN 201910621483 A CN201910621483 A CN 201910621483A CN 110427513 B CN110427513 B CN 110427513B
Authority
CN
China
Prior art keywords
picture
content
color value
preset
currently input
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
CN201910621483.XA
Other languages
Chinese (zh)
Other versions
CN110427513A (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.)
Baidu Online Network Technology Beijing Co Ltd
Original Assignee
Baidu Online Network Technology Beijing 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 Baidu Online Network Technology Beijing Co Ltd filed Critical Baidu Online Network Technology Beijing Co Ltd
Priority to CN201910621483.XA priority Critical patent/CN110427513B/en
Publication of CN110427513A publication Critical patent/CN110427513A/en
Application granted granted Critical
Publication of CN110427513B publication Critical patent/CN110427513B/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/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • 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/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • G06F16/5838Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using colour
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Library & Information Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a picture recommendation method and a picture recommendation system, which relate to the technical field of Internet, and the picture recommendation method comprises the following steps: acquiring currently input text content; acquiring and storing picture content in a current chat window; determining a picture matched with the currently input text content and the stored picture content; and displaying the determined picture. The picture recommending method solves the problem that the chat pictures recommended in the prior art cannot meet the requirement that a user hopes to reply the same or similar pictures according to the pictures in the chat window.

Description

Picture recommendation method and system
Technical Field
The invention relates to the technical field of internet, in particular to a picture recommendation method and a picture recommendation system.
Background
With the development of internet technology, input methods have become functional plug-ins that can access almost all applications, and with the expansion of the functions of input methods, input methods have become more and more important user requirements for providing intelligent support for various services, for example, in various instant messaging tools. In addition to sending text content, the user also sends a picture containing the meaning of the text content.
At present, the input method system recommends a picture according with the meaning of the text content according to the input text content, but the picture recommended by the input method system is either a picture related to the text content input by the user or a picture cached in advance, and is not recommended with reference to the picture in the chat window. Therefore, the existing image recommendation method of the input method cannot meet the requirement that a user wants to reply the same or similar images according to the images in the chat window.
Disclosure of Invention
The embodiment of the invention aims to provide a picture recommendation method and a picture recommendation system, which solve the problem that a chat picture recommended in the prior art cannot meet the requirement that a user hopes to reply the same or similar picture according to the picture in a chat window.
In order to achieve the above object, an embodiment of the present invention provides a picture recommendation method, where the picture recommendation method includes: acquiring currently input text content; acquiring and storing picture content in a current chat window; determining a picture matched with the currently input text content and the stored picture content; and displaying the determined picture.
Through the technical scheme, the picture content which is the same as or similar to the picture content in the chat window can be recommended according to the picture in the chat window, wherein the recommended picture can be a picture set picture or an approximate picture so as to meet the requirement of a user on the recommended picture.
In another aspect, the present invention further provides a picture recommendation system, including: the character acquisition module is used for acquiring the currently input text content; the picture content acquisition module is used for acquiring and storing the picture content in the chat window; the picture determining module is used for determining a picture matched with the currently input text content and the stored picture content; and a display module for displaying the determined picture.
In another aspect, the present invention also provides a machine-readable storage medium, which stores instructions for causing a machine to execute the above-mentioned picture recommendation method.
Compared with the prior art, the picture recommendation system and the machine-readable storage medium have the same beneficial effects as the picture recommendation method, and are not described herein again.
Additional features and advantages of embodiments of the invention will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the embodiments of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the embodiments of the invention without limiting the embodiments of the invention. In the drawings:
fig. 1 is a specific flowchart of a picture recommendation method according to a first embodiment;
FIG. 2 is a flow chart of a further refinement of the "determine pictures matching the currently entered text content and stored picture content" of FIG. 1;
FIG. 3 is a flowchart of "find a picture set associated with the stored picture content in a preset picture library" in FIG. 1;
FIG. 4 is a flowchart of the decision process of FIG. 1 before "determine pictures matching the currently entered text content and stored picture content";
FIG. 5 is a flow chart of a further refinement of the "retrieve and store picture content in current chat window" of FIG. 1;
FIG. 6 is a flow chart of a further refinement of the "store picture content in current chat window" in FIG. 1 or FIG. 4;
FIG. 7 is a schematic diagram of operation of "S402" in FIG. 6; and
fig. 8 is a module connection diagram of a picture recommendation system according to an embodiment of the present invention.
Description of the reference numerals
10 third judging module 20 picture content obtaining module
30 character acquisition module 40 first judgment module
50 second decision module 60 picture determination module
61 picture acquisition submodule 62 picture determination submodule
70 display module
Detailed Description
The following detailed description of embodiments of the invention refers to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating embodiments of the invention, are given by way of illustration and explanation only, not limitation.
Before describing embodiments of the present invention in detail, the input method functions at the present stage will be briefly described. For the input method at the present stage, the expression picture can be recommended actually, but the expression picture recommended by the input method at the present stage can only be a picture containing input method characters or a picture actively pre-stored in the input method, and the recommended pictures cannot meet the needs of the user. Today's users need to better fit the pictures in a chat scene, and the prior art does not provide any improvement. In addition, in the following embodiments, the pictures actually include dynamic pictures or static pictures, wherein the pictures recommended in the following embodiments may be facial expression bag pictures.
The invention will be described in detail with reference to the accompanying drawings and specific embodiments.
Example one
Fig. 1 is a flowchart illustrating a picture recommendation method according to a first embodiment. The scheme of the invention is described in detail in the following with reference to the attached figure 1. Fig. 2 is a flow chart of fig. 1 for further improvement of "determining pictures matching the currently input text content and the stored picture content".
As shown in fig. 1, the present embodiment provides a picture recommendation method including:
and S110, acquiring the currently input text content.
And S120, acquiring and storing the picture content in the current chat window.
In this embodiment, the currently input text content is acquired first, but the present invention is not limited to the case where the currently input text content is acquired first. In the above steps, the currently input text content may be any text word, such as words of "yaho", "hello", and the like. The picture content in the current chat window is generally an emoticon picture, and the emoticon picture may be a dynamic picture or a static picture, which is not limited herein. In addition, in this step, not only the emoticon picture needs to be acquired, but also the emoticon picture needs to be stored for later use after the acquisition.
And S130, determining pictures matched with the currently input text content and the stored picture content.
After the currently input text content and the picture content in the current chat window are obtained, a set of pictures or pictures which are similar to the picture content in the current chat window and can most represent the currently input text content need to be found according to the obtained text content and the picture content in the current chat window, and a matched picture is obtained. And the matched picture is the recommended picture which needs to be obtained by the invention. Specifically, as shown in fig. 2, the following can be obtained.
S131, searching a picture set associated with the stored picture content in a preset picture library.
The picture set associated with the stored picture content may be the same set of pictures as the stored picture content, or may be pictures similar to the stored picture content.
Fig. 3 is a diagram for searching a picture set associated with the stored picture content in a preset picture library. Specifically, the search method is as follows.
S1311, a first main body area object set of each picture content in the preset picture library is obtained.
Specific embodiments thereof are as follows.
In S1311, a first subject region object of each picture content in a preset picture library and a second subject region object of the stored picture content are acquired.
Firstly, in order to obtain a first subject region object of each picture content and a stored second subject region object of the picture content, a subject region detection model needs to be trained in advance, and the training method includes:
a) establishing a main body area detection model, wherein the main body area detection model takes picture content as input and takes a main body area object of the picture as output; b) counting parameters related to various main body area objects, wherein the parameters related to various main body area objects comprise each pixel color serving as input picture content and coordinate values and width and height values of the main body area objects corresponding to the picture content serving as output, and constructing a training knowledge base, wherein the obtaining mode of each pixel color of the picture content can automatically obtain the RGB value of each pixel through an RGB identification module, and the RGB value of each pixel is more in pixel RGB value identification, such as java or Opencv and the like, which are not described herein again; c) and training the established main body region detection model by using the parameters in the training knowledge base.
Then, using the trained model, inputting each pixel color (identifiable by the above method) of the picture content in the preset picture library into the trained main body region detection model, so as to output the coordinate value and width-height value of the main body region object of the picture content, where the coordinate value and width-height value refer to the first main body region object of the picture content.
S1312, obtaining first feature information corresponding to each first body region object and second feature information of the second body region object based on perceptual hash algorithm.
Specifically, taking a first body region object as an example, the first body region object is compressed to 8 × 8 pixels, and the compressed first body region object has 64 pixels; performing color gray level conversion on the compressed first main body area object according to 64 gray levels to obtain the gray level of each pixel, and calculating the gray level average value of all 64 pixels based on the gray level of each pixel; comparing the gray scale of each pixel with the average gray scale value, and recording the data bit as '1' when the gray scale of the pixel is greater than or equal to the average gray scale value; when the gray scale of the pixel is smaller than the average value of the gray scales, the data bit is marked as '0'. Each pixel corresponds to a data bit, all the data bits "0" and "1" are combined together to form a 64-bit integer, which is the feature information of the object in the first main body region, the order of the data bit combinations in the feature information is not important, and may be the horizontal order of each row of the pixel or the vertical order of each column of the pixel, as long as the same pixel combination order is ensured to be adopted for processing all the picture contents.
Using S1312 described above for each first body region object, the first feature information corresponding to each first body region object set can be obtained.
S1313, comparing the data bit of the second feature information with the data bit of each picture content in a preset picture library corresponding to the first feature information.
S1314, if the number of the data bits of the first feature information is the same as that of the data bits of the second feature information exceeds a first set threshold, selecting the picture content in the preset picture library corresponding to the data bits of the first feature information; or if the number of the data bits of the first feature information that are the same as the number of the data bits of the second feature information is smaller than or equal to the first set threshold and larger than the second set threshold, that is, the number of the data bits that are the same is larger than 54 and smaller than 59, obtaining a first dominant color value of the object in the first main body region and a second dominant color value of the object in the second main body region, and comparing the first dominant color value of the first feature information with the second dominant color value of the object in the second main body region, where the first set threshold (that is 59) is larger than or equal to the maximum value of the set threshold range (that is 54-59), executing: and if the first dominant color value is the same as the second dominant color value, selecting the picture content in the preset picture library corresponding to the first dominant color value.
In the above step, when the number of the same data bits exceeds a first set threshold, the data may be regarded as similar picture contents in the corresponding preset picture library, and may be placed in the picture set.
In theory, the above comparison method is equivalent to calculating a "Hammingdistance" (Hammingdistance). Specifically, of 64 data bits of each processed picture content, the picture contents in a preset picture library with the same number of data bits as the stored picture content exceeding 59 (the number of different data bits does not exceed 5) are selected as similar picture contents, and the picture contents in the preset picture library with the same number exceeding 59 can be determined as extremely similar picture contents.
In the above embodiment, the manner of obtaining the first dominant color value of the first main body area object and the second dominant color value of the second main body area object may be to automatically obtain the RGB value of each pixel through the RGB recognition module, and then use the RGB value occupying the most pixels as the dominant color value.
In addition, the picture contents in the preset picture library corresponding to the first feature information in which the number of data bits identical to the second feature information of the stored picture contents is less than 54 (the number of non-identical data bits exceeds 10) are dissimilar picture contents, and the picture contents are not selected.
By the embodiment, the picture content similar to the stored picture content can be searched in the picture library, and all similar picture contents are formed into the picture set.
Further preferably, in S131, when the stored picture content is a dynamic graph, the stored picture content may be associated with a static graph or a dynamic graph, but the dynamic graph is preferred for better experience. In addition, it should be emphasized that, when the picture is a dynamic picture, there may be a plurality of main shapes and a plurality of main colors of the picture, and the main shapes and the main colors may be selected according to a certain frame image or according to a proportional weight value of each frame image. Specifically, when only one frame of image in all the frame images of the dynamic image is black, the black image can be approximately ignored based on the weight value, and the image colors of the rest frames are adopted, so that a more approximate picture can be recommended. And adopting a weight judgment mode similar to the main color of the picture for the main shape of the picture.
Specifically, when the stored picture is "machine cat", the picture set associated with the stored picture content may be pictures of cats similar to the "machine cat", or may be all pictures (including pictures of the machine cat) in the suite diagram to which the "machine cat" belongs.
In the above steps, after the picture of the "machine cat" is input, a picture of a cat similar to the "machine cat" associated with the "machine cat" picture may be obtained, or all pictures in the set drawing to which the "machine cat" belongs may be obtained. After obtaining the picture set, the matched picture needs to be obtained in the following manner.
S132, identifying the text content of the text contained in each picture in the picture set.
The text included in each picture in the picture set is identified to be a character actually existing in the picture, for example, a character of "hello" or "nice stick" is identified in the picture of "machine cat", or may be an english character, and in this embodiment, the language and the text content are not limited. Another way of Recognition may be by text Recognition software, whose principle is to directly recognize the typeface in the picture by using Optical Character Recognition (OCR) technology.
Specifically, the pictures in the picture set may be a dynamic picture and a static picture, and in a case that the pictures in the picture set are dynamic pictures, since the pictures are dynamic pictures, each frame of picture of the dynamic picture needs to be obtained, and there may be some of the pictures in each frame of picture without characters, it is necessary to comprehensively consider all the pictures in each frame and identify text content of a text displayed by all the pictures in each frame. The identification technique may refer to the above identification method, and perform identification for each frame.
And identifying the text content of the text contained in the static image in the image set under the condition that the image in the image set is the static image. The identification method of the static map may be the same as the above identification method, and is not described herein again. In addition, the dynamic graph and the static graph can be judged in advance, wherein the judgment mode can be according to the format of the picture, or according to the change of each frame of the picture, and the two modes can realize the judgment of the picture type.
S133, comparing the recognized text content with the currently input text content, and determining that the pictures in the picture set containing the currently input text content are matched pictures.
In this step, each recognized text content may be an actual word already included in the picture, for example, a word of "hello" or "nice stick" is marked in the picture of "machine cat," or may be an english word, and in this embodiment, the language and the text content are not limited. The actual manner of acquiring the characters can directly identify the characters in the picture through the character identification software, and the identification result is the text content contained in the picture set. Of course, besides the text content actually displayed, the text content included in the picture set may also be a text implied by the picture, for example, the machine cat is in a smiling expression, and the picture is labeled with a label of "laugh about", so that the "laugh about" also belongs to the text content included in the picture set, which is the implied text content, and the picture content may be injected into the picture in the form of a label, and only needs to be identified in the picture in advance. In the above process, after each text content included in the image set is determined, the text content is compared with the currently input text content, and when the two text contents are consistent, the image corresponding to the text content is determined as the required matched image. The picture is a recommendable picture which is associated with the picture of the current chat and has the same meaning as the content of the currently input text.
S140, displaying the determined picture.
The determined pictures can be displayed in any order, and the determined pictures are numbered by shortcut keys, so that a user can directly and quickly select the needed pictures according to the shortcut keys.
Further preferably, in this embodiment, after the determined pictures are displayed, the pictures in the picture set may be continuously displayed.
Further preferably, in order to better chat with the other party, the above steps of "acquiring and storing the picture content in the current chat window" may adopt a mode of "acquiring and storing the received picture content in the current chat window". After the subsequent steps are executed in the above manner, the displayed picture is a picture similar to or the same as the picture used by the other party.
The received picture content may be a picture received in a chat process, that is, a picture sent by an opposite party, where the opposite party may be a person or a plurality of persons in a chat group, that is, all the remaining pictures sent by one or more persons in the chat window are obtained and stored except that the picture sent by the opposite party is not obtained and stored. Then, in the subsequent execution process, S131, S132 and S140 are executed with the received picture as the acquisition and storage picture content, and finally, the picture associated with the received picture can be displayed.
Through the embodiment, the picture which is the same as or similar to the picture used by the other party can be recommended, the other party can feel more close, and the user can obtain more optimized and convenient user experience when using the input method. Wherein the pictures in the picture set are also actually associated with the stored picture content. When the matching pictures are not enough or are not many, the pictures in the picture set associated with the stored picture content can be displayed for the user to refer to.
Through the embodiment, the same or similar pictures can be recommended according to the pictures in the chat window for the user to select, and the requirements of the user are met. The image recommendation method in the prior art obviously cannot meet the requirements of the user, and cannot achieve the effects.
Example two
Fig. 4 is a specific flowchart of the picture recommendation method, which mainly includes a judgment operation performed before "determining a picture (referred to as" determination "process in this paragraph) that matches the currently input text content and the stored picture content", and on the basis of the first embodiment, whether the "determination" process can be started is further judged according to the currently input text content. In this embodiment, the "determination" is started when both of the following two conditions are satisfied, and it is needless to say that the subsequent "determination" process can be performed by setting that only one of the conditions is satisfied according to the actual situation.
As shown in fig. 4, the determining pictures matching the currently input text content and the stored picture content may include:
s201, judging whether the length of the currently input text is smaller than a preset text length threshold value.
Wherein the length of the currently input text is judged by the number of characters. The number of characters of the currently input text is collected as the length of the text. Correspondingly, a preset text length threshold is set, and the value can be set according to the needs of a user or can be set in advance.
Through the steps, a proper preset text length threshold is designed mainly for avoiding overlong text length. When the length of the input text exceeds a preset text length threshold value, the following steps are not executed, and the text length is not suitable for recommending pictures.
S202, judging whether the currently input text content can be matched in a preset expression word list.
The preset expression vocabulary is a pre-designed vocabulary, and although no specific picture exists in the expression vocabulary, the preset expression vocabulary can be used for judging whether the currently input text content exists as the picture of the expression package. Specifically, the expression vocabulary may include words such as "take a care of," "hello," "bye," "88," and all the words in the expression vocabulary correspond to corresponding pictures, "match to" mainly means whether the currently input text content is in a preset expression vocabulary, and the matching manner is fuzzy matching, that is, the text content that is not necessarily the same may also be similar text content.
Through the steps, when the currently input text content is found not to be matched in the preset expression vocabulary, unnecessary matching calculation is avoided.
S203, under the condition that the length of the currently input text is smaller than a preset text length threshold value and/or under the condition that the currently input text content can be matched in a preset expression word list, determining the picture matched with the currently input text content and the stored picture content.
In this embodiment, the embodiment may be implemented according to any one of the steps S201 or S202. And is not intended to limit the simultaneous execution of the two determination processes. If the determination is made only in S201, the determination of the picture matching the currently input text content and the stored picture content is performed only in "in the case where the currently input text length is smaller than the preset text length threshold". If only S202 is adopted for determination, the determination of the picture matching the currently input text content and the stored picture content only needs to be performed if the currently input text content can be matched in a preset emoji vocabulary. If the determination is made in the manner of S201 and S202, the determination of the picture matching the currently input text content and the stored picture content is performed only when both conditions are satisfied (no longer described).
Through the embodiment, the unnecessary step of determining the matched picture can be avoided, so that the matching success rate is increased, and the experience of the user is further improved.
EXAMPLE III
Fig. 5 is a flowchart of a method in a third embodiment, which mainly aims at a determination step before "acquiring and storing picture content in current chat window" in the first embodiment. The specific mode is as follows.
As shown in fig. 5, acquiring and storing the picture content in the current chat window includes:
s301, acquiring a current control application corresponding to the current chat window.
S302, under the condition that the current control application exists in a preset application list, the picture content in the current chat window is obtained and stored.
And the preset application list comprises applications capable of applying the picture recommendation method. In the above steps of this embodiment, the current chat window is actually a chat window applied by the current control. The method for determining the current Control application according to the current chat window can be that which Control application the Control with the input focus currently on the screen where the current chat window is located is determined by a method set of Active Control similar to a TSgreen type in a program. And then, the controls with the input focus at present are all applied to the current controls corresponding to the current chat window. And judging whether the current control application partially or completely exists in a preset application list or not, and accordingly judging whether the picture content in the current chat window is obtained or not. The preset application list can be maintained through a program list and can be updated and adjusted in real time.
By the mode, unnecessary pictures can be prevented from being acquired. Under the condition that the current control application corresponding to the current chat window does not belong to the maintained preset application list, the picture content in the current chat window does not need to be acquired and stored, the storage pressure of a storage is reduced, and the effectiveness of the stored picture is improved.
Example four
Fig. 6 is a flowchart of a method in the fourth embodiment, which is mainly directed to a further improvement of "storing picture contents in current chat window" in the first embodiment or the third embodiment. The specific modification is as follows. Fig. 7 is an operation schematic diagram of step S402.
As illustrated in fig. 6, storing the picture content in the current chat window includes:
s401, the obtained picture contents are sequentially stored according to the picture obtaining time sequence in the chat window.
The picture acquisition time is determined according to the picture sending time and comprises pictures sent by the self party and pictures sent by the opposite party. The obtained picture content is mainly information in the stored picture, including people, scenes and other things in the picture, and not only the name of the stored picture.
S402, under the condition that the storage amount is equal to the preset storage threshold value, if the pictures in the current chat window are continuously acquired, deleting the picture content with the most advanced picture acquisition time sequence, and then storing the latest acquired picture content.
The storage amount is actually the amount of stored picture content, and when the storage amount is the amount of acquired pictures, the corresponding storage threshold value can be 10 pictures or 100 pictures; when it is the capacity of the stored picture content, then its corresponding storage threshold may be a preset value such as 1g or 10 g. And when the image content exceeds the threshold value, deleting the image content with the most advanced image acquisition time sequence, and then storing the newly acquired image content. The above-mentioned method is actually a "first-in first-out" scheme.
Specifically, as shown in fig. 7, when the memory is full of picture contents, and when picture contents need to be stored, the picture contents closest to the memory may be deleted first, and then the latest obtained picture contents may be stored, so as to avoid storing too many picture contents and increase timeliness of subsequent identification.
Through the embodiment, the storage pressure can be relieved, and only the preset storage threshold number of picture contents are reserved at most. In addition, the timeliness of subsequent picture identification can be improved, and matching can be performed according to the pictures in the latest chat window. The matched pictures can reflect the latest chat scene most and are closer to the requirements of users.
EXAMPLE five
Fig. 8 is a module connection diagram of a picture recommendation system according to a fifth embodiment. This is described in more detail below with reference to fig. 8.
As shown in fig. 8, the present embodiment provides a picture recommendation system, which includes: a text acquiring module 30, configured to acquire currently input text content; the picture content acquisition module 20 is used for acquiring and storing the picture content in the chat window; a picture determination module 60 for determining a picture matching the currently input text content and the stored picture content; and a presentation module 70 for presenting the determined picture.
Preferably, the picture determining module 60 includes: a picture searching sub-module 61 for searching a picture set associated with the stored picture content; the identification submodule 62 is configured to identify text content of a text included in each picture in the picture set; and a picture determining submodule 63, configured to compare the identified text content with the currently input text content, and determine that a picture in the picture set corresponding to the currently input text content is a matched picture.
Preferably, the picture searching sub-module 61 includes: a first obtaining sub-module (not shown in the figure) for obtaining a first main area object of each picture content in a preset picture library and a second main area object of the stored picture content; a second obtaining sub-module (not shown in the figure) for obtaining, based on a perceptual hash algorithm, first feature information corresponding to each of the first subject area objects and second feature information of the second subject area object; a feature comparison sub-module (not shown in the figure) for comparing the data bit of the second feature information with the data bit of each picture content in a preset picture library corresponding to the first feature information; a selection sub-module (not shown in the figure), configured to select, if the number of data bits of the first feature information is the same as that of data bits of the second feature information exceeds a first set threshold, picture content in a preset picture library corresponding to the data bits of the first feature information; or a third obtaining sub-module, configured to obtain a first dominant color value of the first main body area object and a second dominant color value of the second main body area object if the number of data bits of the first feature information is the same as that of data bits of the second feature information within a set threshold range; a color comparison submodule (not shown in the figure) for comparing a first dominant color value of the first feature information with a second dominant color value of the second main area object; the selection submodule is further configured to select picture content in a preset picture library corresponding to the first dominant color value if the first dominant color value is the same as the second dominant color value; the first dominant color value of each picture content is a color value occupying the most pixels in the first main area object of each picture content, and the second dominant color value is a color value occupying the most pixels in the second main area object.
Preferably, the identification submodule 62 includes: a dynamic graph identification sub-module (not shown in the figure), configured to, when a picture in the picture set is a dynamic graph, obtain each frame of picture of the dynamic graph and identify text content of a text included in each frame of picture; and a static image recognition sub-module (not shown in the figure) for recognizing text content of text included in the static image in the image set when the image in the image set is a static image.
Preferably, the picture recommendation system may further include: the first judging module 40 is configured to judge whether a currently input text length is smaller than a preset text length threshold; and/or a second judging module 50, configured to judge whether the currently input text content can be matched in a preset expression vocabulary; moreover, the picture determining module 60 is further configured to determine a picture matching the currently input text content and the stored picture content if the determination result of the first determining module 40 and/or the second determining module 50 is yes.
Preferably, the picture recommendation system may further include: a third determining module 10, configured to obtain a current control application corresponding to a current chat window, and determine whether the current control application exists in a preset application list; the preset application list comprises applications capable of applying the picture recommendation method; and, the picture content acquiring module 20 is further configured to acquire and store the picture content in the chat window if the third determining module 10 determines that the picture content is the same as the picture content in the chat window.
Preferably, the picture content acquiring module 20 is further configured to store the acquired picture contents according to a picture acquiring time sequence in the chat window, and if the storage amount is equal to a preset storage threshold value, if a picture in the current chat window is continuously acquired, after deleting a picture content with a most previous acquiring time sequence, store a latest acquired picture content.
Preferably, the presentation module 70 is further configured to continue to present the pictures in the picture set after presenting the determined pictures.
Preferably, the picture content acquiring module 20 is further configured to acquire and store the received picture content in the current chat window.
Compared with the prior art, the specific implementation details and the effects of the fifth embodiment are the same as those of the first to fourth embodiments, and are not described herein again.
The picture recommendation system comprises a processor and a memory, wherein a character acquisition module, a picture content acquisition module, a picture determination module, a display module and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more than one, and the kernel parameters are adjusted to meet the requirement that the user acquires the recommended same or similar pictures according to the pictures in the chat window.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a storage medium having a program stored thereon, where the program, when executed by a processor, implements the picture recommendation method.
The embodiment of the invention provides a processor, which is used for running a program, wherein the picture recommendation method is executed when the program runs.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (9)

1. A picture recommendation method is characterized by comprising the following steps:
acquiring currently input text content;
acquiring and storing picture contents in a chat window;
determining a picture matched with the currently input text content and the stored picture content; and
displaying the determined picture;
wherein the determining pictures matching the currently input text content and the stored picture content comprises:
searching a picture set associated with the stored picture content in a preset picture library;
identifying text content of texts contained in each picture in the picture set; and
comparing the identified text content with the currently input text content, and determining pictures in the picture set corresponding to the currently input text content as matched pictures;
wherein the searching for the picture set associated with the stored picture content in a preset picture library comprises:
acquiring a first main area object of each picture content in a preset picture library and a second main area object of the stored picture content;
acquiring first characteristic information corresponding to each first main body area object and second characteristic information of the second main body area object based on a perceptual hash algorithm;
comparing the data bit of the second characteristic information with the data bit of each picture content in a preset picture library corresponding to the first characteristic information;
if the number of the data bits of the first characteristic information is the same as that of the data bits of the second characteristic information and exceeds a first set threshold, selecting picture contents in a preset picture library corresponding to the data bits of the first characteristic information; or
If the number of the data bits of the first feature information is equal to or less than the first set threshold and greater than a second set threshold, obtaining a first dominant color value of the object in the first main body region and a second dominant color value of the object in the second main body region, and comparing the first dominant color value of the first feature information with the second dominant color value of the object in the second main body region, where the first set threshold is greater than the second set threshold, executing:
if the first dominant color value is the same as the second dominant color value, selecting picture content in a preset picture library corresponding to the first dominant color value;
the first dominant color value of each picture content is a color value occupying the most pixels in the first main area object of each picture content, and the second dominant color value is a color value occupying the most pixels in the second main area object.
2. The method according to claim 1, wherein the identifying text content of text included in each picture in the picture set comprises:
under the condition that the pictures in the picture set are dynamic pictures, acquiring each frame of picture of the dynamic pictures and identifying text content of texts contained in each frame of picture; and
and identifying the text content of the text contained in the static image in the image set under the condition that the image in the image set is the static image.
3. The picture recommendation method according to claim 1 or 2, wherein before said determining a picture matching said currently input text content and said stored picture content, said picture recommendation method further comprises:
judging whether the length of the currently input text is smaller than a preset text length threshold value or not; and/or judging whether the currently input text content can be matched in a preset expression word list or not;
and under the condition that the length of the currently input text is smaller than a preset text length threshold value and/or the currently input text content can be matched in a preset expression word list, determining the picture matched with the currently input text content and the stored picture content.
4. The picture recommendation method according to claim 1 or 2, wherein before said obtaining and storing picture content in a current chat window, said picture recommendation method further comprises:
acquiring a current control application corresponding to a current chat window;
under the condition that the current control application exists in a preset application list, the picture content in the current chat window is obtained and stored;
and the preset application list comprises applications capable of applying the picture recommendation method.
5. The picture recommendation method according to claim 1 or 2, wherein storing the picture content in the current chat window comprises:
and storing the acquired picture contents according to the picture acquisition time sequence in the chat window, and under the condition that the storage amount is equal to a preset storage threshold value, if the picture in the current chat window is continuously acquired, after deleting the picture content with the most front picture acquisition time sequence, storing the latest acquired picture content.
6. The picture recommendation method according to claim 1 or 2, wherein said obtaining and storing picture contents in a current chat window comprises:
and acquiring and storing the received picture content in the current chat window.
7. A picture recommendation system, comprising:
the character acquisition module is used for acquiring the currently input text content;
the picture content acquisition module is used for acquiring and storing the picture content in the chat window;
the picture determining module is used for determining a picture matched with the currently input text content and the stored picture content; and
a display module for displaying the determined picture;
wherein the picture determination module comprises:
a picture searching sub-module for searching a picture set associated with the stored picture content;
the recognition sub-module is used for recognizing text contents of texts contained in the pictures in the picture set; and
the picture determining submodule is used for comparing the identified text content with the currently input text content and determining pictures in the picture set corresponding to the currently input text content as matched pictures;
wherein the picture searching sub-module comprises:
the first acquisition submodule is used for acquiring a first main area object of each picture content in a preset picture library and a second main area object of the stored picture content;
a second obtaining submodule, configured to obtain, based on a perceptual hash algorithm, first feature information corresponding to each first main area object and second feature information of the second main area object;
the characteristic comparison submodule is used for comparing the data bit of the second characteristic information with the data bit of each picture content in a preset picture library, which corresponds to the first characteristic information;
the selection submodule is used for selecting picture content in a preset picture library corresponding to the data bits of the first characteristic information if the number of the data bits of the first characteristic information is equal to that of the data bits of the second characteristic information and exceeds a first set threshold; or
A third obtaining sub-module, configured to obtain a first dominant color value of the first main body area object and a second dominant color value of the second main body area object if the number of data bits of the first feature information is the same as that of data bits of the second feature information;
the color comparison submodule is used for comparing a first main color value of the first characteristic information with a second main color value of the second main area object;
the selection submodule is further configured to select picture content in a preset picture library corresponding to the first dominant color value if the first dominant color value is the same as the second dominant color value;
the first dominant color value of each picture content is a color value occupying the most pixels in the first main area object of each picture content, and the second dominant color value is a color value occupying the most pixels in the second main area object.
8. The picture recommendation system of claim 7, wherein the identification sub-module comprises:
the dynamic image identification sub-module is used for acquiring each frame of image of the dynamic image and identifying the text content of the text contained in each frame of image under the condition that the image in the image set is the dynamic image; and
and the static image identification submodule is used for identifying the text content of the text contained in the static image in the image set under the condition that the image in the image set is the static image.
9. A machine-readable storage medium having stored thereon instructions for causing a machine to perform the picture recommendation method of any one of claims 1-6.
CN201910621483.XA 2019-07-10 2019-07-10 Picture recommendation method and system Active CN110427513B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910621483.XA CN110427513B (en) 2019-07-10 2019-07-10 Picture recommendation method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910621483.XA CN110427513B (en) 2019-07-10 2019-07-10 Picture recommendation method and system

Publications (2)

Publication Number Publication Date
CN110427513A CN110427513A (en) 2019-11-08
CN110427513B true CN110427513B (en) 2022-04-08

Family

ID=68409141

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910621483.XA Active CN110427513B (en) 2019-07-10 2019-07-10 Picture recommendation method and system

Country Status (1)

Country Link
CN (1) CN110427513B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111147356A (en) * 2019-12-30 2020-05-12 上海连尚网络科技有限公司 Information processing method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106533902A (en) * 2016-10-19 2017-03-22 北京奇虎科技有限公司 Expression recommendation method and device on smart terminal
CN107943321A (en) * 2017-12-18 2018-04-20 何治通 A kind of input method and system to match with address list
CN108234293A (en) * 2017-12-28 2018-06-29 广东欧珀移动通信有限公司 Expression management method, expression managing device and intelligent terminal
CN108227956A (en) * 2018-01-10 2018-06-29 厦门快商通信息技术有限公司 A kind of chat tool expression recommends method and system
CN108829267A (en) * 2018-05-24 2018-11-16 努比亚技术有限公司 A kind of vocabulary recommended method, equipment and computer can storage mediums
CN109818847A (en) * 2018-12-03 2019-05-28 北京奇安信科技有限公司 A kind of transmission processing method and processing device of group chat expression
CN109831572A (en) * 2018-12-14 2019-05-31 深圳壹账通智能科技有限公司 Chat picture control method, device, computer equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106533902A (en) * 2016-10-19 2017-03-22 北京奇虎科技有限公司 Expression recommendation method and device on smart terminal
CN107943321A (en) * 2017-12-18 2018-04-20 何治通 A kind of input method and system to match with address list
CN108234293A (en) * 2017-12-28 2018-06-29 广东欧珀移动通信有限公司 Expression management method, expression managing device and intelligent terminal
CN108227956A (en) * 2018-01-10 2018-06-29 厦门快商通信息技术有限公司 A kind of chat tool expression recommends method and system
CN108829267A (en) * 2018-05-24 2018-11-16 努比亚技术有限公司 A kind of vocabulary recommended method, equipment and computer can storage mediums
CN109818847A (en) * 2018-12-03 2019-05-28 北京奇安信科技有限公司 A kind of transmission processing method and processing device of group chat expression
CN109831572A (en) * 2018-12-14 2019-05-31 深圳壹账通智能科技有限公司 Chat picture control method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN110427513A (en) 2019-11-08

Similar Documents

Publication Publication Date Title
CN111612873B (en) GIF picture generation method and device and electronic equipment
CN110390260B (en) Picture scanning piece processing method and device, computer equipment and storage medium
CN110443140B (en) Text positioning method, device, computer equipment and storage medium
CN111241340A (en) Video tag determination method, device, terminal and storage medium
CN113516666A (en) Image cropping method and device, computer equipment and storage medium
CN108256523A (en) Recognition methods, device and computer readable storage medium based on mobile terminal
CN109543534B (en) Method and device for re-detecting lost target in target tracking
CN110738598A (en) Image adaptation method, electronic device and storage medium
CN106778627B (en) Detect the method, apparatus and mobile terminal of face face value
CN111429338A (en) Method, apparatus, device and computer-readable storage medium for processing video
CN110427513B (en) Picture recommendation method and system
CN111754414B (en) Image processing method and device for image processing
CN112822539B (en) Information display method, device, server and storage medium
CN113850178A (en) Video word cloud generation method and device, storage medium and electronic equipment
CN112866577B (en) Image processing method and device, computer readable medium and electronic equipment
CN113537184A (en) OCR (optical character recognition) model training method and device, computer equipment and storage medium
CN110782392B (en) Image processing method, device, electronic equipment and storage medium
CN114942854A (en) Screenshot method of GIF (graphic interchange Format) dynamic image and related equipment
EP3951619A1 (en) Information processing device, program, and information provision system
CN108304825B (en) Text detection method and device
US10572759B2 (en) Image processing device, image processing method, and program
CN116798056B (en) Form image positioning method, apparatus, device and computer readable storage medium
JP5991704B1 (en) Electronic book display device, electronic book display method, and program
JP7154071B2 (en) Driving state monitoring support system, driving state monitoring support method and program
CN115410196B (en) Small target identification system based on complex background

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
GR01 Patent grant
GR01 Patent grant