Video processing method and device based on frame difference, storage medium and electronic equipment

Through the video processing method based on frame difference, the video sequence is divided into multiple sub-segments and the sub-segments that meet the conditions are merged, which solves the problem of low coding efficiency in the existing technology and achieves more efficient video coding.

CN118803243APending Publication Date: 2024-10-18CHINA TELECOM CORP LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310403682.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-14
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

Existing video coding technology has a contradiction between compression rate and coding complexity, and cannot effectively distinguish different sub-segments in video images, resulting in low coding efficiency.

Method used

A video processing method based on frame difference is used to divide the video sequence into multiple sub-segments through a preset sliding window, filter each sub-segment, determine the motion smoothing sub-segment, and merge sub-segments that meet specific conditions to improve coding efficiency.

Benefits of technology

By distinguishing motion smooth sub-segments and non-smooth sub-segments in the video, more efficient encoding is achieved and the balance between compression rate and complexity of video encoding is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118803243A_ABST
    Figure CN118803243A_ABST
Patent Text Reader

Abstract

The invention provides a video processing method and device based on frame difference, a storage medium and electronic equipment, and relates to the technical field of signal coding in data communication. The method comprises the following steps: dividing video frame data in a video sequence into a plurality of sub-segments based on a preset sliding window, the preset sliding window being determined based on a frame difference; filtering each sub-segment, and determining a plurality of motion smooth sub-segments; and judging whether the pairwise motion smoothing sub-segments meet a preset first condition, and combining the pairwise motion smoothing sub-segments meeting the preset first condition. According to the method and the device, the motion smooth sub-segments in the video are distinguished through processing, the smooth sub-segments and the non-smooth sub-segments can be coded respectively, and the coding efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] With the rapid development of multimedia information processing and communication technology, IPTV, PDA, 3D movies, free viewpoint video and other diversified video services have been launched one after another, and video coding has shown broad development prospects in information processing and related fields. However, while network bandwidth and storage space are limited, people's requirements for video quality are constantly increasing, and the performance indicators of digital video, such as resolution, quality, frame rate, etc., are constantly improving, which puts forward new requirements for existing video coding standards.

[0003] In order to obtain a video coding method with low complexity, high quality and high compression rate, after the International Telecommunication Union ITU-T and the International Organization for Standardization ISO / IEC jointly launched the video compression standard H.264 / AVC in 2003, ISO / IEC and ITU-T jointly established the JCT-VC (Joint Collaborative Team on Video Coding) group in January 2010 and released the next-generation video coding technology proposal HEVC (High Efficiency Video Coding). The proposal pointed out that HEVC still uses the hybrid coding framework of H.264 / AVC and focuses on researching new coding technologies, aiming to solve the contradiction between compression rate and coding complexity in existing video coding standards, so that it can adapt to multi-type network transmission and carry more information processing services. Video coding standards and their application technologies with "real-time", "high compression rate" and "high definition" have become one of the research hotspots in the field of signal and information processing.

[0004] In terms of fast video coding, some researchers improve coding efficiency by controlling the number of motion estimation points at the expense of rate-distortion performance; some researchers improve coding efficiency by controlling coding parameters. However, the above methods do not distinguish between different sub-segments in the video image, use the same fast coding scheme for all coded content, and ignore the correlation between frames.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0006] The present disclosure provides a video processing method and device based on frame difference, a storage medium and an electronic device, which at least to a certain extent overcome the problem of using the same fast encoding for all encoded contents due to the limitations of the related art.

[0007] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0008] According to one aspect of the present disclosure, a video processing method based on frame difference is provided, comprising: dividing video frame data in a video sequence into multiple sub-segments based on a preset sliding window, wherein the preset sliding window is determined based on the frame difference; filtering each sub-segment to determine multiple motion smooth sub-segments; judging whether pairwise motion smooth sub-segments satisfy a preset first condition, and merging pairwise motion smooth sub-segments that satisfy the preset first condition.

[0009] In some embodiments, the preset sliding window is determined based on the frame difference, including: the preset sliding window is determined based on a combination of a first dynamic frame difference and a second dynamic frame difference.

[0010] In some embodiments, the dividing of the video frame data in the video sequence into multiple sub-segments based on a preset sliding window size includes: processing the video frame data in the video sequence with a first constrained frame to determine a first frame difference; if the first frame difference is greater than a first threshold, initializing the head frame and the tail frame of the sliding window; judging whether the next frame of the tail frame is the last frame; if the next frame of the tail frame is not the last frame, calculating the average of the frame differences between each frame in the sliding window and the first constrained frame; if the next frame of the tail frame satisfies a preset second condition, then determining that the head frame to the tail frame of the sliding window is a sub-segment, sliding the sliding window with a first dynamic frame difference, determining the sliding window after the sliding, and re-judging whether the next frame of the tail frame of the sliding window after the sliding is the last frame.

[0011] In some embodiments, the method further comprises: if the first frame difference is less than the first threshold, determining that the video sequence is a motion smooth subsegment.

