CN110196919B - Movie recommendation method and device based on key frames, terminal equipment and storage medium - Google Patents

Movie recommendation method and device based on key frames, terminal equipment and storage medium Download PDF

Info

Publication number
CN110196919B
CN110196919B CN201910390379.4A CN201910390379A CN110196919B CN 110196919 B CN110196919 B CN 110196919B CN 201910390379 A CN201910390379 A CN 201910390379A CN 110196919 B CN110196919 B CN 110196919B
Authority
CN
China
Prior art keywords
movie
processed
constituent elements
main
key frame
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
CN201910390379.4A
Other languages
Chinese (zh)
Other versions
CN110196919A (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.)
Guangdong Zhimeiyuntu Tech Corp ltd
Original Assignee
Guangdong Zhimeiyuntu Tech Corp ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Zhimeiyuntu Tech Corp ltd filed Critical Guangdong Zhimeiyuntu Tech Corp ltd
Priority to CN201910390379.4A priority Critical patent/CN110196919B/en
Publication of CN110196919A publication Critical patent/CN110196919A/en
Application granted granted Critical
Publication of CN110196919B publication Critical patent/CN110196919B/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/70Information retrieval; Database structures therefor; File system structures therefor of video data
    • G06F16/73Querying
    • G06F16/732Query formulation
    • G06F16/7328Query by example, e.g. a complete video frame or video sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/70Information retrieval; Database structures therefor; File system structures therefor of video data
    • G06F16/78Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/783Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • G06F16/7837Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using objects detected or recognised in the video content
    • G06F16/784Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using objects detected or recognised in the video content the detected or recognised objects being people
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/70Information retrieval; Database structures therefor; File system structures therefor of video data
    • G06F16/78Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/783Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • G06F16/7847Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using low-level visual features of the video content
    • G06F16/785Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using low-level visual features of the video content using colour or luminescence

Landscapes

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

Abstract

The invention discloses a movie recommendation method, a movie recommendation device, a terminal device and a storage medium based on key frames, wherein the method comprises the following steps: acquiring a movie to be compared, and determining a movie to be recommended according to the similarity scores of the movie to be compared and each prestored movie in a movie comparison database; the method for establishing the movie comparison database comprises the following steps: acquiring a plurality of movies to be processed and corresponding key frame groups; determining the dominant hue of each film to be processed according to the hue combination of each key frame; extracting main constituent elements of each film to be processed; sequentially calculating the similarity between different movies to be processed according to the main hue and the main constituent elements of each movie to be processed, and obtaining the similarity score between different movies to be processed; and storing the similarity scores of the movies to be processed and different movies to be processed to obtain a movie comparison database. By implementing the embodiment of the invention, the problems of cold start and data sparsity of the conventional movie recommendation system can be effectively solved.

Description

