A method for compressing and playing security monitoring video

By setting thresholds and performing image differences to calculate similarity, differentiated storage of security monitoring videos is solved, and the problem of wasted video storage space in the prior art is achieved and more efficient storage and playback is achieved.

CN115396673BActive Publication Date: 2025-02-28SOUTHEAST UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211039437.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-29
Publication Date
2025-02-28
Estimated Expiration
2042-08-29

AI Technical Summary

Technical Problem

The existing security surveillance video storage technology encodes and stores each video without distinction, resulting in large amounts of data and wasted storage space, especially when the scene does not change for a long time.

Method used

By setting the block distance threshold and the European-style distance threshold, the image difference method is used to calculate the similarity of the video frames, which is divided into three situations: extremely small changes, small changes and large changes, and marking and storage processing are performed separately to reduce the storage of smaller changes.

Benefits of technology

Effectively save storage space, reduce waste caused by undifferentiated storage, and ensure accurate storage of video content under large changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The present invention discloses a method for compressing and playing security surveillance videos. The method utilizes the characteristic that surveillance scenes generally remain unchanged for a long time. By calculating the distance between the two frames of images, the image frames with little change in the time period are periodically discarded, and the image frames with large changes are stored using a conventional video compression method. When the video is played, the linear difference image generation method or the conventional video decompression method is used to play according to different marks. In the method, the threshold judgment method is used to compress the video whose image has not changed for a long time, which greatly reduces the space required for monitoring video storage and saves storage resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of video processing, and in particular relates to a method for compressing and playing a security monitoring video. Background Art

[0002] Security monitoring is crucial to a good social order, the property and life safety of the country and the people. Security monitoring videos often have scenes that remain unchanged for a long time. Existing monitoring storage technologies often encode and store each frame of monitoring video indiscriminately, without processing methods for different situations. Since real-time monitoring takes a long time, the amount of data is large and the storage space consumed is large. In scene monitoring, scenes often remain unchanged for a long time. Such indiscriminate storage will result in a large amount of data and waste of storage space.

[0003] Therefore, to achieve longer-term storage of monitoring scene information, better monitoring video processing and storage methods are needed. Summary of the invention

[0004] In order to solve the above problems, the present invention discloses a method for compressing and playing security monitoring videos, which can save storage space and ensure that the video content can still be accurately stored when the video content changes greatly.

[0005] To achieve the above object, the technical solution of the present invention is as follows:

[0006] A method for compressing and playing a security monitoring video, the method comprising the following steps:

[0007] S1 first compresses the image and sets the block distance thresholds S1 and S2 (Euclidean distance thresholds E1 and E2);

[0008] S2 takes an image frame from the video, and uses the image difference method to calculate the street distance S0 (Euclidean distance E0) between the image frame and the last image frame;

[0009] S3 determines the similarity between the two frames of images and compares the street distance S0 calculated in the previous step with S1 and S2 (comparing the Euclidean distance E0 with E1 and E2). There are three options:

[0010] (1) If the calculated S0 is less than or equal to S1 (if the calculated E0 is less than E1), it is considered that the change between the two frames is very small, and the frame is marked as $BEGIN_STATIC. If the subsequent calculations do not exceed the threshold, the subsequent frames are marked as $INTER_STATIC, and a frame is taken at t0 (t0 is recommended to be 10 minutes) and stored in jpg format. If the subsequent calculated value does not belong to this situation, return to step S3 and make a new judgment;

[0011] (2) If the calculated S0 is greater than S1 but less than or equal to S2 (if the calculated E0 is greater than E1 but less than E2), it is considered that the change between the previous and next two frames is small, and the frame is still marked as $BEGIN_STATIC. If the subsequent calculated value S0 (E0) is also between S1 (E1) and S2 (E2), the subsequent frames are marked as $INTER_STATIC, and t1 (t1 is recommended to be 3 minutes) is taken to store a frame in jpg format. If the subsequent calculated value does not belong to this situation, return to step S3 and make a new judgment;

[0012] (3) If the calculated S0 is greater than S2 (if the calculated E0 is greater than E2), it is considered that the image changes between the previous and next two frames are large, and the frame is marked as $BEGIN_DYNAMIC, and the subsequent frames are marked as $INTER_DYNAMIC. If the calculated S0 (E0) is also greater than S2 (E2), the video is encoded normally in a motion scene. If the calculated value does not belong to this situation, return to step S3 and make a new judgment;