[0012] In some embodiments, the method further includes: if the next frame of the tail frame is the last frame, determining that the next frame from the head frame to the tail frame of the sliding window is a subsegment.

[0013] In some embodiments, the method also includes: if the next frame of the tail frame does not meet a preset second condition, performing a second dynamic frame difference sliding on the sliding window, determining the sliding window after the sliding, and re-determining whether the next frame of the tail frame of the sliding window after the sliding is the last frame.

[0014] In some embodiments, if the next frame of the tail frame satisfies a preset second condition, it includes: if the absolute value of the difference between the frame difference between the next frame of the tail frame and the first constrained frame and the mean is greater than a second threshold, or the frame difference between the next frame of the tail frame and the second constrained frame is greater than a third threshold.

[0015] In some embodiments, the first dynamic frame difference includes: assigning the head frame of the sliding window a value equal to the tail frame plus one frame; and adding one frame to the value of the tail frame of the sliding window.

[0016] In some embodiments, the second dynamic frame difference comprises: adding one frame to the value of the tail frame of the sliding window.

[0017] In some embodiments, filtering each sub-segment to determine multiple smooth motion sub-segments includes: initializing each sub-segment status flag to a stable state; judging each sub-segment separately, and when the sub-segment meets a preset third condition, marking the sub-segment status as an unstable state; checking the unstable sub-segment, and if the preset fourth condition is met, the sub-segment status flag is a stable state, wherein the sub-segment status flag is a stable state for a smooth motion sub-segment.

[0018] In some embodiments, the preset third condition includes: the sub-segment length is less than a fourth threshold; the maximum frame difference between each frame in the sub-segment and the second constrained frame is greater than a fifth threshold; or the average frame difference between each frame in the sub-segment and the second constrained frame is greater than a sixth threshold.

[0019] In some embodiments, the preset fourth condition includes: a maximum value of a frame difference between each frame in the sub-segment and the second constrained frame is less than a seventh threshold.

[0020] In some embodiments, the preset first condition includes: the constraint frame of a motion smooth sub-segment is the same as the previous frame of the starting frame of another motion smooth sub-segment; or, the maximum value of the frame difference between the next frame of the constraint frame of a motion smooth sub-segment and the previous frame of the starting frame of another motion smooth sub-segment and the second constraint frame is less than an eighth threshold.

[0021] According to another aspect of the present disclosure, a video processing device based on frame difference is also provided, including: a sub-segment division module, used to divide the video frame data in the video sequence into multiple sub-segments based on a preset sliding window, wherein the preset sliding window is determined based on the frame difference; a sub-segment state division module, used to filter each sub-segment to determine multiple motion smooth sub-segments; a sub-segment merging module, used to determine whether each motion smooth sub-segment satisfies a preset first condition, and merge the motion smooth sub-segments that meet the preset first condition.

[0022] According to another aspect of the present disclosure, an electronic device is also provided, which includes: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned frame difference-based video processing methods by executing the executable instructions.

[0023] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the video processing method based on frame difference described above is implemented.

[0024] According to another aspect of the present disclosure, a computer program product is further provided, including a computer program, wherein when the computer program is executed by a processor, the computer program implements any one of the above-mentioned frame difference-based video processing methods.

[0025] The video processing method based on frame difference provided in the embodiment of the present disclosure divides the video frame data in the video sequence into multiple sub-segments based on a preset sliding window, wherein the preset sliding window is determined based on the frame difference; each sub-segment is filtered to determine multiple motion smooth sub-segments; it is determined whether the two motion smooth sub-segments meet the preset first condition, and the two motion smooth sub-segments that meet the preset first condition are merged. The present disclosure distinguishes the motion smooth sub-segments in the video by processing, and can encode the smooth sub-segments and non-smooth sub-segments separately, thereby improving the encoding efficiency.

[0026] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0028] Figure 1 A flowchart of a video processing method based on frame difference in an embodiment of the present disclosure is shown;

[0029] Figure 2 A flowchart showing a specific example of a video processing method based on frame difference in an embodiment of the present disclosure is shown;

[0030] Figure 3 A flowchart showing another specific example of a video processing method based on frame difference in an embodiment of the present disclosure;

[0031] Figure 4 A flowchart showing another specific example of a video processing method based on frame difference in an embodiment of the present disclosure;

[0032] Figure 5 A flowchart showing another specific example of a video processing method based on frame difference in an embodiment of the present disclosure;

[0033] Figure 6 A flowchart showing another specific example of a video processing method based on frame difference in an embodiment of the present disclosure;

[0034] Figure 7 A schematic diagram of a video processing device based on frame difference in an embodiment of the present disclosure is shown;

[0035] Figure 8 A flowchart showing a specific example of a video processing method based on frame difference in an embodiment of the present disclosure is shown;

[0036] Fig. 9 A flowchart showing a specific example of a video processing method based on frame difference in an embodiment of the present disclosure is shown;

[0037] Fig.10 A structural block diagram of a computer device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0038] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0039] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0040] The specific implementation of the embodiment of the present disclosure is described in detail below with reference to the accompanying drawings.