Movie recommendation method and device based on key frames, terminal equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a movie recommendation method and apparatus for keyframes, a terminal device, and a storage medium.
Background
The existing movie recommendation system recommends popular movies and good-rated movies according to historical scoring data of a user; on one hand, each movie does not have the scoring data of the user, and the problem of cold start can be caused under the condition that no historical scoring data exists, so that movie recommendation can not be carried out; on the other hand, if the historical score data of the user is too little, the data sparsity problem exists.
Disclosure of Invention
The embodiment of the invention provides a movie recommendation method and device based on key frames, terminal equipment and a storage medium, which can effectively solve the problems of cold start and data sparsity of the existing movie recommendation system.
An embodiment of the present invention provides a movie recommendation method based on key frames, including:
acquiring a movie to be compared, determining a movie to be recommended according to the similarity scores of the movie to be compared and each prestored movie in a movie comparison database, and then recommending the movie to be recommended;
the method for establishing the movie comparison database comprises the following steps:
acquiring a plurality of to-be-processed movies and a key frame group of each to-be-processed movie; each key frame group comprises a plurality of key frames;
determining the dominant hue of each movie to be processed according to the hue combination of each key frame in the key frame group;
extracting the constituent elements of each key frame in the key frame group of each to-be-processed movie and counting the number of the elements of each constituent element; wherein the constituent elements include people and different categories of items in the keyframe;
determining the main constituent elements of each to-be-processed movie according to the number of the constituent elements;
sequentially calculating the similarity between different movies to be processed according to the main tone and the main constituent elements of each movie to be processed, and obtaining the similarity scores between different movies to be processed;
and storing the similarity scores of the movies to be processed and different movies to be processed to obtain the movie comparison database.
Further, according to a preset frequency, splitting the film to be processed into a plurality of image frames;
calculating the number of bullet screens corresponding to each image frame, and taking the image frames with the number of bullet screens exceeding a first preset threshold value as key frames;
and extracting all the key frames to obtain the key frame group.
Further, the determining the dominant hue of each to-be-processed movie according to the hue combination of each key frame in the key frame group specifically includes:
extracting the H value of each key frame in the key frame group through an HSV color model; obtaining a tone combination of each key frame;
extracting tone combinations of all the key frames, and calculating the proportion value of each tone in all the tone combinations;
and taking the tone which has the largest ratio and exceeds a second preset threshold value as the dominant tone of the film to be processed.
Further, the extracting of the constituent elements of each key frame in the key frame group of each to-be-processed movie and the counting of the number of the constituent elements are specifically as follows:
extracting characters in the key frame through face recognition;
identifying various articles in the key frame through a preset article identification mode;
and taking the character and the various articles as the structural elements of the key frame, and calculating the occurrence frequency of each structural element in all the key frames to obtain the element number of each structural element.
Further, the determining the main constituent elements of each to-be-processed movie according to the number of the constituent elements specifically includes:
and sorting the constituent elements according to the number of the elements of the constituent elements, wherein the constituent elements are sorted from top to bottom, and the constituent elements before a third threshold are sorted as main constituent elements of the to-be-processed movie.
Further, the calculating the similarity between different movies to be processed to obtain similarity scores between different movies to be processed specifically includes:
acquiring main constituent elements and main tones of a first film to be processed, acquiring first main constituent elements and first main tones, and adding different weight values to the constituent elements in the first main constituent elements;
acquiring main constituent elements and main tones of a second to-be-processed movie, acquiring second main constituent elements and second main tones, and adding different weight values to each constituent element in the second main constituent elements;
calculating a similarity score between the first to-be-processed movie and the second to-be-processed movie by:
Figure GDA0002940779320000031
wherein H1Is the H value, H, of the first dominant hue2Is the H value, A, of the second predominant tone1A weight value, J, of a first-ranked one of the first principal constituent elements1A weight value for the last element of the first main element2Weight value, J, of the first-ranked one of the second main constituent elements2A weight value of a last-ranked constituent element of the second principal constituent elements.
On the basis of the above-described method item embodiments, corresponding apparatus item embodiments are provided,
another embodiment of the present invention provides a movie recommendation device based on keyframes, comprising a movie recommendation module and a movie comparison database establishment module, wherein the movie comparison database establishment module comprises: a key frame group acquisition subunit, a main tone determination subunit, a main element determination subunit, a similarity score calculation subunit and a storage subunit;
the movie recommendation module is used for acquiring movies to be compared, determining movies to be recommended according to the similarity scores of the movies to be compared and all pre-stored movies in the movie comparison database, and then recommending the movies to be recommended;
the movie comparison database establishing module is used for establishing a movie comparison database, and specifically comprises the following steps:
the key frame group acquisition subunit acquires a plurality of movies to be processed and a key frame group of each movie to be processed; each key frame group comprises a plurality of key frames;
the main tone determining subunit determines the main tone of each movie to be processed according to the tone combination of each key frame in the key frame group;
the main element determining subunit extracts the constituent elements of each key frame in the key frame group of each to-be-processed movie and counts the element number of each constituent element; wherein the constituent elements include people and different categories of items in the keyframe; determining the main constituent elements of each movie to be processed according to the number of the constituent elements;
the similarity score calculating subunit calculates the similarity between different movies to be processed in sequence according to the main hue and the main constituent elements of each movie to be processed, and obtains the similarity score between different movies to be processed;
and the storage subunit stores the similarity scores of the movies to be processed and the different movies to be processed to obtain the movie comparison database.
On the basis of the above method item embodiment, another embodiment is provided;
another embodiment of the present invention provides a movie recommendation terminal device based on key frames, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, the processor implements the movie recommendation method based on key frames according to any one of the above-mentioned method embodiments of the present invention.
On the basis of the above embodiment of the method, the present invention provides another embodiment;
another embodiment of the present invention provides a storage medium, where the storage medium includes a stored computer program, where when the computer program runs, a device on which the storage medium is located is controlled to execute the movie recommendation method based on keyframes according to the above-described embodiment of the present invention.
The embodiment of the invention has the following beneficial effects:
the embodiment of the invention provides a movie recommendation method, a movie recommendation device, a terminal device and a storage medium based on key frames, wherein the method comprises the following steps: acquiring a movie to be compared, determining a movie to be recommended according to the similarity scores of the movie to be compared and each prestored movie in a movie comparison database, and then recommending; the method for establishing the movie comparison database comprises the following steps: acquiring a plurality of movies to be processed and corresponding key frame groups; then calculating the tone combination of each key frame in the key frame group, and determining the dominant tone of each film to be processed; then extracting the constituent elements of each key frame of the film to be processed and counting the element number of each constituent element; determining the main constituent elements of each to-be-processed movie according to the number of the constituent elements; sequentially calculating the similarity between different movies to be processed according to the main hue and the main constituent elements of each movie to be processed, and obtaining the similarity score between different movies to be processed; in the film comparison process, the film does not need to be activated by means of passive data such as user scores and comments, the cold start problem is avoided, and the data sparsity problem caused by small data volume is avoided. Secondly, by utilizing the key frame of the film, the dominant hue and the main constituent elements of the film are extracted to obtain most numerical values of film comparison, and the problem of data sparsity is further avoided. The movie comparison data is more comprehensive and detailed, the movie recommendation effect is realized through the similarity of the data of the movie, and the recommendation precision is higher.
Drawings
Fig. 1 is a flowchart illustrating a movie recommendation method based on key frames according to an embodiment of the present invention.
Fig. 2 is a flowchart illustrating a method for establishing a movie comparison database according to an embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a movie recommendation device based on key frames according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a flowchart of a movie recommendation method based on key frames according to an embodiment of the present invention is shown, including:
s101, acquiring a to-be-compared movie.
S102, determining the movies to be recommended according to the similarity scores of the movies to be compared and the pre-stored movies in the movie comparison database, and then recommending the movies to be recommended.
For step S101, in a preferred embodiment, the to-be-compared movie may be obtained by directly receiving a movie name input by a user; the historical data of the film watching of the user can be extracted, the name of a certain film watched by the user is extracted, and the film to be compared is obtained;
as for step S102, specifically, in a preferred implementation, according to the movie name of the movie to be compared, in the movie comparison database, the similarity scores between the movies to be compared and the movies to be compared are pre-stored in each part, and the pre-stored movie with the highest similarity score is recommended to the user as the movie to be recommended.
It should be noted that, in the present invention, it is not necessary to only use the pre-stored movie with the highest similarity score as the movie to be recommended, and in another preferred embodiment, the first few pre-stored movies with the highest similarity, for example, the first 5 pre-stored movies with the highest similarity, may be selected and all used as movies to be recommended, and recommended to the user.
As shown in fig. 2, in a preferred embodiment, the method for establishing the movie comparison database includes:
step S201, acquiring a plurality of movies to be processed and a key frame group of each movie to be processed; wherein each key frame group comprises a number of key frames.
Step S202, determining the main tone of each movie to be processed according to the tone combination of each key frame in the key frame group.
Step S203, extracting the constituent elements of each key frame in the key frame group of each to-be-processed movie and counting the number of the elements of each constituent element; and determining main constituent elements of each to-be-processed movie according to the element number of the constituent elements.
And S204, sequentially calculating the similarity between different movies to be processed according to the main tone and the main constituent elements of each movie to be processed, and obtaining the similarity scores between different movies to be processed.
Step S205, storing the similarity scores between each to-be-processed movie and different to-be-processed movies to obtain the movie comparison database.
For step S201, specifically in a preferred embodiment, a large number of complete movie videos are collected through a movie or video website in units of movie names, and each complete movie video is taken as the above-mentioned to-be-processed movie. A complete movie video, as referred to herein, refers to a complete version of a movie, not a trailer or excerpt.
Then splitting the film to be processed into a plurality of image frames according to a preset frequency;
calculating the number of bullet screens corresponding to each image frame, and taking the image frames with the number of bullet screens exceeding a first preset threshold value as key frames;
and extracting all the key frames to obtain the key frame group.
Specifically, based on the collected movie video, the video is extracted and in a frame-extracting form, such as: 0.5 second/frame, and splitting the video into a plurality of static images, namely the image frames. The background and the barrage of the image are distinguished through comparing an OCR technology with the front frame and the rear frame of the image, the number of the barrage of each image frame is counted, and the image frames with the number exceeding a first preset threshold value of the barrage are used as key frames. It should be noted that the first preset threshold may be adjusted according to actual conditions, and in this scheme, 50 to 100 keyframes may be extracted from each movie by adjusting the first preset threshold, and the extracted keyframes serve as comparison data of movie similarity.
Optionally, the key frames of each to-be-processed movie may also be manually calibrated in a manual calibration manner, and then the key frames are extracted according to manual calibration information.
For step S202, in a preferred embodiment, the determining the dominant hue of each to-be-processed movie according to the hue combination of the key frames in the key frame group specifically includes:
extracting the H value of each key frame in the key frame group through an HSV color model; obtaining a tone combination of each key frame;
extracting tone combinations of all the key frames, and calculating the proportion value of each tone in all the tone combinations;
and taking the tone which has the largest ratio and exceeds a second preset threshold value as the dominant tone of the film to be processed.
In actual conditions, based on the extracted movie key frames, obtaining the hue combination of each key frame through the H value of the HSV color model; and then extracting the tone combinations of all the key frames to obtain the tone combination of the key frame group, namely the total tone combination of the film to be processed. And (5) counting the occupation ratio of each tone in the tone combination of the key frame group, and extracting the tone with the ratio of more than 50%. If only one tone is extracted, the tone is regarded as the dominant tone of the film, namely the dominant tone of the film to be processed; if the extracted tone is more than one, the tone with the largest proportion is regarded as the dominant tone of the movie. Note that, the value of "50%" in the hue with the extraction ratio greater than 50% is the second preset threshold, which may be adaptively adjusted according to actual conditions.
The color tone combination to which the key frame belongs refers to a set of color tones formed by a key frame, such as: the 01 key frame is composed of red 0, green 120, blue 240, and the key frame belongs to the color tone combination of (0, 120, 240).
The color combination of the key frame group refers to a union of color combinations to which the key frames of one movie belong.
For step S203, in a preferred embodiment, the extracting the constituent elements of each key frame in the key frame group of each to-be-processed movie and counting the number of the constituent elements specifically are:
extracting characters in the key frame through face recognition;
identifying various articles in the key frame through a preset article identification mode;
and taking the character and the various articles as the structural elements of the key frame, and calculating the occurrence frequency of each structural element in all the key frames to obtain the element number of each structural element.
Further, in a preferred embodiment, the determining the main constituent elements of each to-be-processed movie according to the number of the constituent elements specifically includes:
and sorting the constituent elements according to the number of the elements of the constituent elements, wherein the constituent elements are sorted from top to bottom, and the constituent elements before a third threshold are sorted as main constituent elements of the to-be-processed movie.
In practical situations, based on the extracted movie key frames, people and articles are taken as categories, and the combination of the constituent elements of each key frame is obtained through a recognition model. The recognition model comprises a face recognition model and an article recognition model, wherein the face recognition model is realized by an existing face recognition technology, and the article recognition model is realized by repeatedly learning article characteristics by a machine learning method.
And obtaining the composition element combination of the key frames of the movies based on the composition element combination of the key frames, and counting the occurrence frequency of each element in the combination in the key frames of the movies as the element number, and sequencing the elements in a sequence of more or less. Based on the sorting, the top ten elements (including the tenth) of the sorting of the movies are respectively extracted as the main constituent elements of the movies. The extracted main constituent elements of a film to be processed are presented in the form of a table as shown in the following table:
Figure GDA0002940779320000091
for step S204, in a preferred embodiment, the calculating the similarity between different movies to be processed to obtain the similarity score between different movies to be processed specifically includes:
acquiring main constituent elements and main tones of a first film to be processed, acquiring first main constituent elements and first main tones, and adding different weight values to the constituent elements in the first main constituent elements;
acquiring main constituent elements and main tones of a second to-be-processed movie, acquiring second main constituent elements and second main tones, and adding different weight values to each constituent element in the second main constituent elements;
calculating a similarity score between the first to-be-processed movie and the second to-be-processed movie by:
Figure GDA0002940779320000101
wherein H1Is the H value, H, of the first dominant hue2Is the H value, A, of the second predominant tone1A weight value, J, of a first-ranked one of the first principal constituent elements1A weight value for the last element of the first main element2Weight value, J, of the first-ranked one of the second main constituent elements2A weight value of a last-ranked constituent element of the second principal constituent elements.
It should be noted that the main constituent elements of the similarity between two movies to be compared in the present invention must be the same. That is, the main constituent elements for comparing the first ten digits of the movie are not limited to the sequence nor the number as long as the names are the same.
In a preferred embodiment, the setting of the weight values of the main elements may be performed in the reverse order of their sorting. For example, in the above table, if the ranking of the 10 main constituent elements is such that the element data of the main constituent element, i.e., a person, is ranked first, the weight value of the main constituent element, i.e., a person, may be set to 10, and the element data of the main constituent element, i.e., a table lamp, may be ranked tenth, and the weight value of the main constituent element, i.e., a table lamp, may be set to 1. The similarity scores between different movies to be processed can be calculated according to the formula.
For step S205, in a preferred embodiment, the names of the movies to be processed and the similarity scores between the movies are stored.
Optionally, the video data of each to-be-processed movie may also be stored during the storage.
When recommending the movies, after the names of the movies to be compared are obtained, the corresponding similarity scores are inquired in the movie comparison database according to the names of the movies to be compared, finally the movies to be recommended are determined, and the whole scheme of the invention is completed by recommending.
As shown in fig. 3, on the basis of the above-described method item embodiment, a corresponding apparatus item embodiment is provided;
an embodiment of the present invention provides a movie recommendation apparatus based on key frames, including: a movie recommendation module 301 and a movie comparison database establishment module 302, wherein the movie comparison database establishment module includes: a keyframe group acquisition subunit 312, a dominant hue determination subunit 322, a principal element determination subunit 332, and a similarity score calculation subunit 342 and a storage subunit 352;
the movie recommendation module is used for acquiring movies to be compared, determining movies to be recommended according to the similarity scores of the movies to be compared and all pre-stored movies in the movie comparison database, and then recommending the movies to be recommended;
the movie comparison database establishing module is used for establishing a movie comparison database, and specifically comprises the following steps:
the key frame group acquisition subunit acquires a plurality of movies to be processed and a key frame group of each movie to be processed; each key frame group comprises a plurality of key frames;
the main tone determining subunit determines the main tone of each movie to be processed according to the tone combination of each key frame in the key frame group;
the main element determining subunit extracts the constituent elements of each key frame in the key frame group of each to-be-processed movie and counts the element number of each constituent element; wherein the constituent elements include people and different categories of items in the keyframe; determining the main constituent elements of each movie to be processed according to the number of the constituent elements;
the similarity score calculating subunit calculates the similarity between different movies to be processed in sequence according to the main hue and the main constituent elements of each movie to be processed, and obtains the similarity score between different movies to be processed;
and the storage subunit stores the similarity scores of the movies to be processed and the different movies to be processed to obtain the movie comparison database.
It is to be understood that the foregoing apparatus item embodiments correspond to method item embodiments of the present invention, and may implement the movie recommendation method based on key frames provided by any one of the foregoing method item embodiments of the present invention.
It should be noted that the above-described device embodiments are merely illustrative, where the units/modules described as separate parts may or may not be physically separate, and the parts displayed as units/modules may or may not be physical units/modules, may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. In addition, in the drawings of the embodiment of the apparatus provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, and may be specifically implemented as one or more communication buses or signal lines. One of ordinary skill in the art can understand and implement it without inventive effort. The diagram 3 is merely an example of a key frame based movie recommendation apparatus and does not constitute a limitation of the key frame based movie recommendation apparatus, and may include more or less components than those shown, or combine some components, or different components.
On the basis of the above method item embodiment, another embodiment is provided;
another embodiment of the present invention provides a movie recommendation terminal device based on key frames, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, where the processor executes the computer program to implement the movie recommendation method based on key frames according to any one of the above-mentioned method embodiments of the present invention.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory and executed by the processor to implement the invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used for describing the execution process of the computer program in the keyframe based movie recommendation terminal device.
The movie recommendation terminal device based on the key frames can be computing devices such as desktop computers, notebooks, palm computers and cloud servers. The movie recommendation terminal device based on key frames can include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that, for example, the movie recommendation terminal device based on key frames may further include an input/output device, a network access device, a bus, etc.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like, the processor is a control center of the movie recommendation terminal device based on key frames, and various interfaces and lines are used to connect various parts of the entire movie recommendation terminal device based on key frames.
The memory may be used to store the computer program and/or module, and the processor may implement various functions of the keyframe based movie recommendation terminal device by running or executing the computer program and/or module stored in the memory and calling data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
On the basis of the above method item embodiment, another embodiment is provided;
another embodiment of the present invention provides a storage medium, which includes a stored computer program, where the storage medium is controlled by a device to execute the method for recommending a movie based on keyframes according to any one of the above embodiments of the method of the present invention when the computer program runs.
The storage medium is a computer-readable storage medium, and the module/unit integrated with the movie recommendation device/terminal device based on the key frame may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as an independent product. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like.
The embodiment of the invention has the following beneficial effects: in the process of recommending the film, the film is compared without depending on passive data such as user grading, comments and the like to activate the film, so that the cold start problem is avoided, and the data sparsity problem caused by small data volume is avoided. Secondly, since the film often renders atmosphere or transfers emotion through the color of the picture including brightness, the color of the picture is also an important judgment criterion for film classification. The method can effectively judge the subject type of the current film by extracting the dominant hue of the film, thereby realizing that whether the film is similar to the subject type of the film can be judged and compared based on the dominant hue of the film. The movie comparison data is more comprehensive and detailed, the movie recommendation effect is realized through the similarity of the data of the movie, and the recommendation precision is higher.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