[0013] After S4 encoding stores the entire video, the video needs to be played later. Static jpg-encoded images use linear interpolation to generate images at each time, while dynamic images are played using conventional encoding methods.

[0014] Furthermore, in step S1, the block distance threshold S1 is set to 1, and S2 is set to 3 (the Euclidean distance threshold E1 is set to 2 and E2 is set to 6).

[0015] Furthermore, in step S2, it is assumed that the number of pixels in the previous and next frames is n, and the RGB three-channel values ​​of the i-th pixel corresponding to the same position in the previous and next frames are (rli, gli, bli), (r2i, g2i, b2i), respectively. The street distance calculation value is The Euclidean distance is calculated as You can choose either of the two distances.

[0016] Furthermore, the difference between two frames of images can also be calculated by dividing the image blocks. Each frame of the image is divided into M×N blocks, and each sub-block is calculated according to the methods in the above two paragraphs. Assuming that Dmax is the maximum value of the difference between the previous and next frames of images of all sub-blocks, the difference between the previous and next frames of images is set to Dmax. Among them, the values ​​of M and N can generally be 3-5.

[0017] The present invention compares the similarity between the two frames before and after the video by means of a threshold limiting method, divides the similarity between the two frames before and after the video into three intervals, stores the video frames with larger changes normally, and discards the video frames with smaller changes, thereby reducing the amount of stored data and reducing the waste of storage space. In the video playback link, if it is a static jpg encoding format image, a linear interpolation method is used to generate an image at each time, and a dynamic image is played using a conventional encoding method to restore the video to its original time length.

[0018] The beneficial effects of the present invention are:

[0019] The security monitoring video compression and playback method described in the present invention uses a threshold judgment method to compress videos whose images have not changed for a long time, which can save storage space and ensure that the video content can still be accurately stored when it changes significantly. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION

[0021] The present invention will be further explained below in conjunction with the accompanying drawings and specific implementations. It should be understood that the following specific implementations are only used to illustrate the present invention and are not used to limit the scope of the present invention.

[0022] As shown in the figure, a method for compressing and playing a security monitoring video according to the present invention comprises the following steps:

[0023] S1 first compresses the image and sets the block distance thresholds S1 and S2 (Euclidean distance thresholds E1 and E2).

[0024] Specifically, the threshold is determined in order to divide the degree of difference between two frames.

[0025] S2 takes an image frame from the video, and uses an image difference method to calculate the street block distance S0 (Euclidean distance E0) between the image frame and the image frame taken last time.

[0026] Specifically, if the number of pixels in the previous and next frames is n, and the RGB three-channel values ​​of the i-th pixel corresponding to the same position in the previous and next frames are (rli, gli, bli), (r2i, g2i, b2i), the street distance calculation value is The Euclidean distance is calculated as In the calculation, one of the two distances can be selected. In the calculation, one of the block distance and the Euclidean distance can be selected, and in the subsequent process, the same calculation method is always used to compare with the corresponding threshold.

[0027] To calculate the difference between two frames of images, you can also use the method of dividing the image blocks. Divide each frame of the image into M×N blocks, and calculate each sub-block according to the previous method. Assuming that Dmax is the maximum value of the difference between the previous and next frames of images of all sub-blocks, the difference between the previous and next frames of images is set to Dmax. Among them, the values ​​of M and N can generally be 3-5.

[0028] S3 determines the similarity between the two frames of images, and compares the street distance S0 calculated in the previous step with S1 and S2 (comparing the Euclidean distance E0 with E1 and E2). The subsequent steps are discussed in three different cases.

[0029] (1) If the calculated S0 is less than or equal to S1 (if the calculated E0 is less than E1), it is considered that the change between the two frames is very small, and the frame is marked as $BEGIN_STATIC. If the subsequent calculations do not exceed the threshold, the subsequent frames are marked as $INTER_STATIC, and a frame is taken at t0 (t0 is recommended to be 10 minutes) and stored in jpg format. If the subsequent calculated value does not belong to this situation, return to step S3 and make a new judgment.

[0030] (2) If the calculated S0 is greater than S1 but less than or equal to S2 (if the calculated E0 is greater than E1 but less than E2), it is considered that the change between the two frames is small, and the frame is still marked as $BEGIN_STATIC. If the subsequent calculated value S0 (E0) is also between S1 (E1) and S2 (E2), the subsequent frames are marked as $INTER_STATIC, and t1 (t1 is recommended to be 3 minutes) is taken to store a frame in jpg format. If the subsequent calculated value does not belong to this situation, return to step S3 and make a new judgment.