[0041] Figure 1 A flow chart of a video processing method based on frame difference in an embodiment of the present disclosure is shown as follows: Figure 1 As shown, the video processing method based on frame difference provided in the embodiment of the present disclosure includes the following steps:

[0042] S102, dividing the video frame data in the video sequence into a plurality of sub-segments based on a preset sliding window, wherein the preset sliding window is determined based on a frame difference.

[0043] It should be noted that the above sliding window may be a flow control technology for frame transmission. The sliding window in this embodiment is of a non-fixed size, and the initial sliding window size may be preset based on manual experience, and then the size of the sliding window may be dynamically adjusted based on the frame difference. The above video sequence may be a video stream, which is composed of video frame data. The above video frame data may be an image frame, i.e., the smallest unit constituting a video. It should be understood that the number of the above video frame data is not limited here. The above sub-segment may be a collection of partial video frame data generated after segmenting the above video sequence.

[0044] In a specific example, the preset sliding window is determined based on the frame difference, including: the preset sliding window is determined based on a combination of the first dynamic frame difference and the second dynamic frame difference.

[0045] Furthermore, in a specific example, the first dynamic frame difference includes: assigning a value of the head frame of the sliding window to the tail frame plus one frame; and adding one frame to the value of the tail frame of the sliding window.

[0046] Furthermore, in a specific example, the second dynamic frame difference includes: adding one frame to the value of the tail frame of the sliding window.

[0047] S104, filtering each sub-segment to determine a plurality of smooth motion sub-segments.

[0048] It should be noted that the above-mentioned motion smoothing sub-segment may be a collection of video frame data with higher inter-frame correlation in the video.

[0049] S106, judging whether the two motion smooth sub-segments satisfy a preset first condition, and merging the two motion smooth sub-segments that satisfy the preset first condition.

[0050] It should be noted that the two motion smoothing sub-segments may be two motion smoothing sub-segments. The merging may be connecting the two motion smoothing sub-segments together in a head-to-tail splicing manner.

[0051] In a specific example, the preset first condition includes: the constrained frame of a motion smoothing subsegment is the same as the previous frame of the start frame of another motion smoothing subsegment; or, the maximum value of the frame difference between the next frame of the constrained frame of a motion smoothing subsegment and the previous frame of the start frame of another motion smoothing subsegment and the second constrained frame is less than an eighth threshold. It should be noted that the second constrained frame may be a frame in the video frame data, and the number of bits of the second constrained frame is not limited here.

[0052] For example, the pairwise stable sub-segment S i : [K1, K2] and S i+1 : [M1, M2];

[0053] If any of the following formulas (equivalent to the above-mentioned first preset condition) is satisfied, that is, formula (1) or formula (2) is satisfied, the two stable sub-segments are merged into one:

[0054] K2=M1-1; (1)

[0055] Max(Diffs(3)[K2+1,M1-1]) <T6; (2)

[0056] Among them, S i represents a smooth motion sub-segment, K1 represents S i The starting frame of S i The end frame, S i+1 represents another motion smoothing sub-segment, M1 represents S i+1 The starting frame, M2 represents S i+1 The end frame of , Max represents the maximum value, and T6 represents the eighth threshold.

[0057] In specific implementation, the present disclosure utilizes different frame differences to determine different sub-segments in a video sequence, so that different sub-segments can adopt different encoding schemes, thereby improving encoding efficiency.

[0058] In one embodiment of the present disclosure, Figure 2 As shown, the video processing method based on frame difference provided in the embodiment of the present disclosure can divide the video frame data in the video sequence into multiple sub-segments through the following steps, and can dynamically adjust the sliding window:

[0059] S202: Process the video frame data in the video sequence and the first constraint frame to determine a first frame difference.

[0060] It should be noted that the first constrained frame may be a frame in the video frame data, for example, the first frame in the video frame data, or the second frame in the video frame data, etc. It should be understood that the number of bits of the first constrained frame is not limited here. The first frame difference may be a maximum frame difference, for example, the maximum frame difference between each frame in the video frame data and the first frame.

[0061] In a specific example, the maximum frame difference of Diffs(1) in the video sequence is determined, where Diffs(1) is used to represent the frame difference (difference value) between each frame and the first frame.

[0062] S204: If the first frame difference is greater than the first threshold, the head frame and the tail frame of the sliding window are initialized.

[0063] It should be noted that the head frame may be the first frame. The tail frame may be the last frame. The initialization may be to assign the variable to a default value, specifically, assigning the head frame to 0 and the tail frame to 0, for example, Head = Tail = 0, where Head is the head frame and Tail is the tail frame.

[0064] S206, determining whether the next frame of the tail frame is the last frame.

[0065] For example, determine whether Tail+1 is the last frame.

[0066] S208: If the next frame of the tail frame is not the last frame, calculate the average of the frame differences between each frame in the sliding window and the first constraint frame.

[0067] For example, the average AVG of all Diffs(1) in the current sub-segment W is calculated, that is, the average of the frame differences between all frames in the current sub-segment and the first frame is calculated.