Claims (8)

1. A movie recommendation method based on key frames is characterized by comprising the following steps:
acquiring a movie to be compared, determining a movie to be recommended according to the similarity scores of the movie to be compared and each prestored movie in a movie comparison database, and then recommending the movie to be recommended;
the method for establishing the movie comparison database comprises the following steps:
acquiring a plurality of to-be-processed movies and a key frame group of each to-be-processed movie; each key frame group comprises a plurality of key frames;
determining the dominant hue of each movie to be processed according to the hue combination of each key frame in the key frame group;
extracting the constituent elements of each key frame in the key frame group of each to-be-processed movie and counting the number of the elements of each constituent element; wherein the constituent elements include people and different categories of items in the keyframe;
determining the main constituent elements of each to-be-processed movie according to the number of the constituent elements;
sequentially calculating the similarity between different movies to be processed according to the main tone and the main constituent elements of each movie to be processed, and obtaining the similarity scores between different movies to be processed; the method comprises the following steps of calculating the similarity between different movies to be processed to obtain similarity scores between the different movies to be processed, and specifically comprises the following steps: acquiring main constituent elements and main tones of a first film to be processed, acquiring first main constituent elements and first main tones, and adding different weight values to the constituent elements in the first main constituent elements; acquiring main constituent elements and main tones of a second to-be-processed movie, acquiring second main constituent elements and second main tones, and adding different weight values to each constituent element in the second main constituent elements; calculating a similarity score between the first to-be-processed movie and the second to-be-processed movie by:
Figure FDA0002940779310000011
Figure FDA0002940779310000012
H1is the H value, H, of the first dominant hue2Is the H value, A, of the second predominant tone1A weight value, J, of a first-ranked one of the first principal constituent elements1A weight value for the last element of the first main element2Weight value, J, of the first-ranked one of the second main constituent elements2A weight value for a last sequenced constituent element of the second principal constituent elements;
and storing the similarity scores of the movies to be processed and different movies to be processed to obtain the movie comparison database.
2. The method of claim 1, wherein the key frame group of each of the movies to be processed is obtained by:
splitting the film to be processed into a plurality of image frames according to a preset frequency;
calculating the number of bullet screens corresponding to each image frame, and taking the image frames with the number of bullet screens exceeding a first preset threshold value as key frames;
and extracting all the key frames to obtain the key frame group.
3. The method according to claim 1, wherein the determining the dominant hue of each of the movies to be processed according to the hue combination of the key frames in the key frame group comprises:
extracting the H value of each key frame in the key frame group through an HSV color model; obtaining a tone combination of each key frame;
extracting tone combinations of all the key frames, and calculating the proportion value of each tone in all the tone combinations;
and taking the tone which has the largest ratio and exceeds a second preset threshold value as the dominant tone of the film to be processed.
4. The method according to claim 1, wherein the extracting key frame-based movie recommendation method extracts the key frame constituent elements of each key frame in the key frame group of each to-be-processed movie and counts the number of the constituent elements, specifically:
extracting characters in the key frame through face recognition;
identifying various articles in the key frame through a preset article identification mode;
and taking the character and the various articles as the structural elements of the key frame, and calculating the occurrence frequency of each structural element in all the key frames to obtain the element number of each structural element.
5. The method according to claim 4, wherein the determining the main constituent elements of each of the movies to be processed according to the number of the constituent elements comprises:
and sorting the constituent elements according to the number of the elements of the constituent elements, wherein the constituent elements are sorted from top to bottom, and the constituent elements before a third threshold are sorted as main constituent elements of the to-be-processed movie.
6. A movie recommendation apparatus based on key frames, comprising: the movie recommendation module and the movie comparison database establishment module comprise: a key frame group acquisition subunit, a main tone determination subunit, a main element determination subunit, a similarity score calculation subunit and a storage subunit;
the movie recommendation module is used for acquiring movies to be compared, determining movies to be recommended according to the similarity scores of the movies to be compared and all pre-stored movies in the movie comparison database, and then recommending the movies to be recommended;
the movie comparison database establishing module is used for establishing a movie comparison database, and specifically comprises the following steps:
the key frame group acquisition subunit acquires a plurality of movies to be processed and a key frame group of each movie to be processed; each key frame group comprises a plurality of key frames;
the main tone determining subunit determines the main tone of each movie to be processed according to the tone combination of each key frame in the key frame group;
the main element determining subunit extracts the constituent elements of each key frame in the key frame group of each to-be-processed movie and counts the element number of each constituent element; wherein the constituent elements include people and different categories of items in the keyframe; determining the main constituent elements of each movie to be processed according to the number of the constituent elements;
the similarity score calculating subunit calculates the similarity between different movies to be processed in sequence according to the main hue and the main constituent elements of each movie to be processed, and obtains the similarity score between different movies to be processed; the method comprises the following steps of calculating the similarity between different movies to be processed to obtain similarity scores between the different movies to be processed, and specifically comprises the following steps: acquiring main constituent elements and main tones of a first film to be processed, acquiring first main constituent elements and first main tones, and adding different weight values to the constituent elements in the first main constituent elements; acquiring main constituent elements and main tones of a second to-be-processed movie, acquiring second main constituent elements and second main tones, and adding different weight values to each constituent element in the second main constituent elements; calculating a similarity score between the first to-be-processed movie and the second to-be-processed movie by:
Figure FDA0002940779310000041
H1is the H value, H, of the first dominant hue2Is the H value, A, of the second predominant tone1A weight value, J, of a first-ranked one of the first principal constituent elements1A weight value for the last element of the first main element2Weight value, J, of the first-ranked one of the second main constituent elements2A weight value for a last sequenced constituent element of the second principal constituent elements;
and the storage subunit stores the similarity scores of the movies to be processed and the different movies to be processed to obtain the movie comparison database.
7. A keyframe based movie recommendation terminal device comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor implementing the keyframe based movie recommendation method as recited in any one of claims 1 to 5 when executing the computer program.
8. A storage medium comprising a stored computer program, wherein the computer program controls a device on which the storage medium is located to perform the method of any one of claims 1 to 5 when the computer program is executed.
CN201910390379.4A 2019-05-10 2019-05-10 Movie recommendation method and device based on key frames, terminal equipment and storage medium Active CN110196919B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910390379.4A CN110196919B (en) 2019-05-10 2019-05-10 Movie recommendation method and device based on key frames, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910390379.4A CN110196919B (en) 2019-05-10 2019-05-10 Movie recommendation method and device based on key frames, terminal equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110196919A CN110196919A (en) 2019-09-03
CN110196919B true CN110196919B (en) 2021-09-17

