A method and apparatus for ranking recommended videos
Patent Information
- Application Number
- CN202510180748.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2026-08-18
AI Technical Summary
然而,现有的视频推荐方案在色调方面未能充分考虑不同环境和用户需求的差异,导致用户观看体验参差不齐
[0076] The recommended video sorting method provided in this application first extracts video frames from the target video to obtain a set of video frames corresponding to the target video. Then, it extracts chroma features from each video frame in the set to obtain the chroma features of each video frame in the set. Next, it obtains the hue features of the target video based on the chroma features of each video frame in the set. Finally, when the target video is included in the recommended video stream of the client device, the hue features of the target video are sent to the client device. Since the recommendation server can send the hue features of the target video to the client device when the target video is included in the recommended video stream of the client device, the client device can adjust the order of the target video in the recommended video stream based on the playback environment features and the hue features of the target video. Therefore, the recommended video sorting method provided in this application can adjust the videos viewed by the user based on the video playback environment features and the video hue features, thereby improving the user's viewing experience.
Smart Images

Figure CN122601912A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of video recommendation technology, and in particular to a method and apparatus for sorting recommended videos. Background Technology
[0002] In today's era of digital information explosion, video has become one of the main ways for people to obtain information and enjoy entertainment. With the rapid development of video technology, the types and quantity of video content are growing exponentially, and videos are widely used in various fields, from everyday film and television entertainment to professional education, teaching, and business presentations.
[0003] The color tone of a video directly impacts the user's viewing experience, and different video playback environments have different requirements for color tone. For example, in bright outdoor environments, users tend to prefer videos with high color saturation and sufficient brightness; while at night or in dimly lit indoor environments, softer colors with moderate contrast are more popular. Similarly, at midday, users often prefer videos with vibrant colors and high contrast, while at night they prefer softer colors with moderate contrast. However, existing video recommendation schemes fail to fully consider the differences in color tone between different environments and user needs, resulting in inconsistent user viewing experiences. How to adjust the videos viewed by users based on the characteristics of the video playback environment and the video's color tone characteristics to improve the user's viewing experience has become an urgent problem to be solved. Summary of the Invention
[0004] In view of this, embodiments of this application provide a method and apparatus for recommending videos, used to adjust the videos viewed by users based on the characteristics of the video playback environment and the tonal characteristics of the video, so as to improve the user's viewing experience.
[0005] To achieve the above objectives, the technical solutions provided in this application are as follows:
[0006] In a first aspect, embodiments of this application provide a method for sorting recommended videos, including:
[0007] Video frames are extracted from the target video to obtain the set of video frames corresponding to the target video;
[0008] Chromaticity features are extracted from each video frame in the video frame set to obtain the chromaticity features of each video frame in the video frame set.
[0009] The hue features of the target video are obtained based on the chroma features of each video frame in the video frame set.
[0010] When the target video is included in the recommended video stream of a client device, the hue characteristics of the target video are sent to the client device so that the client device can adjust the order of the target video in the recommended video stream according to the playback environment characteristics and the hue characteristics of the target video.
[0011] As an optional implementation of this application, the step of extracting video frames from the target video to obtain a set of video frames corresponding to the target video includes:
[0012] Extract each IDR frame of the target video;
[0013] Combine the IDR frames of the target video to obtain the video frame set corresponding to the target video.
[0014] As an optional implementation of this application, the step of extracting chroma features from each video frame in the video frame set to obtain the chroma features of each video frame in the video frame set includes:
[0015] The first video frame in the video frame set is converted into an image in the RGB color space to obtain the RGB image corresponding to the first video frame; the first video frame is any video frame in the video frame set.
[0016] The red channel of the RGB color space is divided into a first number of red intervals, the green channel of the RGB color space is divided into a first number of green intervals, and the blue channel of the RGB color space is divided into a first number of blue intervals.
[0017] The pixel ratio of each red region in the RGB image is statistically analyzed to obtain the first chromaticity vector;
[0018] The pixel ratio of each green region in the RGB image is statistically analyzed to obtain the second chromaticity vector;
[0019] The pixel ratio of each blue region in the RGB image is statistically analyzed to obtain the third chromaticity vector;
[0020] The first chromaticity vector, the second chromaticity vector, and the third chromaticity vector are concatenated to obtain the RGB hue features of the first video frame;
[0021] The chromaticity features of the first video frame are obtained based on the RGB hue features of the first video frame.
[0022] As an optional implementation of this application, the step of extracting chroma features from each video frame in the video frame set to obtain the chroma features of each video frame in the video frame set includes:
[0023] The second video frame in the video frame set is converted into an image in the HSV color space to obtain the HSV image corresponding to the second video frame; the second video frame is any video frame in the video frame set.
[0024] The hue channel of the HSV color space is divided into a second number of hue intervals, the saturation channel of the HSV color space is divided into a third number of saturation intervals, and the lightness channel of the HSV color space is divided into a third number of lightness intervals.
[0025] The pixel ratio of each hue range in the HSV image is statistically analyzed to obtain the fourth chromaticity vector;
[0026] The pixel ratio of each saturation range in the HSV image is statistically analyzed to obtain the fifth chromaticity vector;
[0027] The pixel ratio of each brightness range in the HSV image is statistically analyzed to obtain the sixth chromaticity vector;
[0028] The fourth chromaticity vector, the fifth chromaticity vector, and the sixth chromaticity vector are concatenated to obtain the HSV hue features of the second video frame;
[0029] The chromaticity features of the second video frame are obtained based on the HSV hue features of the second video frame.
[0030] As an optional implementation of this application, the step of extracting chroma features from each video frame in the video frame set to obtain the chroma features of each video frame in the video frame set includes:
[0031] The third video frame in the video frame set is converted into an image in the HSV color space to obtain the HSV image corresponding to the third video frame; the third video frame is any video frame in the video frame set.
[0032] Based on the hue values of each pixel in the HSV image, the pixels in the HSV image are clustered into a fourth number of pixel clusters;
[0033] Calculate the hue value of the cluster center of each pixel cluster and the pixel ratio of each pixel cluster;
[0034] The hue clustering features of the third video frame are obtained by combining the hue values of the cluster centers of each pixel cluster and the pixel ratio of each pixel cluster.
[0035] The chromaticity features of the third video frame are obtained based on the hue clustering features of the third video frame.
[0036] As an optional implementation of this application, before extracting chroma features from each video frame in the video frame set, the method further includes:
[0037] Each video frame in the video frame set is blurred.
[0038] As an optional implementation of this application, obtaining the hue features of the target video based on the chroma features of each video frame in the video frame set includes:
[0039] The chroma features of each video frame in the video frame set are spliced together to obtain the hue features of the target video.
[0040] As an optional implementation of this application, obtaining the hue features of the target video based on the chroma features of each video frame in the video frame set includes:
[0041] The target video category to which the target video belongs is determined based on the text description information of the target video;
[0042] Obtain the transition matrix of each dimension in the tone feature corresponding to the target video classification; the element in the i-th row and j-th column of the transition matrix corresponding to any dimension is the probability of that dimension transitioning from the i-th interval to the j-th interval;
[0043] Based on the chroma features of each video frame in the video frame set and the transition matrix of each dimension in the hue features corresponding to the target video classification, obtain the chroma features of at least one prediction frame.
[0044] The chromaticity features of the target video are obtained by combining the chromaticity features of each video frame in the video frame set and the chromaticity features of at least one predicted frame.
[0045] Secondly, this application provides a method for ranking recommended videos, including:
[0046] Obtain the recommended video stream and the tone features of each recommended video in the recommended video stream;
[0047] Obtain playback environment characteristics;
[0048] Determine the degree of fit between the tonal characteristics of each recommended video and the characteristics of the playback environment;
[0049] The recommendation score of each recommended video is calculated based on the degree of fit between the color tone characteristics of each recommended video and the characteristics of the playback environment.
[0050] The recommended videos are sorted according to their recommendation rating.
[0051] As an optional implementation of this application, the acquisition of playback environment features includes:
[0052] The correlation between various environmental features and color tone features was obtained based on causal analysis;
[0053] The playback environment features are obtained by acquiring environmental features whose correlation with the hue features is greater than a threshold correlation.
[0054] Thirdly, this application provides a video recommendation server, including:
[0055] A frame extraction unit is used to extract video frames from a target video to obtain a set of video frames corresponding to the target video.
[0056] The extraction unit is used to extract chroma features from each video frame in the video frame set to obtain the chroma features of each video frame in the video frame set.
[0057] The acquisition unit is used to acquire the hue features of the target video based on the chroma features of each video frame in the video frame set;
[0058] The sending unit is configured to send the hue characteristics of the target video to the client device when the target video is included in the recommended video stream of the client device, so that the client device can adjust the order of the target video in the recommended video stream according to environmental feature information and the hue characteristics of the target video.
[0059] As an optional implementation of this application, the frame extraction unit is specifically used to extract each IDR frame of the target video and combine the each IDR frame of the target video to obtain the video frame set corresponding to the target video.
[0060] As an optional implementation of this application, the extraction unit is specifically used to convert a first video frame in the video frame set into an image in the RGB color space to obtain an RGB image corresponding to the first video frame; the first video frame is any video frame in the video frame set; the red channel of the RGB color space is divided into a first number of red intervals, the green channel of the RGB color space is divided into a first number of green intervals, and the blue channel of the RGB color space is divided into a first number of blue intervals; the pixel ratio of each red interval in the RGB image is calculated to obtain a first chromaticity vector; the pixel ratio of each green interval in the RGB image is calculated to obtain a second chromaticity vector; the pixel ratio of each blue interval in the RGB image is calculated to obtain a third chromaticity vector; the first chromaticity vector, the second chromaticity vector, and the third chromaticity vector are concatenated to obtain the RGB hue features of the first video frame; and the chromaticity features of the first video frame are obtained based on the RGB hue features of the first video frame.
[0061] As an optional implementation of this application, the extraction unit is specifically used to convert the second video frame in the video frame set into an image in the HSV color space to obtain the HSV image corresponding to the second video frame; the second video frame is any video frame in the video frame set; the hue channel of the HSV color space is divided into a second number of hue intervals, the saturation channel of the HSV color space is divided into a third number of saturation intervals, and the lightness channel of the HSV color space is divided into a third number of lightness intervals; the pixel ratio of each hue interval in the HSV image is calculated to obtain a fourth chroma vector; the pixel ratio of each saturation interval in the HSV image is calculated to obtain a fifth chroma vector; the pixel ratio of each lightness interval in the HSV image is calculated to obtain a sixth chroma vector; the fourth chroma vector, the fifth chroma vector, and the sixth chroma vector are concatenated to obtain the HSV hue feature of the second video frame; and the chroma feature of the second video frame is obtained based on the HSV hue feature of the second video frame.
[0062] As an optional implementation of this application, the extraction unit is specifically used to convert the third video frame in the video frame set into an image in the HSV color space to obtain the HSV image corresponding to the third video frame; the third video frame is any video frame in the video frame set; based on the hue value of each pixel in the HSV image, the pixels in the HSV image are clustered into a fourth number of pixel clusters; the hue value of the cluster center of each pixel cluster and the pixel ratio of each pixel cluster are counted; the hue clustering feature of the third video frame is obtained by combining the hue value of the cluster center of each pixel cluster and the pixel ratio of each pixel cluster; and the chromaticity feature of the third video frame is obtained according to the hue clustering feature of the third video frame.
[0063] As an optional implementation of this application, the extraction unit is further configured to perform blurring processing on each video frame in the video frame set before extracting chroma features from each video frame in the video frame set.
[0064] As an optional implementation of this application, the acquisition unit is specifically used to splice the chroma features of each video frame in the video frame set to obtain the hue features of the target video.
[0065] As an optional implementation of this application, the acquisition unit is specifically used to determine the target video category to which the target video belongs based on the text description information of the target video; acquire the transition matrix of each dimension in the hue feature corresponding to the target video category; the element in the i-th row and j-th column of the transition matrix corresponding to any dimension is the probability of that dimension transitioning from the i-th interval to the j-th interval; acquire the hue feature of at least one prediction frame according to the hue feature of each video frame in the video frame set and the transition matrix of each dimension in the hue feature corresponding to the target video category; and combine the hue feature of each video frame in the video frame set and the hue feature of the at least one prediction frame to acquire the hue feature of the target video.
[0066] Fourthly, embodiments of this application provide a client device, including:
[0067] A receiving unit is used to acquire the recommended video stream and the tone features of each recommended video in the recommended video stream;
[0068] The acquisition unit is used to acquire playback environment characteristics;
[0069] The processing unit is used to determine the degree of fit between the tonal features of each recommended video and the features of the playback environment.
[0070] The calculation unit is used to calculate the recommendation score of each recommended video based on the degree of fit between the tonal features of each recommended video and the features of the playback environment.
[0071] The sorting unit is used to sort the recommended videos according to their recommendation level.
[0072] As an optional implementation of this application, the acquisition unit is specifically used to acquire the correlation between various environmental features and hue features based on causal analysis; and to acquire environmental features whose correlation with hue features is greater than a threshold correlation, so as to acquire the playback environment features.
[0073] Fifthly, embodiments of this application provide an electronic device, including: a memory and a processor, wherein the memory is used to store a computer program and the processor is used to cause the electronic device to implement the recommended video sorting method described in any of the above embodiments when executing the computer program.
[0074] Sixthly, embodiments of this application provide a computer-readable storage medium that, when executed by a computing device, causes the computing device to implement the recommended video sorting method described in any of the above embodiments.
[0075] In a seventh aspect, embodiments of this application provide a computer program product that, when run on a computer, enables the computer to implement the recommended video sorting method described in any of the above embodiments.
[0076] The recommended video sorting method provided in this application first extracts video frames from the target video to obtain a set of video frames corresponding to the target video. Then, it extracts chroma features from each video frame in the set to obtain the chroma features of each video frame in the set. Next, it obtains the hue features of the target video based on the chroma features of each video frame in the set. Finally, when the target video is included in the recommended video stream of the client device, the hue features of the target video are sent to the client device. Since the recommendation server can send the hue features of the target video to the client device when the target video is included in the recommended video stream of the client device, the client device can adjust the order of the target video in the recommended video stream based on the playback environment features and the hue features of the target video. Therefore, the recommended video sorting method provided in this application can adjust the videos viewed by the user based on the video playback environment features and the video hue features, thereby improving the user's viewing experience. Attached Figure Description
[0077] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings referenced in the description of the embodiments or the prior art will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without any creative effort.
[0078] Figure 1 One of the flowcharts of the recommended video sorting method provided in this application embodiment;
[0079] Figure 2 The second flowchart of the recommended video sorting method provided in the embodiments of this application;
[0080] Figure 3 The third flowchart of the recommended video sorting method provided in this application embodiment;
[0081] Figure 4 This is a schematic diagram of the structure of the video recommendation server provided in the embodiments of this application;
[0082] Figure 5 This is a schematic diagram of the structure of the client device provided in the embodiments of this application;
[0083] Figure 6 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0084] To better understand the above-mentioned objectives, features, and advantages of this application, the solution of this application will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0085] Many specific details are set forth in the following description in order to provide a full understanding of this application, but this application may also be implemented in other ways different from those described herein. Obviously, the embodiments in the specification are only some embodiments of this application, and not all embodiments.
[0086] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner. Furthermore, in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0087] This application provides a method for ranking recommended videos, wherein the execution entity of this method can be a video recommendation server. (See also...) Figure 1 As shown, the method for sorting recommended videos includes the following steps S11 to S14:
[0088] S11. Extract video frames from the target video to obtain the set of video frames corresponding to the target video.
[0089] The target video in this application embodiment can be any video in the video resource library, and the tone features can be obtained for any resource in the video resource library through the sorting method of recommended videos provided in this application embodiment.
[0090] In some embodiments, video frame extraction is performed on the target video to obtain a set of video frames corresponding to the target video, including: extracting each Instantaneous Decoding Refresh (IDR) frame of the target video; and combining the IDR frames of the target video to obtain a set of video frames corresponding to the target video.
[0091] An IDR frame is a special type of frame in video coding, belonging to the category of I-frames. IDR frames are characterized by containing complete image information within themselves, allowing for independent decoding without referencing other frames. They can directly reconstruct a complete image and effectively limit errors during video transmission and storage, preventing error propagation and ensuring correct decoding and playback of subsequent video content.
[0092] The above embodiments are merely one optional frame extraction method provided by the present application, but the present application is not limited to this. Other methods can also be used to extract video frames from the target video in other embodiments, such as extracting 1 video frame every 10 video frames.
[0093] S12. Extract chroma features from each video frame in the video frame set to obtain the chroma features of each video frame in the video frame set.
[0094] In some embodiments, chromaticity feature extraction is performed on each video frame in the video frame set to obtain the chromaticity features of each video frame in the video frame set, including: extracting the chromaticity features of each video frame in the video frame set under a preset color space using the histogram method. The preset color space may include one or more of the following: Red Green Blue (RGB) color space, Hue Saturation Value (HSV) color space, YUV color space, CMYK color space, etc.
[0095] S13. Obtain the hue features of the target video based on the chroma features of each video frame in the video frame set.
[0096] In some embodiments, obtaining the hue features of the target video based on the chroma features of each video frame in the video frame set includes: concatenating the chroma features of each video frame in the video frame set to obtain the hue features of the target video.
[0097] For example: the set of video frames corresponding to the target video includes n video frames, and the chroma features of the n video frames are as follows: Vec frame1 Vec frame2 ...Vec framen Then the tone characteristics of the target video are: <Vec frame1 Vec frame2 , ...,Vec framen >
[0098] S14. When the target video is included in the recommended video stream of the client device, the hue characteristics of the target video are sent to the client device so that the client device can adjust the order of the target video in the recommended video stream according to the playback environment characteristics and the hue characteristics of the target video.
[0099] The recommended video sorting method provided in this application first extracts video frames from the target video to obtain a set of video frames corresponding to the target video. Then, it extracts chroma features from each video frame in the set to obtain the chroma features of each video frame in the set. Next, it obtains the hue features of the target video based on the chroma features of each video frame in the set. Finally, when the target video is included in the recommended video stream of the client device, the hue features of the target video are sent to the client device. Since the recommendation server can send the hue features of the target video to the client device when the target video is included in the recommended video stream of the client device, the client device can adjust the order of the target video in the recommended video stream based on the playback environment features and the hue features of the target video. Therefore, the recommended video sorting method provided in this application can adjust the videos viewed by the user based on the video playback environment features and the video hue features, thereby improving the user's viewing experience.
[0100] As an extension and refinement of the above embodiments, this application provides another method for sorting recommended videos, referring to... Figure 2 As shown, the method for sorting recommended videos includes the following steps:
[0101] S201. Extract video frames from the target video to obtain the set of video frames corresponding to the target video.
[0102] S202. Blur each video frame in the video frame set.
[0103] In some embodiments, blurring each video frame in the video frame set includes: performing Gaussian blurring on each video frame in the video frame set based on a preset standard deviation.
[0104] A video frame (image) can be viewed as a two-dimensional pixel matrix, where each pixel has a corresponding color value (such as RGB value). The core of Gaussian blur is to generate a weight matrix (also called a Gaussian kernel or filter) based on a Gaussian function, and then perform a convolution operation on each pixel of the image and its surrounding pixels based on this weight matrix. During convolution, the new value of each pixel is the sum of the product of the values of its surrounding pixels and their corresponding weights. Due to the characteristics of the Gaussian function, pixels closer to the cluster center have higher weights, and pixels farther away have lower weights. Therefore, when calculating the new pixel value, the cluster center and its nearby pixels contribute more to the result, thus producing a smooth blurring effect. The Gaussian function is shown below:
[0105]
[0106] Where x and y are the position coordinates of each point on the Gaussian kernel in a coordinate system with the center of the Gaussian kernel as the origin, and σ is the standard deviation.
[0107] S203. Obtain the RGB hue features of each video frame in the video frame set.
[0108] It should be noted that since each video frame in the video frame set has been blurred in step S202, the video frames in step S203 are blurred video frames.
[0109] In some embodiments, obtaining the RGB hue features of each video frame in the video frame set includes the following steps a to f:
[0110] Step a: Convert the first video frame in the video frame set into an image in the RGB color space to obtain the RGB image corresponding to the first video frame.
[0111] Wherein, the first video frame is any video frame in the set of video frames.
[0112] The RGB color space, also known as the RGB color model, is an additive color model used to represent and mix colors. In RGB, "R," "G," and "B" are abbreviations for Red, Green, and Blue, respectively. In the RGB color space, all colors can be represented by different intensities of the three basic colors (red, green, and blue) (also called primary colors). When the intensity of each primary color is represented by one byte (8 bits), the value range for each primary color is 0 to 255. When the RGB value is (0, 0, 0), no light of any color is emitted, thus representing black. When the RGB value is (255, 255, 255), because red, green, and blue light are emitted at their strongest intensity, mixing results in white, thus representing white. When the RGB value is (255, 0, 0), it represents red; when the RGB value is (0, 255, 0), it represents green; and when the RGB value is (0, 0, 255), it represents blue.
[0113] Step b: Divide the red channel of the RGB color space into a first number of red intervals, divide the green channel of the RGB color space into a first number of green intervals, and divide the blue channel of the RGB color space into a first number of blue intervals.
[0114] For example, the first quantity can be 256 / N, where N is 1, 2, 3, 4, or 5.
[0115] Step c: Calculate the pixel ratio of each red region in the RGB image to obtain the first chromaticity vector.
[0116] For example, if the pixel ratios of each red region in the RGB image are R1, R2, R3, ..., Rn, then the first chromaticity vector is...<R1,R2,R3,…,Rn> Where Ri is the ratio of the total number of pixels whose R value falls within the red interval {(255 / N)*i, (255 / N)*(i+1)} to the total number of pixels in the RGB image.
[0117] Step d: Calculate the pixel ratio of each green region in the RGB image to obtain the second chromaticity vector.
[0118] For example, if the pixel proportions of each green region in the RGB image are G1, G2, G3, ..., Gn, then the second chromaticity vector is...<G1,G2,G3,…,Gn> Where Gi is the ratio of the total number of pixels whose G-value channel falls within the green interval {(255 / N)*i, (255 / N)*(i+1)} to the total number of pixels in the RGB image.
[0119] Step e: Calculate the pixel ratio of each blue region in the RGB image to obtain the third chromaticity vector.
[0120] For example, if the pixel proportions of each blue region in the RGB image are B1, B2, B3, ..., Bn, then the third chromaticity vector is...<B1,B2,B3,…,Bn> Where Bi is the ratio of the total number of pixels whose B-value channel falls within the blue interval {(255 / N)*i, (255 / N)*(i+1)} to the total number of pixels in the RGB image.
[0121] Step f: Concatenate the first chromaticity vector, the second chromaticity vector, and the third chromaticity vector to obtain the RGB hue features of the first video frame.
[0122] That is, RGB hue characteristics
[0123] Vec RGB =<R1,R2,…,Rn,G1,G2,…,Gn,B1,B2,…,Bn> .
[0124] By taking each blurred video frame as the first video frame and performing steps a to g above, the RGB tonal characteristics of each video frame in the video frame set can be obtained.
[0125] S204. Obtain the HSV tone features of each video frame in the video frame set.
[0126] Similarly, since each video frame in the video frame set has been blurred in step S202, the video frames in step S204 are blurred video frames.
[0127] In some embodiments, obtaining the RGB hue features of each video frame in the video frame set includes the following steps 1 to 6:
[0128] Step 1: Convert the second video frame in the video frame set into an image in the HSV color space to obtain the HSV image corresponding to the second video frame.
[0129] The second video frame is any video frame in the set of video frames.
[0130] The HSV color space is a model for describing color based on the human visual system. In HSV, "H," "S," and "V" are abbreviations for Hue, Saturation, and Value, respectively. In the HSV color space, color is represented by these three elements: hue, saturation, and value. Hue is measured in degrees, theoretically ranging from 0° to 360°. It represents the type of color; for example, red corresponds to 0°, green to 120°, and blue to 240°.
[0131] Saturation indicates how close a color is to the spectrum of colors, typically ranging from 0 to 100. When saturation is 0, the color becomes grayscale. The higher the saturation, the more vivid and intense the color. Brightness indicates the lightness or darkness of a color, generally ranging from 0 to 100, where 0 represents black (lowest brightness) and 100 represents white (highest brightness). When the HSV value is (0,0,0), since the brightness is 0, there is no light, so it represents black. When the HSV value is (any value, 0,1), because the saturation is 0, it represents white regardless of the hue. When the HSV value is (0,1,1), the hue is red, with the highest saturation and brightness, representing a vivid red. When the HSV value is (120,1,1), it represents a vivid green. When the HSV value is (240,1,1), it represents a vivid blue.
[0132] Step 2: Divide the hue channel of the HSV color space into a second number of hue intervals, divide the saturation channel of the HSV color space into a third number of saturation intervals, and divide the lightness channel of the HSV color space into a third number of lightness intervals.
[0133] For example, the second quantity can be 360 / N, where N is 1, 2, 3, 4, or 5. That is, the second quantity can be 360, 180, 120, 90, or 72.
[0134] For example, the third quantity can be 100 / N, where N is 1, 2, 3, 4, or 5. That is, the third quantity can be 100, 50, 34, 25, or 20.
[0135] Step 3: Calculate the pixel ratio of each hue range in the HSV image to obtain the fourth chromaticity vector.
[0136] For example, if the pixel ratios of each hue range in the HSV image are H1, H2, H3, ..., Hn respectively, then the fourth chromaticity vector is...<H1,H2,H3,…,Hn> Where Hi is the ratio of the total number of pixels whose hue values fall within the hue interval {(360 / N)*i, (360 / N)*(i+1)} to the total number of pixels in the HSV image.
[0137] Step 4: Count the pixel ratios in each saturation interval of the HSV image to obtain the fifth chromaticity vector.
[0138] Exemplarily, if the pixel ratios in each saturation interval of the HSV image are S1, S2, S3, …, Sn in sequence, then the fifth chromaticity vector is <S1, S2, S3, …, Sn>. Where Si is the ratio of the total number of pixels whose saturation values fall within the saturation interval {(100 / N)*i, (100 / N)*(i + 1)} to the total number of pixels in the HSV image.
[0139] Step 5: Count the pixel ratios in each value interval of the HSV image to obtain the sixth chromaticity vector.
[0140] Exemplarily, if the pixel ratios in each value interval of the HSV image are V1, V2, V3, …, Vn in sequence, then the sixth chromaticity vector is <V1, V2, V3, …, Vn>. Where Vi is the ratio of the total number of pixels whose value values fall within the value interval {(100 / N)*i, (100 / N)*(i + 1)} to the total number of pixels in the HSV image.
[0141] Step 6: Concatenate the fourth chromaticity vector, the fifth chromaticity vector, and the sixth chromaticity vector to obtain the HSV hue feature of the second video frame.
[0142] That is, the HSV hue feature
[0143] Vec HSV = <H1, H2, …, Hn, S1, S2, …, Sn, V1, V2, …, Vn>.
[0144] Taking each blurred video frame as the second video frame one by one and performing the above steps 1 to 6 can obtain the HSV hue features of each video frame in the video frame set.
[0145] S205: Obtain the hue clustering features of each video frame in the video frame set.
[0146] Similarly, since each video frame in the video frame set has been blurred in step S202, the video frames in step S205 are blurred video frames.
[0147] In some embodiments, obtaining the hue clustering features of each video frame in the video frame set includes the following steps I to step IV:
[0148] Step 1: Convert the third video frame in the video frame set into an image in the HSV color space to obtain the HSV image corresponding to the third video frame.
[0149] The third video frame is any video frame in the set of video frames.
[0150] Step II: Based on the hue values of each pixel in the HSV image, cluster the pixels in the HSV image into a fourth number of pixel clusters.
[0151] In some embodiments, the pixels in the HSV image can be clustered into a fourth number of pixel clusters based on the hue value of each pixel in the HSV image using the K-Means clustering method.
[0152] For example, using the K-Means clustering method, clustering pixels in the HSV image into a fourth number of pixel clusters based on the hue values of individual pixels in the HSV image may include the following steps:
[0153] Step 1: Randomly select the fourth number of pixels as the initial cluster centers.
[0154] Step 2: Calculate the difference between the hue of each remaining pixel and the hue value of each cluster center, and assign the pixel to the pixel cluster containing the cluster center with the smallest difference.
[0155] Step 3: For each pixel cluster, calculate the average hue of all pixels in the cluster and use it as the new cluster center.
[0156] Step 4: Check whether the cluster centers no longer change significantly (e.g., the movement distance of the cluster centers is less than a certain threshold) or whether the preset number of iterations has been reached. If the conditions are met, the algorithm stops; otherwise, return to step 2 to continue iterating.
[0157] Step III: Calculate the hue value of the cluster center of each pixel cluster and the pixel ratio of each pixel cluster.
[0158] For example, when the fourth quantity is k, the statistical results of step III can be as follows:
[0159] H1、Norm(H1)、H2、Norm(H2)、……、H k Norm(H) k );
[0160] Among them, H1, H2, ..., H k The hue values of the cluster centers of each pixel cluster, Norm(H1), Norm(H2), ..., Norm(H2). k The pixel ratio of each pixel cluster.
[0161] Step IV: Combine the hue values of the cluster centers of each pixel cluster and the pixel ratio of each pixel cluster to obtain the hue clustering features of the third video frame.
[0162] That is, hue clustering features
[0163] Vec k-means = k Norm(H) k )>.
[0164] Each blurred video frame is taken as the third video frame, and steps I to IV above are performed to obtain the hue clustering features of each video frame in the video frame set.
[0165] S206. For each video frame in the video frame set, RGB hue features, HSV hue features, and hue clustering features are spliced together to obtain the chromaticity features of each video frame in the video frame set.
[0166] That is, the chroma characteristics of each video frame in the video frame set are: <Vec RGB Vec HSV Vec k-means >
[0167] S207. Obtain the hue features of the target video based on the chroma features of each video frame in the video frame set.
[0168] In some embodiments, obtaining the hue features of the target video based on the chroma features of each video frame in the video frame set includes:
[0169] The chroma features of each video frame in the video frame set are spliced together to obtain the hue features of the target video.
[0170] That is, the hue characteristics are:
[0171] <Vec frame1 Vec frame2 ...Vec framen >= <Vec RGB-1 Vec HSV-1 Vec k-means-1 Vec RGB-2 Vec HSV-2 Vec k-means-2 , ...Vec RGB-n Vec HSV .
[0172] In some embodiments, the hue features of the target video are obtained based on the chroma features of each video frame in the video frame set, including the following steps (i) and (iv):
[0173] Step (i) Determine the target video category to which the target video belongs based on the text description information of the target video.
[0174] Typically, videos are accompanied by a series of text descriptions, such as: "Changbai Mountain is so beautiful it's considered divine. Let's make a promise to go together this winter!" By inputting the text descriptions of the video into a text classification model, the video classification can be obtained.
[0175] Step 2: Obtain the transition matrix of each dimension in the tone feature corresponding to the target video classification.
[0176] In this context, the element in the i-th row and j-th column of the transition matrix corresponding to any dimension represents the probability of that dimension transitioning from the i-th interval to the j-th interval.
[0177] In some embodiments, for each dimension of the hue feature, the value range of the dimension is divided into a preset number of value intervals, and the transition probability between each value interval is obtained based on the statistical results of the overall data, and a transition matrix is generated from the transition probability between each value interval.
[0178] In some embodiments, the dimensions can be clustered using the K-means clustering method, and the range of performance index values can be divided into K value intervals based on the clustering results.
[0179] For example, for H1 (the hue value of the cluster center of the first pixel cluster) in the hue feature, the range of hue values can be divided into 5 intervals (interval 1, interval 2, interval 3, interval 4, and interval 5), and the following can be generated:
[0180] Transition matrix:
[0181]
[0182] Here, the element in the i-th row and j-th column represents the probability of H1 transitioning from interval i to interval j. For example: P 11 P represents the probability that the value of H1 of the extracted video frame belongs to the interval 1, and the value of H1 of the predicted frame also belongs to the interval 1. 23 This represents the probability that the value of H1 of the extracted video frame belongs to interval 2, and the probability that the value of H1 of the predicted frame belongs to interval 3.
[0183] Step (iii): Based on the chroma features of each video frame in the video frame set and the transition matrix of each dimension in the hue features corresponding to the target video classification, obtain the chroma features of at least one prediction frame.
[0184] For example, the next video frame after each extracted video frame can be used as the prediction frame.
[0185] Based on the chroma features of each video frame in the video frame set and the transition matrix of each dimension in the hue features corresponding to the target video classification, obtaining the chroma features of at least one prediction frame can reduce the amount of computation in the process of obtaining hue features.
[0186] Step (iv): Combine the chroma features of each video frame in the video frame set with the chroma features of at least one predicted frame to obtain the hue features of the target video.
[0187] S208. When the target video is included in the recommended video stream of the client device, the hue characteristics of the target video are sent to the client device so that the client device can adjust the order of the target video in the recommended video stream according to the playback environment characteristics and the hue characteristics of the target video.
[0188] This application also provides another method for ranking recommended videos, wherein the ranking method is executed by a client device. (Refer to...) Figure 3 As shown, the method for sorting recommended videos includes the following steps:
[0189] S31. Obtain the recommended video stream and the tone features of each recommended video in the recommended video stream.
[0190] In some embodiments, obtaining the recommended video stream and the hue features of each recommended video in the recommended video stream includes: receiving the access address and hue features of each recommended video in the recommended video stream sent by the recommendation server, accessing the video distribution server to obtain the recommended video stream according to the access address of each recommended video in the recommended video stream, thereby obtaining the recommended video stream and the hue features of each recommended video in the recommended video stream.
[0191] S32. Obtain playback environment characteristics.
[0192] In this embodiment of the application, the playback environment features mainly do not include two parts: 1. The operating status of the client device playing the recommended video, including: battery level, volume, brightness, network connection status, etc.; 2. Spatiotemporal environmental information, including: time (such as morning, noon, evening, etc.), ambient temperature, ambient brightness, etc.
[0193] S33. Determine the degree of fit between the tonal characteristics of each recommended video and the characteristics of the playback environment.
[0194] In some embodiments, a combination of environmental features <brightness, volume, battery level, time (morning, noon, evening), etc.> can be established as the playback environment feature. The consumption ratio of videos with various color tones under different playback environment features can be found by using large-scale data, and the consumption ratio of videos with various color tones is used as the fit between various color tones and playback environment features.
[0195] In some embodiments, tonal features of multiple videos can be extracted using large-scale sampling data. Correlation between various environmental features and tonal features is obtained based on causal analysis. Environmental features with a correlation greater than a threshold correlation with the tonal features are then identified to obtain the playback environment features (which may have multiple combinations, such as brightness, volume, battery level, and time; or brightness, volume, battery level, time, and network status). The tonal features of the videos are then associated with the playback environment features. Each combination of environmental features has multiple variables, for example, it could be {volume, brightness, battery level, time}. That is, the value of each environmental information vector can correspond to multiple tonal features. For example, if we have 10 categories of tonal features, when a playback environment feature takes a certain value, the proportion of the corresponding 10 tonal features is statistically analyzed to obtain the fit of each tonal feature at that time. By statistically analyzing the large-scale sampling data, the playback proportion of videos with each tonal feature under different playback environment features can be obtained, thus obtaining the fit of videos with different tonal features under different playback environment features.
[0196] Causal analysis aims to determine causal relationships between variables, that is, to explore whether a change in one variable (causal variable) leads to a change in another variable (outcome variable), and the strength and direction of this causal relationship. Based on the premise that hue features influence user video viewing behavior, the analysis identifies hue features associated with environmental characteristics during video playback (hue features most strongly correlated with certain environmental information). In some embodiments, obtaining the correlation between various environmental features and hue features based on causal analysis may include: finding the correlation between environmental features and hue features based on covariance calculation.
[0197] The covariance Cov(X,Y) of two random variables X and Y is calculated using the following formula:
[0198] Cov(X,Y)=E[(XE[X](YE[Y])]
[0199] Where E[X] is the expected value of random variable X, and E[Y] is the expected value of random variable Y. The formulas for calculating E[X] and E[Y] are shown below:
[0200]
[0201] Where, the corresponding x iIt is the value that random variable X can take, y i It is the value of the random variable Y, p i It represents the probability of X and Y taking different values, where n indicates that X and Y can take n different values.
[0202] Furthermore, the correlation between random variable X and random variable Y can be calculated using the following formula:
[0203]
[0204] Where Var(X) is the variance of random variable X, and Var(Y) is the variance of random variable Y.
[0205] The value of r ranges from [-1, 1]. The closer the value is to 1, the greater the correlation, and vice versa. The closer the value is to -1, the smaller the correlation.
[0206] In this embodiment, the hue feature is treated as a random variable Y. color For example, the values of hue features can be divided into n classes through clustering, then Y color The possible values for Y are {1, 2, ..., n}. By sampling data from the market, we can obtain the proportion (probability) of each different value. color Select environmental characteristics of the video consumption, such as brightness, volume, battery level, time, or other characteristics, such as battery level, as a random variable Y. battery The electricity values are also divided into n intervals. Using the covariance formula described above, calculate Cov(Y). color Y battery The correlation between the color tone feature and the battery level is obtained by calculating the r-value using a correlation formula. The expected value and variance of the corresponding random variables can be calculated using large-scale sampling data. For example, if the battery level is divided into 5 intervals from 0-100%, named {1,2,3,4,5}, and assuming the corresponding large-scale data shows that the probability of a value in interval 1 is 0.1, interval 2 is 0.2, interval 3 is 0.2, interval 4 is 0.3, and interval 5 is 0.2, then the expected value and variance can be calculated. Similarly, the expected value and variance can be obtained for the color tone feature. This process is repeated, selecting environmental features with a correlation greater than a threshold to the color tone feature as the playback environment feature.
[0207] S34. Calculate the recommendation score of each recommended video based on the degree of fit between the color tone characteristics of each recommended video and the characteristics of the playback environment.
[0208] In some embodiments, color preference factors can be assigned corresponding weights, and the recommendation score of each recommended video can be calculated using a weighted calculation method. The formula for calculating the recommendation score of a video can be as follows:
[0209]
[0210] Among them, R i It is the weight, x i It is a factor that influences the recommendation of a video, such as the degree to which the video's tonal characteristics match the characteristics of the playback environment.
[0211] S35. Sort the recommended videos according to their recommendation level.
[0212] In some embodiments, the client device can execute the above-described method for sorting recommended videos when the application is launched.
[0213] In application startup scenarios where network resources are scarce, the client device will pre-store several recommended videos to shorten the time it takes for users to watch the first frame of video. This scenario can be called offline recommendation. That is, at a certain time, the videos recommended by the video recommendation server are cached in the client device's cache, and the cached videos are read from the cache for playback on the next cold start, thereby improving the initial refresh speed. The embodiments of this application can further sort the cached videos using the recommended video sorting method provided in the above embodiments to improve the user's video viewing experience.
[0214] In some embodiments, the client device can execute the above-described video recommendation sorting method in a user retention scenario. For example, when the user clicks the "System Back" button for the first time, the above-described video recommendation sorting method is executed, the most recommended video is played, and a prompt "Press again to exit" appears.
[0215] When a user uses an application, from launching the application to finally exiting it, the user may experience several state changes. By analyzing and determining the user's current application state in real time, the system can predict whether the user will exit the application in the near future. If the system predicts that the user will exit the application, it will execute the video recommendation ranking method provided in the above embodiments to play highly recommended videos, thereby improving user retention within the application.
[0216] Based on the same inventive concept, as an implementation of the above method, this application embodiment also provides a recommended video sorting device. This embodiment corresponds to the foregoing method embodiment. For ease of reading, this embodiment will not repeat the details of the foregoing method embodiment one by one, but it should be clear that the recommended video sorting device in this embodiment can implement all the contents of the foregoing method embodiment.
[0217] This application provides a video recommendation server. Figure 4 Here is a schematic diagram of the structure of the video recommendation server, as shown below. Figure 4As shown, the video recommendation server 400 includes:
[0218] The frame extraction unit 41 is used to extract video frames from the target video to obtain the set of video frames corresponding to the target video.
[0219] Extraction unit 42 is used to extract chroma features from each video frame in the video frame set to obtain the chroma features of each video frame in the video frame set.
[0220] The acquisition unit 43 is used to acquire the hue features of the target video based on the chroma features of each video frame in the video frame set;
[0221] The sending unit 44 is configured to send the hue characteristics of the target video to the client device when the target video is included in the recommended video stream of the client device, so that the client device can adjust the order of the target video in the recommended video stream according to the environmental feature information and the hue characteristics of the target video.
[0222] As an optional implementation of this application, the frame extraction unit 41 is specifically used to extract each IDR frame of the target video and combine the each IDR frame of the target video to obtain the video frame set corresponding to the target video.
[0223] As an optional implementation of this application, the extraction unit 42 is specifically used to convert the first video frame in the video frame set into an image in the RGB color space to obtain the RGB image corresponding to the first video frame; the first video frame is any video frame in the video frame set; the red channel of the RGB color space is divided into a first number of red intervals, the green channel of the RGB color space is divided into a first number of green intervals, and the blue channel of the RGB color space is divided into a first number of blue intervals; the pixel ratio of each red interval in the RGB image is calculated to obtain a first chromaticity vector; the pixel ratio of each green interval in the RGB image is calculated to obtain a second chromaticity vector; the pixel ratio of each blue interval in the RGB image is calculated to obtain a third chromaticity vector; the first chromaticity vector, the second chromaticity vector, and the third chromaticity vector are concatenated to obtain the RGB hue features of the first video frame; and the chromaticity features of the first video frame are obtained based on the RGB hue features of the first video frame.
[0224] As an optional implementation of this application, the extraction unit 42 is specifically used to convert the second video frame in the video frame set into an image in the HSV color space to obtain the HSV image corresponding to the second video frame; the second video frame is any video frame in the video frame set; the hue channel of the HSV color space is divided into a second number of hue intervals, the saturation channel of the HSV color space is divided into a third number of saturation intervals, and the lightness channel of the HSV color space is divided into a third number of lightness intervals; the pixel ratio of each hue interval in the HSV image is calculated to obtain a fourth chroma vector; the pixel ratio of each saturation interval in the HSV image is calculated to obtain a fifth chroma vector; the pixel ratio of each lightness interval in the HSV image is calculated to obtain a sixth chroma vector; the fourth chroma vector, the fifth chroma vector, and the sixth chroma vector are concatenated to obtain the HSV hue feature of the second video frame; and the chroma feature of the second video frame is obtained based on the HSV hue feature of the second video frame.
[0225] As an optional implementation of this application, the extraction unit 42 is specifically used to convert the third video frame in the video frame set into an image in the HSV color space to obtain the HSV image corresponding to the third video frame; the third video frame is any video frame in the video frame set; based on the hue value of each pixel in the HSV image, the pixels in the HSV image are clustered into a fourth number of pixel clusters; the hue value of the cluster center of each pixel cluster and the pixel ratio of each pixel cluster are counted; the hue clustering feature of the third video frame is obtained by combining the hue value of the cluster center of each pixel cluster and the pixel ratio of each pixel cluster; and the chromaticity feature of the third video frame is obtained according to the hue clustering feature of the third video frame.
[0226] As an optional implementation of this application, the extraction unit 42 is further configured to perform blurring processing on each video frame in the video frame set before extracting chroma features from each video frame in the video frame set.
[0227] As an optional implementation of this application, the acquisition unit 43 is specifically used to splice the chromaticity features of each video frame in the video frame set to obtain the hue features of the target video.
[0228] As an optional implementation of this application, the acquisition unit 43 is specifically used to determine the target video category to which the target video belongs based on the text description information of the target video; acquire the transition matrix of each dimension in the hue feature corresponding to the target video category; the element in the i-th row and j-th column of the transition matrix corresponding to any dimension is the probability of that dimension transitioning from the i-th interval to the j-th interval; acquire the hue feature of at least one prediction frame according to the hue feature of each video frame in the video frame set and the transition matrix of each dimension in the hue feature corresponding to the target video category; and combine the hue feature of each video frame in the video frame set and the hue feature of the at least one prediction frame to acquire the hue feature of the target video.
[0229] This application provides a client device. Figure 5 This is a schematic diagram of the client device, such as... Figure 5 As shown, the client device 500 includes:
[0230] The receiving unit 51 is used to acquire the recommended video stream and the tone features of each recommended video in the recommended video stream;
[0231] Acquisition unit 52 is used to acquire playback environment features;
[0232] Processing unit 53 is used to determine the degree of fit between the tone features of each recommended video and the features of the playback environment;
[0233] The calculation unit 54 is used to calculate the recommendation degree of each recommended video based on the degree of fit between the tone features of each recommended video and the playback environment features.
[0234] The sorting unit 55 is used to sort the recommended videos according to their recommendation level.
[0235] As an optional implementation of this application, the acquisition unit 52 is specifically used to acquire the correlation between each environmental feature and the hue feature based on causal analysis; and to acquire environmental features whose correlation with the hue feature is greater than a threshold correlation, so as to acquire the playback environment feature.
[0236] The recommended video sorting device provided in this application embodiment can execute the recommended video sorting method provided in any of the above embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0237] Based on the same inventive concept, embodiments of this application also provide an electronic device. Figure 6 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application, such as... Figure 6As shown, the electronic device provided in this embodiment includes a memory 601 and a processor 602. The memory 601 is used to store a computer program, and the processor 602 is used to execute the recommended video sorting method provided in the above embodiment when executing the computer program.
[0238] Based on the same inventive concept, embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, causes the computing device to implement the recommended video sorting method provided in the above embodiments.
[0239] Based on the same inventive concept, this application also provides a computer program product that, when run on a computer, enables the computing device to implement the recommended video sorting method provided in the above embodiments.
[0240] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0241] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0242] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0243] Computer-readable media include both permanent and non-permanent, removable and non-removable storage media. Storage media can store information using any method or technology; the information can be computer-readable instructions, data structures, program modules, 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 technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0244] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some or all of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A method for ranking recommended videos, characterized in that, include: Video frames are extracted from the target video to obtain the set of video frames corresponding to the target video; Chromaticity features are extracted from each video frame in the video frame set to obtain the chromaticity features of each video frame in the video frame set. The hue features of the target video are obtained based on the chroma features of each video frame in the video frame set. When the target video is included in the recommended video stream of a client device, the hue characteristics of the target video are sent to the client device so that the client device can adjust the order of the target video in the recommended video stream according to the playback environment characteristics and the hue characteristics of the target video.
2. The method according to claim 1, characterized in that, The step of extracting video frames from the target video to obtain a set of video frames corresponding to the target video includes: Extract each instantaneous decoded refresh (IDR) frame of the target video; Combine the IDR frames of the target video to obtain the video frame set corresponding to the target video.
3. The method according to claim 1, characterized in that, The step of extracting chroma features from each video frame in the video frame set to obtain the chroma features of each video frame in the video frame set includes: The first video frame in the video frame set is converted into an image in the RGB color space to obtain the RGB image corresponding to the first video frame; the first video frame is any video frame in the video frame set. The red channel of the RGB color space is divided into a first number of red intervals, the green channel of the RGB color space is divided into a first number of green intervals, and the blue channel of the RGB color space is divided into a first number of blue intervals. The pixel ratio of each red region in the RGB image is statistically analyzed to obtain the first chromaticity vector; The pixel ratio of each green region in the RGB image is statistically analyzed to obtain the second chromaticity vector; The pixel ratio of each blue region in the RGB image is statistically analyzed to obtain the third chromaticity vector; The first chromaticity vector, the second chromaticity vector, and the third chromaticity vector are concatenated to obtain the RGB hue features of the first video frame; The chromaticity features of the first video frame are obtained based on the RGB hue features of the first video frame.
4. The method according to claim 1, characterized in that, The step of extracting chroma features from each video frame in the video frame set to obtain the chroma features of each video frame in the video frame set includes: The second video frame in the video frame set is converted into an image in the HSV color space to obtain the HSV image corresponding to the second video frame; the second video frame is any video frame in the video frame set. The hue channel of the HSV color space is divided into a second number of hue intervals, the saturation channel of the HSV color space is divided into a third number of saturation intervals, and the lightness channel of the HSV color space is divided into a third number of lightness intervals. The pixel ratio of each hue range in the HSV image is statistically analyzed to obtain the fourth chromaticity vector; The pixel ratio of each saturation range in the HSV image is statistically analyzed to obtain the fifth chromaticity vector; The pixel ratio of each brightness range in the HSV image is statistically analyzed to obtain the sixth chromaticity vector; The fourth chromaticity vector, the fifth chromaticity vector, and the sixth chromaticity vector are concatenated to obtain the HSV hue features of the second video frame; The chromaticity features of the second video frame are obtained based on the HSV hue features of the second video frame.
5. The method according to claim 1, characterized in that, The step of extracting chroma features from each video frame in the video frame set to obtain the chroma features of each video frame in the video frame set includes: The third video frame in the video frame set is converted into an image in the HSV color space to obtain the HSV image corresponding to the third video frame; the third video frame is any video frame in the video frame set. Based on the hue values of each pixel in the HSV image, the pixels in the HSV image are clustered into a fourth number of pixel clusters; Calculate the hue value of the cluster center of each pixel cluster and the pixel ratio of each pixel cluster; The hue clustering features of the third video frame are obtained by combining the hue values of the cluster centers of each pixel cluster and the pixel ratio of each pixel cluster. The chromaticity features of the third video frame are obtained based on the hue clustering features of the third video frame.
6. The method according to any one of claims 1-5, characterized in that, Before extracting chroma features from each video frame in the video frame set, the method further includes: Each video frame in the video frame set is blurred.
7. The method according to claim 1, characterized in that, The step of obtaining the hue features of the target video based on the chroma features of each video frame in the video frame set includes: The chroma features of each video frame in the video frame set are spliced together to obtain the hue features of the target video.
8. The method according to claim 1, characterized in that, The step of obtaining the hue features of the target video based on the chroma features of each video frame in the video frame set includes: The target video category to which the target video belongs is determined based on the text description information of the target video; Obtain the transition matrix of each dimension in the tone feature corresponding to the target video classification; the element in the i-th row and j-th column of the transition matrix corresponding to any dimension is the probability of that dimension transitioning from the i-th interval to the j-th interval; Based on the chroma features of each video frame in the video frame set and the transition matrix of each dimension in the hue features corresponding to the target video classification, obtain the chroma features of at least one prediction frame. The chromaticity features of the target video are obtained by combining the chromaticity features of each video frame in the video frame set and the chromaticity features of at least one predicted frame.
9. A method for ranking recommended videos, characterized in that, include: Obtain the recommended video stream and the tone features of each recommended video in the recommended video stream; Obtain playback environment characteristics; Determine the degree of fit between the tonal characteristics of each recommended video and the characteristics of the playback environment; The recommendation score of each recommended video is calculated based on the degree of fit between the color tone characteristics of each recommended video and the characteristics of the playback environment. The recommended videos are sorted according to their recommendation rating.
10. The method according to claim 9, characterized in that, The acquisition of playback environment features includes: The correlation between various environmental features and color tone features was obtained based on causal analysis; The playback environment features are obtained by acquiring environmental features whose correlation with the hue features is greater than a threshold correlation.
11. A video recommendation server, characterized in that, include: A frame extraction unit is used to extract video frames from a target video to obtain a set of video frames corresponding to the target video. The extraction unit is used to extract chroma features from each video frame in the video frame set to obtain the chroma features of each video frame in the video frame set. The acquisition unit is used to acquire the hue features of the target video based on the chroma features of each video frame in the video frame set; The sending unit is configured to send the hue characteristics of the target video to the client device when the target video is included in the recommended video stream of the client device, so that the client device can adjust the order of the target video in the recommended video stream according to environmental feature information and the hue characteristics of the target video.
12. A client device, characterized in that, include: A receiving unit is used to acquire the recommended video stream and the tone features of each recommended video in the recommended video stream; The acquisition unit is used to acquire playback environment characteristics; The processing unit is used to determine the degree of fit between the tonal features of each recommended video and the features of the playback environment. The calculation unit is used to calculate the recommendation score of each recommended video based on the degree of fit between the tonal features of each recommended video and the features of the playback environment. The sorting unit is used to sort the recommended videos according to their recommendation level.
13. An electronic device, characterized in that, include: A memory and a processor, the memory being used to store a computer program and the processor being used to cause the electronic device to implement the recommended video sorting method according to any one of claims 1-10 when executing the computer program.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a computing device, causes the computing device to implement the method for ranking recommended videos as described in any one of claims 1-10.
15. A computer program product, characterized in that, When the computer program product is run on a computer, the computer implements the method for ranking recommended videos as described in any one of claims 1-10.