[0068] S210, if the next frame of the tail frame meets the preset second condition, determine that the head frame to the tail frame of the sliding window is a sub-segment, and slide the sliding window with a first dynamic frame difference to determine the sliding window after sliding, and re-determine whether the next frame of the tail frame of the sliding window after sliding is the last frame.

[0069] If the Tail+1 frame meets the preset second condition, the sub-segment W is saved, and a new sub-segment Head=Tail=Tail+1 is started, and it is re-determined whether the next frame of the tail frame of the sliding window after sliding is the last frame.

[0070] For example, Tail after initialization is 0 (the 0th frame). If the Tail+1 frame (equivalent to the next frame of the 0th frame) meets the preset second condition, the sub-segment W is saved, and a new sub-segment Head=Tail=Tail+1 is started. At this time, Tail is 1 (the 1st frame), and it is re-determined whether the next frame of the tail frame of the sliding window after sliding (equivalent to the next frame of the 1st frame) is the last frame.

[0071] In a specific example, if the next frame of the tail frame satisfies the preset second condition, it includes: if the absolute value of the difference between the frame difference and the mean of the next frame of the tail frame and the first constraint frame is greater than the second threshold, or the frame difference between the next frame of the tail frame and the second constraint frame is greater than the third threshold.

[0072] For example, the preset second condition includes formula (3) and formula (4):

[0073] Abs(Diffs(1)[Tail+1]-AVG) > T1; (3)

[0074] Diffs(3)[Tail+1] > T2; (4)

[0075] Wherein, Abs represents the absolute value, Diffs(1)[i] represents the frame difference between the i-th frame and the 0-th frame, T1 represents the second threshold, Diffs(3)[i] represents the frame difference between the i-th frame and the i-3-th frame, T2 represents the third threshold, Abs(Diffs(1)[Tail+1]-AVG) represents the absolute value of the difference between the frame difference next to the tail frame and the 0-th frame (equivalent to the above-mentioned first constrained frame) and the mean, and Diffs(3)[Tail+1] represents the frame difference between the frame next to the tail frame and the i-3-th frame (equivalent to the above-mentioned second constrained frame).

[0076] In one embodiment of the present disclosure, Figure 3 As shown, the video processing method based on frame difference provided in the embodiment of the present disclosure can determine the entire sequence as a motion smoothing sub-segment through the following steps, and can quickly distinguish the motion smoothing sub-segments, so that the coding efficiency is improved:

[0077] S302: If the first frame difference is less than a first threshold, determine that the video sequence is a motion smoothing subsegment.

[0078] It should be noted that if the first frame difference is less than the first threshold, it means that the entire sequence (video sequence) is stable.

[0079] In one embodiment of the present disclosure, Figure 4 As shown, the video processing method based on frame difference provided in the embodiment of the present disclosure can determine whether the segmentation of the video sequence is completed through the following steps, and can ensure that the segmentation of the video sequence is completed:

[0080] S402: If the next frame of the tail frame is the last frame, determine that the frame from the head frame to the next frame of the tail frame of the sliding window is a subsegment.

[0081] For example, if the next frame of the tail frame is the last frame, save the sub-segment [Head, Tail+1] and end.

[0082] In one embodiment of the present disclosure, Figure 5 As shown, the video processing method based on frame difference provided in the embodiment of the present disclosure can determine the sliding window after sliding through the following steps, so as to ensure that all video sequences are segmented:

[0083] S502, if the next frame of the tail frame does not meet the preset second condition, slide the sliding window with a second dynamic frame difference, determine the sliding window after sliding, and re-determine whether the next frame of the tail frame of the sliding window after sliding is the last frame.

[0084] For example, if the next frame of the tail frame does not meet the preset second condition, the Tail+1 frame is considered to be included in W, and it is re-determined whether the next frame of the tail frame of the sliding window after sliding (Tail=Tail+1) is the last frame.

[0085] Figure 6 A flowchart of a specific example of a video processing method based on frame difference in an embodiment of the present disclosure is shown as follows: Figure 6 As shown, in the frame difference-based video processing method provided in the embodiment of the present disclosure, filtering each sub-segment and determining a plurality of motion smooth sub-segments further comprises the following steps:

[0086] S602, initializing each sub-segment status flag to a stable state.

[0087] For example, the status flag of each sub-segment is initialized to 1, where 1 indicates stability.

[0088] S604, judging each sub-segment respectively, and marking the sub-segment state as an unstable state when the sub-segment meets the preset third condition;

[0089] In a specific example, the preset third condition includes: the sub-segment length is less than the fourth threshold; the maximum frame difference between each frame in the sub-segment and the second constrained frame is greater than the fifth threshold; or the average frame difference between each frame in the sub-segment and the second constrained frame is greater than the sixth threshold.

[0090] For example, if each sub-segment satisfies any of the following formulas, that is, satisfies formula (5) or formula (6) or formula (7), the sub-segment status flag is set to 0, where 0 indicates instability:

[0091] Len(W j ) <N; (5)

[0092] Max(Diffs(3)(W j ))>T3; (6)

[0093] Mean(Diffs(3)(W j ))>T4; (7)