Family

ID=67752501

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910390379.4A Active CN110196919B (en) 2019-05-10 2019-05-10 Movie recommendation method and device based on key frames, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110196919B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111078942B (en) * 2019-12-18 2021-10-08 腾讯科技(深圳)有限公司 Method, device and storage medium for recommending videos

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108509436A (en) * 2017-02-24 2018-09-07 阿里巴巴集团控股有限公司 A kind of method, apparatus and computer storage media of determining recommended
CN108573032A (en) * 2018-03-27 2018-09-25 麒麟合盛网络技术股份有限公司 Video recommendation method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102117313A (en) * 2010-12-29 2011-07-06 天脉聚源(北京)传媒科技有限公司 Video retrieval method and system
CN105760544A (en) * 2016-03-16 2016-07-13 合网络技术(北京)有限公司 Video recommendation method and device
CN108668171A (en) * 2018-04-27 2018-10-16 上海哔哩哔哩科技有限公司 Video previewing method, device and computer readable storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108509436A (en) * 2017-02-24 2018-09-07 阿里巴巴集团控股有限公司 A kind of method, apparatus and computer storage media of determining recommended
CN108573032A (en) * 2018-03-27 2018-09-25 麒麟合盛网络技术股份有限公司 Video recommendation method and device

Also Published As

