A video shot segmentation method
By using video shot segmentation methods and keyframes to segment shots with high similarity, combined with intra-frame and inter-frame compression, the problem of unsatisfactory compression ratio and efficiency when the scene changes frequently in the video is solved, and more efficient video compression is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHANGZHOU WHISPER TECH CO LTD
- Filing Date
- 2025-06-23
- Publication Date
- 2026-05-01
AI Technical Summary
Existing technologies are not ideal in terms of compression ratio and efficiency when processing videos with frequent scene changes. Existing algorithms are too complex to effectively improve the situation.
By using video shot segmentation methods, keyframes are used to segment shots with high similarity. A combination of intra-frame and inter-frame compression is employed. Shot types are determined based on RGB segmentation values, and segmentation points are accurately located for targeted compression.
It improves the ratio and efficiency of video compression, reduces the amount of data processed per frame, and enhances compression performance.
Smart Images

Figure CN120602669B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of video compression technology, and in particular to a method for video shot segmentation. Background Technology
[0002] The core goal of video compression is to reduce the amount of compressed data and shorten the compression time, that is, to increase the compression ratio and compression efficiency, while maintaining visual quality as much as possible.
[0003] When the scene changes frequently in the video (such as rapid camera switching, dynamic backgrounds, flash effects, etc.), it will have a significant impact on the compression ratio, compression efficiency, bitrate allocation and reconstruction quality; the compression ratio directly affects the storage space, and the compression time directly affects the compression efficiency.
[0004] Existing technologies have made improvements by optimizing frame compression algorithms, but the effects are not significant and the algorithms are highly complex. How to improve the compression ratio and compression efficiency when video scenes change frequently is an urgent problem to be solved. Summary of the Invention
[0005] To address the shortcomings of existing methods, this invention discovers that by accurately finding keyframes in a video, segmenting highly similar shots using these keyframes, and performing inter-frame compression on these highly similar shots, both the compression ratio and compression efficiency can be improved simultaneously.
[0006] The technical solution adopted in this invention is: a video shot segmentation method comprising the following steps:
[0007] Step 1: Capture video footage and perform frame-by-frame processing;
[0008] Step 2: Crop the framed images;
[0009] In a preferred embodiment of the present invention, the cutting is performed using a width-to-height ratio coefficient.
[0010] Step 3: Set up four corner sampling areas at the four corners of the cropped image, and randomly select several sampling points;
[0011] Step 4: Set a first regular octagonal sampling edge with the same center point within the cropped image; set a second regular octagonal sampling edge with the same center point within the first regular octagonal sampling edge; set a first rectangular sampling area with the same center point within the second regular octagonal sampling edge; and randomly select several sampling points within the first and second regular octagonal sampling edges and the first rectangular sampling area.
[0012] Step 5: Separate and weight the RGB values of all sampling points to obtain a weighted pixel vector, and calculate the pixel mean and pixel variance of the weighted pixel vector;
[0013] Step 6: Calculate the pixel mean difference using the weighted pixel vectors and pixel mean values of all sampled points;
[0014] Step 7: Calculate the RGB segmentation value using the pixel mean, pixel variance, and pixel mean difference;
[0015] In a preferred embodiment of the present invention, the formula for the RGB segmentation value is:
[0016] BOU R =[((2*R 1 ave,k *R 1 ave,k-1 )+δ1)*(2*R 1 MD,k +δ2)] / [(R 1 ave,k ^2 +R 1 ave,k-1 ^2 +δ1)*(R 1 var,k +R 1 va r,k-1 +δ2)];
[0017] BOU G =[((2*G 1 ave,k *G 1 ave,k-1 )+δ1)*(2*G 1 MD,k +δ2)] / [(G 1 ave,k ^2 +G 1 ave,k-1 ^2 +δ1)*(G 1 var,k +G 1 var,k-1 +δ2)];
[0018] BOU B =[((2*B 1 ave,k *B 1 ave,k-1 )+δ1)*(2*B 1 MD,k +δ2)] / [(B 1 ave,k ^2 +B 1 ave,k-1 ^2 +δ1)*(B 1 var,k+B 1 va r,k-1 +δ2)];
[0019] BOU RGB =(BOU R +BOU G +BOU B ) / 3;
[0020] Where δ1 and δ2 are the first and second correction coefficients, respectively; R 1 ave,k G 1 ave,k B 1 ave,k These are the mean values of R, G, and B pixels at the sampling point of the k-th frame, respectively; R 1 MD,k G 1 MD,k B 1 MD,k These represent the mean differences of R, G, and B pixels at the sampling point of the k-th frame; R 1 var,k G 1 var,k B 1 var,k Let R, G, and B be the variances of the sampling points in the k-th frame, respectively.
[0021] Step 8: Determine whether a lens is a hard-cut or a graduated neutral density lens based on its RGB segmentation values;
[0022] In a preferred embodiment of the present invention, the hard-cut lens includes:
[0023] When BOU RGB,k When <= ε1, the k-th frame is the cut point; ε1 is the first threshold, BOU RGB,k is the RGB segmentation value of the k-th frame.
[0024] In a preferred embodiment of the present invention, the hard-cut lens further includes:
[0025] When ε1 <BOU RGB,k <= ε2 and BOU RGB,k-1 When ε > 3, the k-th frame is the cutting point, and ε2 and ε3 are the second and third thresholds, respectively.
[0026] In a preferred embodiment of the present invention, the graduated lens includes:
[0027] When both the peak cut point and the valley cut point meet the conditions, or only the valley cut point meets the conditions, the valley cut point is used as the dividing point.
[0028] When only the peak cut point meets the condition, the peak cut point is used as the dividing point.
[0029] In a preferred embodiment of the present invention, the peak cutting point satisfies the following condition:
[0030] When BOU RGB,λ >=ε3 and BOU RGB,max >BOU RGB,max+λj And BOU RGB,max >BOU RGB,max-λi At that time, determine if a peak cut-off point exists;
[0031] And when ε4 <BOU RGB,max <ε5 and BOU RGB,max+1 >ε4 and BOU RGB,max-1 When >ε4, the peak frame BOU RGB,max The dividing point;
[0032] Among them, ε3, ε4, and ε5 are the third, fourth, and fifth thresholds, respectively; BOU RGB,max-λi 、BOU RGB,max+λj BOU RGB,max The front λ i Frame and after λ j Frame; BOU RGB,max Peak frame; BOU RGB,λ BOU for consecutive threshold frames λ RGB .
[0033] In a preferred embodiment of the present invention, the valley value cutting point satisfies the following condition:
[0034] When BOU RGB,λ >=ε3 and BOU RGB,min <BOU RGB,min+λj And BOU RGB,min <BOU RGB,min-λi When a valley value cutting point exists, it is determined that one exists.
[0035] And when ε3 <BOU RGB,min When <ε6, use the valley frame BOU RGB,min The dividing point;
[0036] Where ε6 is the sixth threshold; BOU RGB,min-λi 、BOU RGB,min+λj BOU RGB,min The front λ i Frame and after λ j Frame; BOU RGB,min This is a valley frame.
[0037] In a preferred embodiment of the present invention, a video shot segmentation system includes: a memory for storing instructions executable by a processor; and a processor for executing the instructions to implement a video shot segmentation method.
[0038] In a preferred embodiment of the present invention, a computer-readable medium storing computer program code implements a video shot segmentation method when executed by a processor.
[0039] The beneficial effects of this invention are:
[0040] 1. This invention performs region sampling on each frame of image to obtain key parts of the image frame, thereby reducing the processing load of the entire frame;
[0041] 2. Construct a segmentation algorithm using sampling points, and rationally divide the shots based on the segmentation values;
[0042] 3. For different lens characteristics, adopt the corresponding threshold judgment method to accurately find the segmentation point;
[0043] 4. Resolve the issue of insufficient compression ratio and efficiency when existing keyframes are divided by custom equal intervals. Attached Figure Description
[0044] Figure 1 This is a flowchart of the video lens segmentation method of the present invention;
[0045] Figure 2 The original image P and the cropped image P of this invention are the original image P and the cropped image P. 1 Schematic diagram;
[0046] Figure 3 This is a schematic diagram of the four corner sampling areas of the present invention;
[0047] Figure 4 This is a schematic diagram of the octagonal and rectangular sampling area images of the present invention;
[0048] Figure 5 This is a schematic diagram of the present invention that only satisfies the peak cutting point;
[0049] Figure 6 This is a schematic diagram of the valley value cutting point of the present invention;
[0050] Figure 7 This is a schematic diagram of the peak-valley value cutting point of the present invention. Detailed Implementation
[0051] The present invention will be further described below with reference to the accompanying drawings and embodiments. The drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.
[0052] When the scene changes frequently in the video, it will affect the compression ratio and compression efficiency. Existing compression algorithms such as H.264 / H.265 use custom keyframe I to perform intra-frame compression and inter-frame compression of image frames between keyframes.
[0053] For example, in a 60-frame video, if the number of keyframes (I) is set to 3, then frames 1, 21, and 41 are keyframes (I). Frame 1 uses intra-frame compression, and frames 2-20 use inter-frame compression; similarly, frames 21-40 and 41-60. However, when there are significant changes in the image between frames 2-20, 21-40, or 41-60, the compression efficiency and compression ratio are not ideal. This is because H.264 / H.265 relies on inter-frame prediction (motion estimation, inter-frame difference) to reduce data volume by utilizing the similarity (temporal redundancy) of adjacent frames. However, when the scene changes frequently and significantly, the differences between adjacent frames are large, motion compensation fails, and the efficiency of inter-frame prediction decreases. In addition, the bitrate fluctuates drastically. In static scenes, the bitrate requirement is low, and more bits can be allocated to keyframes (I). However, in dynamic scenes, the instantaneous bitrate requirement surges (requiring high-frequency refresh of I-frames). If the bitrate control strategy (such as CBR / VBR) is not adapted, it may lead to insufficient bitrate, block artifacts, and blurring (quantization distortion).
[0054] This invention analyzes video frame by frame to find the boundary value between moving and static scenes, and uses the boundary value as keyframe I to divide the video into several sub-shots; targeted compression is then performed on consecutive frames with high similarity in the sub-shots to improve the compression ratio and compression efficiency.
[0055] like Figure 1 As shown, a video shot segmentation method includes the following steps:
[0056] Step 1: Capture video footage and perform frame-by-frame processing;
[0057] For example, a 60-second video clip at a frame rate of 60fps will have 3600 frames of images;
[0058] Step 2: Crop the image by aspect ratio using the center point of each original image frame as the center point;
[0059] like Figure 2 As shown, the original image P has a width and height of W*H, and the cropped image P... 1 The width and height are W 1 *H 1 The aspect ratio coefficient is α, W 1 =W*ɑ,H 1 =H*ɑ; where, 256 / (W*H)=<ɑ<=1 / 2;
[0060] The center point of image P is O, P 1 The center point is O ’, O and O 1 concentric;
[0061] For example: If the original image P is 1280*1280 pixels in size, and the aspect ratio α = 1 / 2, then the cropped image P 1 The size is 640*640, which is 1 / 4 of the original image P.
[0062] Step 3: In the cropped image P 1 Several four-corner sampling regions P are set at the four corners of the image. i 2 Randomly select m from the four corner sampling areas 1 i One sampling point;
[0063] Image P of the four corner sampling areas i 2 The width and height are W i 2 *H i 2 Among them, W i 2 =W 1 / β i H i 2 =H 1 / β i 2<=β i <=W 1 / 6 or 2 <= β i <=H 1 / 6; i is the index of the four corner sampling areas, i<=4 corresponds to the four corners in a clockwise direction, i.e., the top left is 1, the top right is 2, the bottom left is 3, and the bottom right is 4;
[0064] The preferred values are β1 = β2 = β3 = β4;
[0065] Among them, 36 = <m 1 i <=W i 2 *H i 2 ;
[0066] m 1 Index for the four corner sampling regions;
[0067] like Figure 3 This is a schematic diagram of the width and height of the sampling area corresponding to index 1 in the upper left corner.
[0068] Step 4: Using the cropped image P 1 Centered on the center point, in the cropped image P 1A first regular octagon is set inside the first regular octagon, a second regular octagon is set inside the first regular octagon, and a first rectangular region is set inside the second regular octagon; m is randomly selected on the side of the first regular octagon. 2 m sampling points were randomly selected from the sides of the second regular octagon. 3 1 sampling point; select m within the first rectangular area. 4 One sampling point;
[0069] Where, m 2 Denotes the index of the first regular octagon, m 3 Denotes the index of the second regular octagon, m 4 This represents the index of the first rectangular region.
[0070] Where the side length of the first regular octagon is x1, 16 <x1<=w 1 / 2;
[0071] The side length of the second regular octagon is x2, and 16 <= x2. <x1;
[0072] The width W of the first rectangle 3 High H 3 8<=W 3 H 3 <= (1+1 / sqrt(2))*x2;
[0073] Step 5: Separate the RGB values of the sampling points in each sampling region to obtain the pixel vector R. j G j B j Value; R j G j B j Assign weights γ to the values j Obtain the weighted pixel vector R 1 j G 1 j B 1 j Calculate the pixel mean R of all sampled points. 1 ave G 1 ave B 1 ave and pixel variance R 1 var G 1 var B 1 var ;
[0074] For example, m 1 1. m 1 2, m 1 3. m 14. m 2 m 3 m 4 There are seven sampling areas in total (the maximum value of the four corner sampling areas is 4), which corresponds to sampling area m when j=1. 1 1. When j=2, the corresponding sampling region m 1 2...j=7 corresponds to the sampling region m 4 ;
[0075] With R j Let's take the value as an example for explanation;
[0076] R 1 j =R j *γ j ;1=<γ j <1.5, preferably, γ1=γ2=γ3=γ4=1, γ5=1.2, γ6=1, γ7=1.33;
[0077] Similarly, we obtain G 1 j B 1 j .
[0078] Step 6: Utilize the pixel vector R of all sampled points 1 j Each pixel value and R 1 ave Calculate the difference between two consecutive frames of image P 1 Pixel mean difference R 1 MD,k ;
[0079] R 1 MD,k =Mean Difference[(R 1 k -R 1 ave,k ),(R 1 k-1 -R 1 ave,k-1 )];
[0080] Where Mean Difference is the mean difference function, k is the k-th frame, and R 1 ave,k The average pixel value of all sampled points in the k-th frame;
[0081] Similarly, we obtain G 1 MD,k B 1 MD,k ;
[0082] Step 7: Calculate the RGB segmentation value BOU using the pixel mean, pixel variance, and pixel mean difference of all sampled points. RGB ;
[0083] Segment value BOU RGB The formula is:
[0084] BOU R =[((2*R 1 ave,k *R 1 ave,k-1 )+δ1)*(2*R 1 MD,k +δ2)] / [(R 1 ave,k ^2 +R 1 ave,k-1 ^2 +δ1)*(R 1 var,k +R 1 va r,k-1 +δ2)];
[0085] Similarly, we get:
[0086] BOU G =[((2*G 1 ave,k *G 1 ave,k-1 )+δ1)*(2*G 1 MD,k +δ2)] / [(G 1 ave,k ^2 +G 1 ave,k-1 ^2 +δ1)*(G 1 var,k +G 1 var,k-1 +δ2)];
[0087] BOU B =[((2*B 1 ave,k *B 1 ave,k-1 )+δ1)*(2*B 1 MD,k +δ2)] / [(B 1 ave,k ^2 +B 1 ave,k-1 ^2 +δ1)*(B 1 var,k +B1 va r,k-1 +δ2)];
[0088] calculate:
[0089] BOU RGB =(BOU R +BOU G +BOU B ) / 3;
[0090] Where δ1 is the first correction coefficient, which is any number that is not zero, ensuring that the denominator is not zero;
[0091] δ2 is the second correction coefficient, which is any non-zero number to ensure that the denominator is not zero.
[0092] Step 8: According to BOU RGB Distinguishing between hard-cut and graduated lenses;
[0093] Step 81, determining if a shot is a hard-cut shot includes:
[0094] Step 811, when BOU RGB,k When ε1 <= ε1, the frame is set as the cutting point; preferably, ε1 = 0.24;
[0095] This indicates that the frame is a hard cut shot, and the cut point needs to be recorded, indicating that the backgrounds of the two frames are significantly different.
[0096] For example, 60 frames of image, BOU RGB,1 BOU is the segmentation value between frame 1 and frame 2. RGB,1 <0.24; BOU RGB,59 BOU is the segmentation value between frame 59 and frame 60. RGB,59 <0.24;
[0097] Find two cut values BOU RGB,1 、BOU RGB,59 The 60-frame video was divided into three shots. Intra-frame compression was used for the first and 60 frames with large background differences. For the second to 59 frames with small background differences, a combination of intra-frame compression and inter-frame compression was used. That is, intra-frame compression was used for the second frame and inter-frame compression was used for the third to 59 frames. Since the background differences of the third to 59 frames are small and the similarity is high, the compression efficiency and compression ratio can be effectively improved.
[0098] Step 812, when ε1 <BOU RGB,k <= ε2, and BOU RGB,k-1 When the value is greater than ε3, this frame is considered the cutting point.
[0099] Among them, ε1, ε2, and ε3 are user-defined parameters, with ε3>ε2>ε1;
[0100] Preferably, ε2 = 0.56 and ε3 = 0.685.
[0101] Step 82, determining if a lens is a graduated neutral density lens includes:
[0102] Step 821, when BOU RGB,λ BOU >= ε3 and the average boundary peak frame within consecutive threshold frames λ RGB,max The first λ of the frame greater than the peak i Frame and after λ j When the frame value is checked, determine if a peak cutoff point exists;
[0103] When BOU RGB,λ BOU >= ε3 and the average boundary valley frame within consecutive threshold frames RGB,min Less than the first λ of the peak frame i Frame and after λ j When determining the frame value, check for the existence of a valley value cutoff point;
[0104] In this embodiment, λ i =λ j =3;
[0105] The threshold frame λ is a user-defined parameter;
[0106] Step 8211: When only the peak cut-off point exists and ε4 is satisfied... <BOU RGB,max <ε5 and BOU RGB,max+1 >ε4 and BOU RGB,max-1 When the value is greater than ε4, the peak frame is used as the dividing point;
[0107] Where ε4 and ε5 are user-defined parameters, ε5 > ε4; BOU RGB,max-1 、BOU RGB,max+1 BOU RGB,max The frame before and after;
[0108] Preferably, ε4 = 0.9 and ε5 = 0.938;
[0109] Step 8212: When only the existence of a valley split point and ε3 are satisfied... <BOU RGB,min When ε < 6, the valley frame is used as the dividing point;
[0110] Where ε6 is a user-defined parameter, and ε6 > ε3;
[0111] Preferably, ε6 = 0.9;
[0112] Step 8213: When the peak and valley value cutting points are satisfied simultaneously, first determine whether step 8212 is satisfied. If step 8212 is not satisfied, execute step 8211.
[0113] Among them, steps 8211 and 8212 are parallel logical relationships, not sequential logical relationships;
[0114] ε1 to ε6 represent the first threshold to the sixth threshold, respectively;
[0115] like Figure 5 This is an example that only satisfies the peak cut point;
[0116] First, the threshold frame λ = 9, and the 4th frame is BOU. RGB,max ; Among them, the BOU in frame 4 RGB Greater than frames 1, 2, 3, 5, 6, and 7;
[0117] Although frame 7 is BOU RGB,min However, the conditions for the last 3 frames are not met.
[0118] Next, determine the BOU in the 4th frame. RGB =0.93, satisfying: 0.9 < 0.93 < 0.938; and BOU RGB,3 =0.912>0.9 and BOU RGB,4 =0.913>0.9; therefore, the 4th frame is taken as the cut point for the gradient shot.
[0119] like Figure 6 This is an example of a valley-value cutoff point only;
[0120] First, the threshold frame λ = 11, and the 4th frame is BOU. RGB,min BOU in frame 4 RGB Less than frames 1, 2, 3, 5, 6, and 7;
[0121] Although frame 11 is BOU RGB,max However, the conditions for the last 3 frames are not met.
[0122] Next, determine the BOU in the 4th frame. RGB =0.84, satisfying: 0.84<0.9; take the 4th frame as the cut point for the gradient shot.
[0123] like Figure 7 Example of a peak and valley value cutoff point that simultaneously satisfies both peak and valley values;
[0124] First, the threshold frame λ = 12, and the first frame is BOU. RGB,max However, the conditions for the last 3 frames are not met.
[0125] Secondly, the 4th frame is BOU. RGB,min The conditions of the preceding and following three frames must be met;
[0126] Secondly, frame 8 is BOU. RGB,max The conditions of the preceding and following three frames must be met;
[0127] Next, determine the BOU in the 4th frame.RGB =0.87, satisfying: 0.87<0.9; with the 4th frame as the cut point for the gradient shot, there is no need to judge the 8th frame.
[0128] Step 73: Once the cutting point condition is met, take the next frame after the cutting point frame as the starting frame and perform the threshold frame judgment for the next cycle.
[0129] For example, in a 60-frame image with λ = 12, the first cycle judges frames 1-12. When the 4th frame is detected as the cut point, the next cycle is frames 5-16, and so on.
[0130] Since the similarity between different shots is low, the lower the similarity, the smaller the compression ratio, resulting in poor compression effect. However, this invention accurately finds the segmentation point (i.e., key frame) and compresses similar frames in the shot between the segmentation point, effectively improving compression performance.
[0131] Based on the above-described preferred embodiments of the present invention, and through the foregoing description, those skilled in the art can make various changes and modifications without departing from the inventive concept. The technical scope of this invention is not limited to the contents of the specification, but must be determined according to the scope of the claims.
Claims
1. A video shot segmentation method, characterized in that, Includes the following steps: Step 1: Capture video footage and perform frame-by-frame processing; Step 2: Crop the framed images; Step 3: Set up four corner sampling areas at the four corners of the cropped image, and randomly select several sampling points; Step 4: Set a first regular octagonal sampling edge with the same center point within the cropped image; set a second regular octagonal sampling edge with the same center point within the first regular octagonal sampling edge; set a first rectangular sampling area with the same center point within the second regular octagonal sampling edge; and randomly select several sampling points within the first and second regular octagonal sampling edges and the first rectangular sampling area. Step 5: Separate and weight the RGB values of all sampling points to obtain a weighted pixel vector, and calculate the pixel mean and pixel variance of the weighted pixel vector; Step 6: Calculate the pixel mean difference using the weighted pixel vectors and pixel mean values of all sampled points; Step 7: Calculate the RGB segmentation value using the pixel mean, pixel variance, and pixel mean difference; The formula for RGB segmentation values is: BOU R =[((2*R 1 ave,k *R 1 ave,k-1 )+δ1)*(2*R 1 MD,k +δ2)] / [(R 1 ave,k ^2 +R 1 ave,k-1 ^2 +δ1)*(R 1 var,k +R 1 var,k-1 +δ2)]; BOU G =[((2*G 1 ave,k *G 1 ave,k-1 )+δ1)*(2*G 1 MD,k +δ2)] / [(G 1 ave,k ^2 +G 1 ave,k-1 ^2 +δ1*(G 1 var,k +G 1 var,k-1 +δ2)]; BOU B =[((2*B 1 ave,k *B 1 ave,k-1 )+δ1)*(2*B 1 MD,k +δ2)] / [(B 1 ave,k ^2 +B 1 ave,k-1 ^2 +δ1)*(B 1 var,k +B 1 var,k-1 +δ2)]; BOU RGB =(BOU R +BOU G +BOU B ) / 3; Where δ1 and δ2 are the first and second correction coefficients, respectively; R 1 ave,k G 1 ave,k B 1 ave,k These are the mean values of R, G, and B pixels at the sampling point of the k-th frame, respectively; R 1 MD,k G 1 MD,k B 1 MD,k These represent the mean differences of R, G, and B pixels at the sampling point of the k-th frame; R 1 var,k G 1 var,k B 1 var,k Let R, G, and B be the pixel variances of the sampling point in the kth frame, respectively. Step 8: Determine whether a lens is a hard-cut or a graduated neutral density lens based on its RGB segmentation values; Gradient lenses include: When both the peak cut point and the valley cut point meet the conditions, or only the valley cut point meets the conditions, the valley cut point is used as the dividing point. When only the peak cut point meets the condition, the peak cut point is used as the dividing point; The peak cut-off point must meet the following conditions: When BOU RGB,λ >=ε3 and BOU RGB,max >BOU RGB,max+λj And BOU RGB,max >BOU RGB,max-λi At that time, determine if a peak cut-off point exists; And when ε4 <BOU RGB,max <ε5 and BOU RGB,max+1 >ε4 and BOU RGB,max-1 When >ε4, the peak frame BOU RGB,max The dividing point; Among them, ε3, ε4, and ε5 are the third, fourth, and fifth thresholds, respectively; BOU RGB,max-λi 、BOU RGB,max+λj BOU RGB,max The front λ i Frame and after λ j Frame; BOU RGB,max Peak frame; BOU RGB,λ BOU for consecutive threshold frames λ RGB ; The valley value cut-off point satisfies the following conditions: When BOU RGB,λ >=ε3 and BOU RGB,min <BOU RGB,min+λj And BOU RGB,min <BOU RGB,min-λi When a valley value cutting point exists, it is determined that one exists. And when ε3 <BOU RGB,min When <ε6, use the valley frame BOU RGB,min The dividing point; Where ε6 is the sixth threshold; BOU RGB,min-λi 、BOU RGB,min+λj BOU RGB,min The front λ i Frame and after λ j Frame; BOU RGB,min This is a valley frame.
2. The video shot segmentation method according to claim 1, characterized in that, Hard-cut shots include: When BOU RGB,k When <= ε1, the k-th frame is the cut point; ε1 is the first threshold, BOU RGB,k is the RGB segmentation value of the k-th frame.
3. The video shot segmentation method according to claim 1, characterized in that, Hard-cut shots also include: when ε1 <BOU RGB,k <= ε2 and BOU RGB,k-1 When ε > 3, the k-th frame is the cutting point, and ε2 and ε3 are the second and third thresholds, respectively.
4. The video shot segmentation method according to claim 1, characterized in that, The cropping is done using the same aspect ratio as the width and height.
5. A video shot segmentation system, characterized in that, include: Memory is used to store instructions that can be executed by the processor; A processor for executing instructions to implement the video shot segmentation method as described in any one of claims 1-4.
6. A computer-readable medium storing computer program code, characterized in that, The computer program code implements the video shot segmentation method as described in any one of claims 1-4 when executed by a processor.
Citation Information
Patent Citations
Shot segmentation method based on X264 compressed video
CN104869403A
Video scene recognition method and device, computer equipment and storage medium
CN114187558A