[0094] Among them, Len represents the length, W j represents the jth sub-segment, Diffs(3)(W j ) represents the frame difference between each frame of the j-th sub-segment and the i-3-th frame (the second constrained frame), Max represents the maximum value, Mean represents the mean, N represents the fourth threshold, T3 represents the fifth threshold, and T4 represents the sixth threshold.

[0095] S606, checking the sub-segment in the unstable state, if the preset fourth condition is met, the sub-segment state flag is a stable state, wherein the sub-segment state flag is a smooth motion sub-segment.

[0096] In a specific example, the preset fourth condition includes: a maximum value of a frame difference between each frame in the sub-segment and the second constrained frame is less than a seventh threshold.

[0097] For example, the fourth condition is preset to be the following formula (8):

[0098] Max(Diffs(3)(W j )) <T5; (8)

[0099] Wherein, T5 represents the seventh threshold.

[0100] The present invention divides the smooth sub-segments and non-smooth sub-segments of the video and encodes them separately, thereby improving the inter-frame encoding efficiency.

[0101] Based on the same inventive concept, the present disclosure also provides a video processing device based on frame difference, as described in the following embodiments. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.

[0102] Figure 7 A schematic diagram of a video processing device based on frame difference in an embodiment of the present disclosure is shown. Figure 7 As shown, the device includes: a sub-segment division module 71, a sub-segment state division module 72 and a sub-segment merging module 73.

[0103] The sub-segment division module 71 is used to divide the video frame data in the video sequence into a plurality of sub-segments based on a preset sliding window, wherein the preset sliding window is determined based on a frame difference.

[0104] The sub-segment state division module 72 is used to filter each sub-segment to determine a plurality of smooth motion sub-segments.

[0105] The sub-segment merging module 73 is used to determine whether each smooth motion sub-segment meets a preset first condition, and merge the smooth motion sub-segments that meet the preset first condition.

[0106] In one embodiment of the present disclosure, the preset sliding window in the sub-segment division module 71 is determined based on the frame difference and specifically includes: the preset sliding window is determined based on a combination of the first dynamic frame difference and the second dynamic frame difference.

[0107] In one embodiment of the present disclosure, the above-mentioned sub-segment division module 71 is specifically used to: process the video frame data in the video sequence and the first constraint frame to determine the first frame difference; if the first frame difference is greater than the first threshold, initialize the head frame and the tail frame of the sliding window; determine whether the next frame of the tail frame is the last frame; if the next frame of the tail frame is not the last frame, calculate the average of the frame differences between each frame in the sliding window and the first constraint frame; if the next frame of the tail frame meets the preset second condition, determine that the head frame to the tail frame of the sliding window is a sub-segment, and slide the sliding window with a first dynamic frame difference, determine the sliding window after the sliding, and re-determine whether the next frame of the tail frame of the sliding window after the sliding is the last frame.

[0108] In one embodiment of the present disclosure, the sub-segment division module 71 is further configured to: if the first frame difference is less than a first threshold, determine that the video sequence is a motion smooth sub-segment.

[0109] In one embodiment of the present disclosure, the sub-segment division module 71 is further used to: if the next frame of the tail frame is the last frame, determine that the next frame from the head frame to the tail frame of the sliding window is a sub-segment.

[0110] In one embodiment of the present disclosure, the above-mentioned sub-segment division module 71 is also used for: if the next frame of the tail frame does not meet the preset second condition, sliding the sliding window by a second dynamic frame difference, determining the sliding window after sliding, and re-determining whether the next frame of the tail frame of the sliding window after sliding is the last frame.

[0111] In one embodiment of the present disclosure, in the above-mentioned sub-segment division module 71, if the next frame of the tail frame meets the preset second condition, it includes: if the absolute value of the difference between the frame difference and the mean of the next frame of the tail frame and the first constraint frame is greater than the second threshold, or the frame difference between the next frame of the tail frame and the second constraint frame is greater than the third threshold.

[0112] In one embodiment of the present disclosure, the first dynamic frame difference in the above-mentioned sub-segment division module 71 includes: assigning the head frame of the sliding window to the tail frame plus one frame; and adding one frame to the value of the tail frame of the sliding window.

[0113] In one embodiment of the present disclosure, the second dynamic frame difference in the sub-segment division module 71 includes: adding one frame to the value of the tail frame of the sliding window.

[0114] In one embodiment of the present disclosure, the above-mentioned sub-segment state division module 72 is specifically used to: initialize each sub-segment state flag to a stable state; judge each sub-segment separately, and when the sub-segment meets the preset third condition, mark the sub-segment state as an unstable state; verify the sub-segment in the unstable state, and if the preset fourth condition is met, the sub-segment state flag is a stable state, wherein the sub-segment state flag is a stable state for a smooth motion sub-segment.

[0115] In one embodiment of the present disclosure, the third condition preset in the above-mentioned sub-segment status division module 72 includes: the sub-segment length is less than the fourth threshold; the maximum value of the frame difference between each frame in the sub-segment and the second constrained frame is greater than the fifth threshold; or the average value of the frame difference between each frame in the sub-segment and the second constrained frame is greater than the sixth threshold.