[0031] (3) If the calculated S0 is greater than S2 (if the calculated E0 is greater than E2), it is considered that the image changes between the previous and next frames are large, and the frame is marked as $BEGIN_DYNAMIC, and the subsequent frames are marked as $INTER_DYNAMIC. If the calculated S0 (E0) is also greater than S2 (E2), the video is encoded normally in a motion scene. If the calculated value does not belong to this situation, return to step S3 and make a new judgment.

[0032] After S4 encoding stores the entire video, the video needs to be played later. Static jpg-encoded images use linear interpolation to generate images at each time, while dynamic images are played using conventional encoding methods.

[0033] Specifically, different playback modes need to be selected according to frame markers during playback so that the length of the compressed video can be restored to the original length of the video.

[0034] It should be noted that the above content only illustrates the technical idea of ​​the present invention and cannot be used to limit the protection scope of the present invention. For ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications all fall within the protection scope of the claims of the present invention.

Claims

1. A method for compressing and playing security surveillance video, characterized in that: The following steps are involved: S1 compresses the image, chooses to use the block distance or the Euclidean distance, sets the block distance thresholds S1 and S2 or the Euclidean distance thresholds E1 and E2, and in this step and subsequent steps, when calculating and comparing, either the block distance or the Euclidean distance can be used; S2 takes an image frame from the video, and uses an image difference method to calculate the block distance S0 or the Euclidean distance E0 between the image frame and the last image frame; Assume that the number of pixels in the previous and next frames is n, and the RGB three-channel values ​​of the i-th pixel corresponding to the same position in the previous and next frames are (r1i, g1i, b1i), (r2i, g2i, b2i), respectively. The calculated value of the street distance is The Euclidean distance is calculated as S3 determines the similarity between the two frames of images by comparing the block distance S0 calculated in the previous step with S1, S2 or by comparing the Euclidean distance E0 with E1, E2; S4 is divided into three cases according to the comparison results, marked and coded and stored in different ways; The three different situations are handled as follows: (1) If the calculated S0 is less than or equal to S1 or if the calculated E0 is less than E1, the frame is marked as $BEGIN_STATIC. If the subsequent calculations do not exceed the threshold, the subsequent frames are marked as $INTER_STATIC, and every t0, t0 is 10 minutes, and a frame is taken and stored in jpg format; if the subsequent calculated value does not belong to this situation, return to step S3 and make a new judgment; (2) If the calculated S0 is greater than S1 but less than or equal to S2, or if the calculated E0 is greater than E1 but less than E2, the frame is still marked as $BEGIN_STATIC. If the calculated value S0 is also between S1 and S2, or if the calculated value E0 is also between E1 and E2, the subsequent frames are marked as $INTER_STATIC, and t1, a frame is taken to be stored in jpg format, and t1 is taken as 3 minutes; if the calculated value does not belong to this situation, return to step S3 and make a new judgment; (3) If the calculated S0 is greater than S2 or if the calculated E0 is greater than E1 but less than E2, the frame is marked as $BEGIN_DYNAMIC, and the subsequent frames are marked as $INTER_DYNAMIC. If the subsequently calculated S0 is also greater than S2 or if the subsequently calculated E0 is also greater than E2, the video is encoded normally in a motion scene; if the subsequent calculated value does not belong to this situation, return to step S3 and make a new judgment; After S5 encoding stores the entire video, the video needs to be played. The jpg encoding format image of the static mark uses linear interpolation to generate the image at each time, and the dynamic mark uses conventional encoding method for playback.

2. The method for compressing and playing security surveillance video according to claim 1, characterized in that: In step S1, the block distance threshold S1 is set to 1, and S2 is set to 3; or it is recommended that the Euclidean distance threshold E1 is set to 2, and E2 is set to 6.

3. The method for compressing and playing security surveillance video according to claim 1, characterized in that: The step S2 calculates the difference between two frames of images by dividing the image blocks. Each frame of the image is divided into M×N blocks, and calculation is performed on each sub-block. Assuming that Dmax is the maximum value of the difference between the two frames of images before and after all sub-blocks, the difference between the two frames of images before and after is set to Dmax; wherein the values ​​of M and N are 3-5.

Citation Information

Patent Citations

  • Scene analysis algorithm applied in network video monitoring system

    CN104967848A

  • Video storage method and device

    CN106937090A