Publication number Publication date
CN110196919A (en) 2019-09-03

Similar Documents

Publication Publication Date Title
CN106547744B (en) Image retrieval method and system
CN104572735B (en) A kind of picture mark words recommending method and device
US20210406549A1 (en) Method and apparatus for detecting information insertion region, electronic device, and storage medium
CN106445995A (en) Picture classification method and apparatus
CN109472832B (en) Color scheme generation method and device and intelligent robot
CN111950723A (en) Neural network model training method, image processing method, device and terminal equipment
CN103353881B (en) Method and device for searching application
CN108961267B (en) Picture processing method, picture processing device and terminal equipment
CN110072140B (en) Video information prompting method, device, equipment and storage medium
CN110502664A (en) Video tab indexes base establishing method, video tab generation method and device
CN107590267A (en) Information-pushing method and device, terminal and readable storage medium storing program for executing based on picture
WO2021175040A1 (en) Video processing method and related device
CN110969170A (en) Image theme color extraction method and device and electronic equipment
CN110717058A (en) Information recommendation method and device and storage medium
CN106557549A (en) The method and apparatus of identification destination object
CN112200844A (en) Method, device, electronic equipment and medium for generating image
CN110196919B (en) Movie recommendation method and device based on key frames, terminal equipment and storage medium
CN104253981B (en) A kind of method that moving target for video investigation presses color sequence
CN116308530A (en) Advertisement implantation method, advertisement implantation device, advertisement implantation equipment and readable storage medium
CN110990617A (en) Picture marking method, device, equipment and storage medium
CN110020123B (en) Popularization information delivery method, device, medium and equipment
CN112035685A (en) Album video generating method, electronic device and storage medium
CN110825898A (en) Nail art recommendation method and device, electronic equipment and storage medium
CN111931256A (en) Color matching recommendation method, device, equipment and storage medium
CN112667831B (en) Material storage method and device and electronic equipment

Legal Events

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