[0116] In one embodiment of the present disclosure, the fourth condition preset in the sub-segment state division module 72 includes: the maximum value of the frame difference between each frame in the sub-segment and the second constrained frame is less than a seventh threshold.

[0117] In one embodiment of the present disclosure, the first condition preset in the above-mentioned sub-segment division module 71 includes: the constraint frame of a motion smooth sub-segment is the same as the previous frame of the starting frame of another motion smooth sub-segment; or, the maximum value of the frame difference between the next frame of the constraint frame of a motion smooth sub-segment and the previous frame of the starting frame of another motion smooth sub-segment and the second constraint frame is less than the eighth threshold.

[0118] It should be noted that the above sub-segment division module 71, the sub-segment state division module 72 and the sub-segment merging module 73 correspond to S102 to S106 in the method embodiment, and the examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above method embodiment. It should be noted that the above modules as part of the device can be executed in a computer system such as a set of computer executable instructions.

[0119] Figure 8 A flowchart of a specific example of a video processing method based on frame difference in an embodiment of the present disclosure is shown as follows: Figure 8 As shown, the video processing method based on frame difference provided in the embodiment of the present disclosure includes the following steps:

[0120] S801. Determine whether the maximum frame difference of Diffs(1) in the video sequence is greater than a threshold T;

[0121] S802, if less than, the entire sequence is stable;

[0122] S803, if greater than, initialize sub-segments Head = 0, Tail = -1;

[0123] S804, Head = Tail + 1;

[0124] S805, Tail = Tail + 1;

[0125] S806, determine the sliding window W[Head, Tail]

[0126] S807, determining whether Tail+1 is the last frame;

[0127] S808, if yes, save the sub-segment [Head, Tail+1] and end;

[0128] S809, if not, calculate the average AVG of all Diffs(1) in the current sub-segment W;

[0129] S810, determining whether the Tail+1 frame satisfies any one of the above formulas (3) and (4);

[0130] S811, if satisfied, save the sub-segment W[Head, Tail] and return to S804;

[0131] S812: If not satisfied, it is considered that the Tail+1 frame is included in W, and the process returns to S805.

[0132] It should be noted that the above steps can be executed by a sub-segment division module.

[0133] Fig. 9 A flowchart of a specific example of a video processing method based on frame difference in an embodiment of the present disclosure is shown as follows: Fig. 9 As shown, the video processing method based on frame difference provided in the embodiment of the present disclosure includes the following steps:

[0134] S901, initializing the status flag of each sub-segment to 1 (Flag[j]=1), where 1 indicates stable and 0 indicates unstable;

[0135] S902, if each sub-segment satisfies any of the above formulas (5), (6) or (7), the sub-segment status flag is set to 0 (Flag[j]=0);

[0136] S903, checking the sub-segment determined to be unstable, and if it satisfies the above formula (8), setting the sub-segment status flag to 1 (Flag[j]=1);

[0137] S904, two-by-two stable sub-segment S i : [K1, K2] and S i+1 : [M1, M2] If any of the above formulas (1) or (2) is satisfied, the two stable sub-segments are merged into one.

[0138] It should be noted that the above S901-S903 can be executed by a sub-segment status division module, and the above S904 can be executed by a sub-segment merging module.

[0139] The present disclosure can be combined with existing standard encoders and collaborated with deep learning-based artificial intelligence models to achieve higher encoding performance; as a preprocessing module, the present disclosure has the advantages of plug-and-play, low complexity and strong versatility.

[0140] In a specific example, the video processing method based on frame difference is combined with a sub-segment division module, a sub-segment state division module, and a sub-segment merging module. The video is pre-processed, and the video is divided into multiple sub-segments by a sliding window method combining a long frame difference (equivalent to the first dynamic frame difference) and a short frame difference (equivalent to the second dynamic frame difference), and the sub-segments are filtered to obtain a motion smooth sub-segment and other sub-segments, and the motion smooth sub-segments are further merged.

[0141] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".

[0142] Refer to the following Fig.10 The electronic device 1000 according to this embodiment of the present disclosure is described. Fig.10 The electronic device 1000 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0143] like Fig.10 As shown, the electronic device 1000 is in the form of a general computing device. The components of the electronic device 1000 may include but are not limited to: the at least one processing unit 1010, the at least one storage unit 1020, and a bus 1030 connecting different system components (including the storage unit 1020 and the processing unit 1010).

[0144] The storage unit stores program codes, which can be executed by the processing unit 1010, so that the processing unit 1010 executes the steps described in the above “exemplary method” section of this specification according to various exemplary embodiments of the present disclosure.

[0145] For example, the processing unit 1010 can execute the following steps of the above-mentioned method embodiment: based on a preset sliding window, divide the video frame data in the video sequence into multiple sub-segments, wherein the preset sliding window is determined based on the frame difference; filter each sub-segment to determine multiple motion smooth sub-segments; determine whether the pairwise motion smooth sub-segments meet the preset first condition, and merge the pairwise motion smooth sub-segments that meet the preset first condition.

[0146] In a specific example, the processing unit 1010 performs the method embodiment described above to determine the preset sliding window based on the frame difference, including: the preset sliding window is determined based on a combination of the first dynamic frame difference and the second dynamic frame difference.

[0147] In a specific example, the processing unit 1010 executes the method embodiment described above based on a preset sliding window size to divide the video frame data in the video sequence into multiple sub-segments, including: processing the video frame data in the video sequence with the first constraint frame to determine a first frame difference; if the first frame difference is greater than a first threshold, initializing the head frame and the tail frame of the sliding window; determining whether the next frame of the tail frame is the last frame; if the next frame of the tail frame is not the last frame, calculating the average of the frame differences between each frame in the sliding window and the first constraint frame; if the next frame of the tail frame satisfies a preset second condition, determining that the head frame to the tail frame of the sliding window is a sub-segment, sliding the sliding window with a first dynamic frame difference, determining the sliding window after the sliding, and re-determining whether the next frame of the tail frame of the sliding window after the sliding is the last frame.

[0148] For example, the processing unit 1010 may further perform the following steps of the above method embodiment: if the first frame difference is less than a first threshold, determining that the video sequence is a motion smooth subsegment.

[0149] For example, the processing unit 1010 may further perform the following steps of the above method embodiment: if the next frame of the tail frame is the last frame, determine that the next frame from the head frame to the tail frame of the sliding window is a subsegment.

[0150] For example, the processing unit 1010 can also execute the following steps of the above method embodiment: if the next frame of the tail frame does not meet the preset second condition, slide the sliding window with a second dynamic frame difference, determine the sliding window after sliding, and re-determine whether the next frame of the tail frame of the sliding window after sliding is the last frame.

[0151] In a specific example, the processing unit 1010 executes the above method embodiment if the next frame of the tail frame satisfies the preset second condition including: if the absolute value of the difference between the frame difference and the mean of the next frame of the tail frame and the first constraint frame is greater than the second threshold, or the frame difference between the next frame of the tail frame and the second constraint frame is greater than the third threshold.

[0152] In a specific example, the processing unit 1010 executes the first dynamic frame difference of the above method embodiment, including: assigning the head frame of the sliding window to the tail frame plus one frame; adding one frame to the value of the tail frame of the sliding window.

[0153] In a specific example, the processing unit 1010 executes the second dynamic frame difference of the above method embodiment, including: adding one frame to the value of the tail frame of the sliding window.

[0154] In a specific example, the processing unit 1010 performs the filtering of each sub-segment in the above method embodiment to determine multiple smooth motion sub-segments, including: initializing each sub-segment status flag to a stable state; judging each sub-segment separately, and when the sub-segment meets the preset third condition, marking the sub-segment status as an unstable state; checking the unstable sub-segment, and if the preset fourth condition is met, the sub-segment status flag is a stable state, wherein the sub-segment status flag is a stable state for a smooth motion sub-segment.

[0155] In a specific example, the preset third condition for the processing unit 1010 to execute the above method embodiment includes: the sub-segment length is less than the fourth threshold; the maximum frame difference between each frame in the sub-segment and the second constrained frame is greater than the fifth threshold; or the average frame difference between each frame in the sub-segment and the second constrained frame is greater than the sixth threshold.

[0156] In a specific example, the fourth preset condition for the processing unit 1010 to execute the above method embodiment includes: the maximum value of the frame difference between each frame in the sub-segment and the second constrained frame is less than a seventh threshold.

[0157] In a specific example, the preset first condition for the processing unit 1010 to execute the above method embodiment includes: the constraint frame of a motion smooth sub-segment is the same as the previous frame of the starting frame of another motion smooth sub-segment; or, the maximum value of the frame difference between the next frame of the constraint frame of a motion smooth sub-segment and the previous frame of the starting frame of another motion smooth sub-segment and the second constraint frame is less than an eighth threshold.

[0158] The storage unit 1020 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 10201 and / or a cache storage unit 10202 , and may further include a read-only storage unit (ROM) 10203 .

[0159] The storage unit 1020 may also include a program / utility 10204 having a set (at least one) of program modules 10205, such program modules 10205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0160] Bus 1030 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0161] The electronic device 1000 may also communicate with one or more external devices 1040 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1000, and / or communicate with any device that enables the electronic device 1000 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1050. Furthermore, the electronic device 1000 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 1060. As shown, the network adapter 1060 communicates with other modules of the electronic device 1000 via a bus 1030. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0162] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0163] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart may be implemented as a computer program product, which includes: a computer program, which implements the above-mentioned video processing method based on frame difference when executed by a processor.

[0164] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. A program product capable of implementing the above method of the present disclosure is stored thereon. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above “Exemplary Method” section of this specification.

[0165] More specific examples of computer-readable storage media in the present disclosure may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0166] In the present disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0167] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0168] In a specific implementation, the program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0169] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0170] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0171] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0172] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.

Claims

1. A video processing method based on frame difference, characterized in that: include: Based on a preset sliding window, dividing the video frame data in the video sequence into a plurality of sub-segments, wherein the preset sliding window is determined based on a frame difference; Filter each sub-segment to determine a plurality of motion smooth sub-segments; It is determined whether the two smooth motion sub-segments satisfy a preset first condition, and the two smooth motion sub-segments satisfying the preset first condition are merged.

2. The video processing method based on frame difference according to claim 1, characterized in that: The preset sliding window is determined based on the frame difference and includes: The preset sliding window is determined based on a combination of the first dynamic frame difference and the second dynamic frame difference.

3. The video processing method based on frame difference according to claim 1, characterized in that: The step of dividing the video frame data in the video sequence into a plurality of sub-segments based on a preset sliding window size includes: Processing the video frame data in the video sequence with the first constrained frame to determine a first frame difference; If the first frame difference is greater than a first threshold, initializing the head frame and the tail frame of the sliding window; Determine whether the next frame of the tail frame is the last frame; If the next frame of the tail frame is not the last frame, calculating the average of the frame differences between each frame in the sliding window and the first constrained frame; If the next frame of the tail frame meets the preset second condition, it is determined that the head frame to the tail frame of the sliding window is a sub-segment, and the sliding window is slid as a first dynamic frame difference, the sliding window after the sliding is determined, and it is re-determined whether the next frame of the tail frame of the sliding window after the sliding is the last frame.

4. The video processing method based on frame difference according to claim 3, characterized in that: The method further comprises: If the first frame difference is less than the first threshold, it is determined that the video sequence is a motion smooth subsegment.

5. The video processing method based on frame difference according to claim 3, characterized in that: The method further comprises: If the next frame of the tail frame is the last frame, it is determined that the next frame from the head frame to the tail frame of the sliding window is a subsegment.

6. The video processing method based on frame difference according to claim 3, characterized in that: The method further comprises: If the next frame of the tail frame does not meet the preset second condition, the sliding window is slid by a second dynamic frame difference, the sliding window after sliding is determined, and it is re-determined whether the next frame of the tail frame of the sliding window after sliding is the last frame.

7. The video processing method based on frame difference according to claim 3, characterized in that: If the next frame of the tail frame meets the preset second condition, it includes: If the absolute value of the difference between the frame difference of the next frame of the tail frame and the first constrained frame and the mean value is greater than the second threshold, or the frame difference of the next frame of the tail frame and the second constrained frame is greater than the third threshold.

8. The video processing method based on frame difference according to any one of claims 2 to 7, characterized in that: The first dynamic frame difference comprises: Assigning the head frame of the sliding window to the tail frame plus one frame; The value of the tail frame of the sliding window is increased by one frame.

9. The video processing method based on frame difference according to claim 2 or 6, characterized in that: The second dynamic frame difference comprises: The value of the tail frame of the sliding window is increased by one frame.

10. The video processing method based on frame difference according to claim 1, characterized in that: The filtering of each sub-segment to determine a plurality of motion smooth sub-segments comprises: Initialize each sub-segment status flag to a stable state; Each sub-segment is judged separately, and when the sub-segment meets the preset third condition, the state of the sub-segment is marked as an unstable state; The sub-segment in the unstable state is checked, and if the preset fourth condition is met, the sub-segment state flag is a stable state, wherein the sub-segment state flag is a stable state and is a smooth motion sub-segment.

11. The video processing method based on frame difference according to claim 10, characterized in that: The preset third condition includes: The sub-segment length is less than a fourth threshold; The maximum value of the frame difference between each frame in the sub-segment and the second constrained frame is greater than a fifth threshold; or, An average value of frame differences between each frame in the sub-segment and the second constrained frame is greater than a sixth threshold.

12. The video processing method based on frame difference according to claim 10, characterized in that: The preset fourth condition includes: The maximum value of the frame difference between each frame in the sub-segment and the second constrained frame is less than a seventh threshold.

13. The video processing method based on frame difference according to claim 1, characterized in that: The preset first condition includes: The constraint frame of a smooth motion sub-segment is the same as the previous frame of the start frame of another smooth motion sub-segment; or, The maximum values ​​of the frame differences between the next frame of the constrained frame of a motion smoothing subsegment and the previous frame of the start frame of another motion smoothing subsegment and the second constrained frame are respectively smaller than an eighth threshold.

14. A video processing device based on frame difference, characterized in that: include: A sub-segment division module, used to divide the video frame data in the video sequence into a plurality of sub-segments based on a preset sliding window, wherein the preset sliding window is determined based on a frame difference; A sub-segment state division module is used to filter each sub-segment and determine a plurality of motion smooth sub-segments; The sub-segment merging module is used to determine whether each smooth motion sub-segment meets a preset first condition, and merge the smooth motion sub-segments that meet the preset first condition.

15. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the frame difference-based video processing method according to any one of claims 1 to 13 by executing the executable instructions.

16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the frame difference-based video processing method according to any one of claims 1 to 13 is implemented.

Citation Information

Cited By

  • Industrial scene adaptive continuous learning foreign matter detection method

    CN120931900A