Employee office monitoring video acquisition and storage method and system
By dividing coding tree units in employee office videos and assigning importance weights to different areas, the problem of low video compression quality caused by treating all movements as having the same importance in the existing technology is solved, achieving more efficient video compression and storage.
Patent Information
- Application Number
- CN202411223118.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-09-03
AI Technical Summary
Existing video coding technology treats all movements as having the same importance in employee office scenarios, causing unimportant movements to be mistakenly given too high a weight, affecting the compression quality of the video.
By dividing the video frame to be processed into coding tree units and determining the employee information inclusion ratio in each coding unit, giving different areas different importance weights, the movement of employees can be processed more accurately during motion estimation and compressed storage. area.
The compression quality of the video is improved to ensure the accurate capture and storage of important employee actions while reducing the priority of processing unimportant areas.
Smart Images

Figure CN118764651A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image communication, and in particular to a method and system for collecting and storing employee office monitoring videos in the technical field of image communication. Background Art
[0002] With the continuous improvement of enterprise informatization and intelligence, employee office behavior management has become an increasingly important part of enterprise management. Real-time monitoring and video storage of employee office behavior through video surveillance systems can help enterprises regulate employee behavior, improve work efficiency, and protect corporate assets and information security.
[0003] With the development of video acquisition equipment and display equipment, how to transmit high-quality video (video coding) as much as possible under limited transmission bandwidth has become a hot research direction. The current video coding technology is basically aimed at all application scenarios, such as High Efficiency Video Coding (HEVC). The core technology of HEVC coding includes intra-frame prediction and inter-frame prediction. Inter-frame prediction uses the correlation in the time domain of the video sequence to predict the content of the current video frame by referring to the previously encoded frame. Inter-frame prediction mainly includes two processes: motion estimation (ME) and motion compensation (MC). Among them, motion estimation is to find the best matching block of the current block in the reference frame. In the daily office process, the movement of employees' desk sundries such as water cups is unimportant, while the movement of employees' body movements is more important. The relevant technology regards the importance of all movements as the same, so directly using the motion estimation method in the relevant technology will cause unimportant movements to be mistakenly given too high a weight, which will lead to inaccurate calculation of the best matching block, thereby affecting the compression quality of the video. Summary of the invention
[0004] In order to solve the technical problem of low compression quality of employee office videos, the purpose of the present invention is to provide a method and system for collecting and storing employee office monitoring videos. The technical solutions adopted are as follows: In a first aspect, an embodiment of the present invention provides a method for collecting and storing employee office monitoring videos, the method comprising: Get employees’ office videos; Determine a coding tree unit in a to-be-processed video frame of the office video; wherein the coding tree unit comprises: a plurality of coding units; In each of the plurality of encoding units, determining an employee information inclusion ratio; Determining the importance weights of different regions in each coding unit based on the employee information inclusion ratio; Based on the importance weight, the office video is compressed and stored.
[0005] In combination with the first aspect, in some possible implementations, the method further includes: Dividing the to-be-processed video frame into a plurality of coding tree units; Each of the plurality of coding tree units is divided into a plurality of coding units according to a preset number.
[0006] In the above manner, by dividing the to-be-processed video frame into coding tree units, and then dividing the coding tree units into a plurality of coding units, it is convenient to subsequently identify each coding unit, so as to improve the accuracy of identifying the coding units.
[0007] In combination with the first aspect, in some possible implementations, determining the employee information inclusion ratio in each of the plurality of encoding units includes: For any coding unit of the to-be-processed video frame, searching for a target coding unit similar to the any coding unit in a plurality of historical continuous video frames of the to-be-processed video frame; The employee information inclusion ratio is determined based on the positional relationship between the target encoding unit and any one of the encoding units.
[0008] In the above manner, by analyzing the target coding units similar to any coding unit and the positional relationship between any coding units, the proportion of employee information included in any coding unit, ie, the employee information inclusion ratio, can be accurately identified.
[0009] In combination with the first aspect, in some possible implementations, searching, for any coding unit of the to-be-processed video frame, a target coding unit similar to the any coding unit in multiple historical continuous video frames of the to-be-processed video frame includes: Respectively determining a first pixel mean value of any coding unit of the to-be-processed video frame and a second pixel mean value of any coding unit of any historical continuous video frame; Respectively determining the gradient feature similarity between any coding unit of the to-be-processed video frame and any coding unit of the historical continuous video frame; Determine, based on the first pixel mean and the second pixel mean, a pixel mean difference between any coding unit of the to-be-processed video frame and any coding unit of the historical continuous video frame; Determining the similarity between any coding unit of the to-be-processed video frame and any coding unit of the historical continuous video frame based on the pixel mean difference and the gradient feature similarity; If the similarity satisfies a preset similarity threshold, the coding unit of any one of the historical continuous video frames is determined as the target coding unit.
[0010] In the above method, by analyzing the gradient feature similarity between the coding units in the video frame to be processed and the historical continuous video frames, combined with the pixel mean difference, the similarity between any coding unit of the video frame to be processed and any coding unit of the historical continuous video frames is calculated, and then the target coding unit with a high similarity to any coding unit can be found more accurately.
[0011] In combination with the first aspect, in some possible implementations, determining the employee information inclusion ratio based on the positional relationship between the target encoding unit and any encoding unit includes: Respectively determine a first number of target coding tree units to which the center coordinates of any coding unit are distributed, and a second number of other coding tree units to which the center coordinates of any coding unit are distributed; wherein the other coding tree units are coding tree units before the target coding tree unit among the multiple coding tree units corresponding to the to-be-processed video frame; Determine a moving range of any one of the encoding units based on the second number, the center coordinates of any one of the encoding units, and the center coordinates of the target encoding unit; The employee information inclusion ratio is determined based on the first number and the moving range.
[0012] In the above method, the proportion of employee information included in each coding unit can be accurately identified through the movement of pixels in each CU in the video frame to be processed in the historical video frame, thereby improving the accuracy of calculating the employee information inclusion ratio in each CU.
[0013] In combination with the first aspect, in some possible implementations, determining the moving range of any coding unit based on the second number, the center coordinates of any coding unit, and the center coordinates of the target coding unit includes: Determine the distance between the center coordinates of any one of the encoding units and the center coordinates of the target encoding unit; Based on the distance and the second number, a moving range of any one encoding unit is obtained.
[0014] In the above manner, by combining the moving range of the coding unit with the first number of the central coordinates of any coding unit distributed in the target coding tree unit to which it belongs, the employee information inclusion ratio in the coding unit can be accurately analyzed.
[0015] In combination with the first aspect, in some possible implementations, obtaining the moving range of any one of the encoding units based on the distance and the second number includes: determining a ratio between the first number and the number of frames of the plurality of historical consecutive video frames; The ratio and the distance are merged to obtain the moving range of any coding unit.
[0016] In combination with the first aspect, in some possible implementations, before determining the importance weights of different regions in each coding unit based on the employee information inclusion ratio, the method further includes: Determining uniformity between coding tree units at the same position in the to-be-processed video frame and a previous video frame; The determining the importance weights of different regions in each coding unit based on the employee information inclusion ratio includes: Determining the importance of each coding unit based on the uniformity and the employee information inclusion ratio; For any motion region in each coding unit, an importance weight of the motion region is determined based on the importance of the any motion region and the importance of the plurality of coding units.
[0017] In the above method, by first calculating the uniformity of the CTU at the same position of the video frame to be processed and the previous video frame, and then combining the employee information inclusion ratio in each coding unit, different importance weights can be more accurately assigned to different areas in the coding unit, thereby highlighting the important areas in the coding unit, and thus improving the quality of video compression storage.
[0018] In combination with the first aspect, in some possible implementations, compressing and storing the office video based on the importance weight includes: Based on the importance weights of different regions of the coding unit in the video frame to be processed, motion estimation is performed on the video frame to be processed, and the best matching block of the video frame to be processed is determined in the adjacent video frames of the video frame to be processed; Based on the best matching block, the to-be-processed video frame is compressed and stored.
[0019] In the above method, during the video compression process, by fully considering the importance weights of different areas in the coding unit, the best matching block can be found more accurately from adjacent frames, so that the video can be compressed according to the nearest matching block, which can improve the compression quality of the video.
[0020] In a second aspect, a system for collecting and storing employee office surveillance videos is provided, the system comprising: The acquisition module is used to obtain employees' office videos; A first determination module is used to determine a coding tree unit in a to-be-processed video frame of the office video; wherein the coding tree unit includes: a plurality of coding units; A second determining module is used to determine the employee information inclusion ratio in each of the plurality of encoding units; A third determination module, configured to determine the importance weights of different regions in each coding unit based on the employee information inclusion ratio; A storage module is used to compress and store the office video based on the importance weight.
[0021] According to a third aspect, a computer program product is provided, comprising: a computer program code, which, when executed on a computer, enables the computer to execute the method according to the first aspect or any possible implementation of the first aspect.
[0022] In a fourth aspect, a computer-readable storage medium is provided, which stores a computer program code. When the computer program code runs on a computer, the computer executes the method in the above-mentioned first aspect or any possible implementation manner of the first aspect.
[0023] The present invention has the following beneficial effects: after obtaining the office video of the employees, the employee information inclusion ratio of each coding unit is calculated by calculating the multiple coding tree units in each video frame to be processed, and based on the various coding units included in the multiple coding tree units, the employee information inclusion ratio of each coding unit is calculated, thereby quantifying the employee information inclusion ratio of each CU. Based on the employee information inclusion ratio of each CU, the importance weights of different areas in each coding unit are calculated, thereby realizing the setting of importance weights for different areas in each CU; in this way, a higher weight can be set for the employee-like moving area in each CU, and a smaller weight can be set for the unimportant area, thereby improving the compression quality of the video. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 It is a schematic diagram of the implementation process of a method for collecting and storing employee office monitoring videos provided by an embodiment of the present invention; Figure 2This is another implementation flow diagram of a method for collecting and storing employee office monitoring videos provided by an embodiment of the present invention; Figure 3 This is a schematic diagram of an application scenario of a method for collecting and storing employee office monitoring videos provided by an embodiment of the present invention; Figure 4 It is another implementation flow diagram of a method for collecting and storing employee office monitoring videos provided by an embodiment of the present invention; Figure 5 This is another implementation flow diagram of a method for collecting and storing employee office monitoring videos provided by an embodiment of the present invention; Figure 6 It is a schematic diagram of the composition structure of an employee office monitoring video acquisition and storage system provided by an embodiment of the present invention; Figure 7 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of a method for collecting and storing employee office monitoring videos proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0027] Among them, in the description of the embodiments of the present invention, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a way to describe the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present invention, "multiple" refers to two or more than two.
[0028] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.
[0029] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0030] The following is a detailed description of a method for collecting and storing employee office monitoring videos provided by the present invention in conjunction with the accompanying drawings. Figure 1, which shows a schematic diagram of the implementation process of the employee office monitoring video collection and storage method, including: 101, perform CTU division and CU division preprocessing on the acquired employee office surveillance video.
[0031] 102, calculating the uniformity of the CTU at the same position in the video frame to be processed and the previous video frame.
[0032] Here, the video frame to be processed may be the current video frame.
[0033] 103, calculating the most similar CU between each CU in the video frame to be processed and the CU in the historical continuous frames.
[0034] 104 , calculating the employee information inclusion ratio of each CU in the video frame.
[0035] 105, calculating the importance of each CU in the video frame.
[0036] 106 , calculating the importance weights of different regions of each CU in the video frame.
[0037] 107 , perform motion estimation on each CU to calculate the best matching block.
[0038] 108, encode the video frame using the subsequent operation of HCVC.
[0039] In the above steps 101 to 108, the uniformity of the CTU at the same position of the video frame to be processed and the previous video frame is quantified by calculating the similarity between each CTU in each video frame to be processed and the CTU at the same position in the historical video frame. Then, the employee information inclusion ratio of each CU is quantified according to the movement of the pixels in each CU in the video frame to be processed in the historical video frame. The importance of each CU is quantified by combining the uniformity of the CTU at the same position of the video frame to be processed and the previous video frame and the employee information inclusion ratio of each CU. Finally, the importance weights of different areas in each CU are set according to the frame difference image. Therefore, the method according to the embodiment of the present invention can set a higher weight for the area where the employee moves, and a smaller weight for the unimportant area, thereby improving the compression quality of the video.
[0040] The following is a detailed description of a method for collecting and storing employee office monitoring videos provided by the present invention in conjunction with the accompanying drawings. Figure 2 , which shows a flow chart of a method for collecting and storing employee office monitoring videos provided by an embodiment of the present invention, the method comprising: 201, obtain employees’ office videos.
[0041] Here, in the company's daily office scene, the office employees are captured through the camera to obtain the office video. The company obtains the surveillance video of the day (i.e., the employee's office video) through the installed daily surveillance camera. Among them, the office video is composed of multiple video sequences. It should be noted that the office videos of employees collected in this embodiment are all non-private video data, and have been approved by the employees in advance.
[0042] 202 : Determine a coding tree unit in a to-be-processed video frame of the office video.
[0043] Wherein, the coding tree unit includes: multiple coding units; the video frame to be processed can be any frame in the office video. The video frame to be processed includes multiple coding tree units. By dividing the video frame to be processed into multiple coding tree units; and according to the preset number, each coding tree unit of the multiple coding tree units is divided into multiple coding units. Wherein, the preset number is a number set for each coding unit, so that each coding unit has a unique number. In this way, by dividing the video frame to be processed into coding tree units, and then dividing the coding tree units into multiple coding units, it is convenient to subsequently identify each coding unit, so as to improve the accuracy of identifying the coding unit.
[0044] In some possible implementations, the video sequence of the office video is input into the HEVC encoder. After the video sequence enters the HEVC encoder, each video frame is first divided into CTUs (coding tree units) of equal size (64*64). Then each CTU in each video frame is divided into multiple CU coding units of different sizes using a quadtree partitioning method. And each CU has a preset number so that these CUs can be accurately identified and processed during encoding and decoding. Figure 3 As shown, the sizes of multiple CUs can be different.
[0045] 203. In each of the plurality of encoding units, determine an employee information inclusion ratio.
[0046] Here, the employee information inclusion ratio is used to indicate the proportion of employee information in the coding unit. When each CTU is divided, the flat part of the video frame will be divided into a larger CU, and the area with complex texture will be divided into a smaller CU. Therefore, if an object or employee in a CTU moves, the result of dividing the CU in the same CTU of consecutive frames will be different. Therefore, for the video frame to be processed, the degree of uniformity of the division result of the same CTU in the previous video frame can be analyzed to determine the degree of movement of the pixels in each CTU in the video frame to be processed.
[0047] In some possible implementations, the target coding unit that is relatively similar in the video frame to be processed and the previous video frame is analyzed, and then the employee information inclusion ratio in the coding unit is calculated. That is, the above step 203 can be performed by Figure 4 The steps shown achieve: 401 : For any coding unit of the to-be-processed video frame, search for a target coding unit similar to any coding unit in multiple historical continuous video frames of the to-be-processed video frame.
[0048] Here, the multiple historical continuous video frames may be R continuous frames before the processed video frame in the office video. In the multiple historical continuous frames, the coding unit most similar to any coding unit of the video frame to be processed is searched, that is, the target coding unit.
[0049] In some possible implementations, the above step 401 may be implemented through the following process: First, a first pixel mean value of any coding unit of the to-be-processed video frame and a second pixel mean value of any coding unit of any historical continuous video frame are determined respectively.
[0050] Secondly, the gradient feature similarity between any coding unit of the to-be-processed video frame and any coding unit of the historical continuous video frame is determined respectively.
[0051] Again, based on the first pixel mean and the second pixel mean, a pixel mean difference between any coding unit of the to-be-processed video frame and any coding unit of the historical continuous video frame is determined.
[0052] Thirdly, based on the pixel mean difference and the gradient feature similarity, the similarity between any coding unit of the to-be-processed video frame and any coding unit of the historical continuous video frame is determined.
[0053] Finally, if the similarity satisfies a preset similarity threshold, the coding unit of any one of the historical continuous video frames is determined as the target coding unit.
[0054] In some possible implementations, the movement range of employees in the employee office video is larger than that of tables, chairs, office supplies, etc., and the movement route is more complicated. Therefore, the inclusion ratio of employee information in each CU is determined by analyzing the movement route and movement amplitude of each CU in the video frame to be processed between multiple consecutive frames. Specifically: For the j-th CU (i.e., any coding unit) in the video frame to be processed, find the CU (i.e., the target coding unit) that is most similar to the j-th CU from the R consecutive video frames in the history, as shown in formula (1): (1); in: Represents the optimal similarity value between the j-th CU in the video frame to be processed and all CUs in the r-th historical continuous frame. Represents the RGB mean value of all pixels in the j-th CU in the video frame to be processed (i.e., the first pixel mean value). Represents the RGB mean value of the pixel in the k-th CU in the r-th historical continuous frame (i.e., the second pixel mean value). It represents the gradient feature in the j-th CU in the video frame to be processed, and is represented by the mean of the gradient amplitudes of all pixels in the j-th CU. Represents the gradient features in the kth CU in the rth historical continuous frame. represents the Euclidean distance.
[0055] Represents a pixel mean difference between any coding unit of the to-be-processed video frame and any coding unit of the historical continuous video frame; The smaller the value of is, the more similar the RGB features of the pixels of the j-th CU in the video frame to be processed and the k-th CU in the r-th historical continuous frame are. The smaller the value of is, the more similar the gradient features of the jth CU in the video frame to be processed and the jth CU in the rth historical continuous frame are, and the more similar the direction strength and distribution of the edges of the two corresponding CUs are. The smaller the value of The smaller the value of is, the higher the similarity between any coding unit of the corresponding video frame to be processed and any coding unit of any historical continuous video frame is. Then find The minimum value of is recorded as the optimal similarity value corresponding to the j-th CU in the video frame to be processed and the most similar CU in the r-th historical continuous frame. In this way, by analyzing the gradient feature similarity between the coding units in the video frame to be processed and the historical continuous video frames, combined with the pixel mean difference, the similarity between any coding unit of the video frame to be processed and any coding unit of the historical continuous video frame is calculated, and then the target coding unit with high similarity to any coding unit can be found more accurately.
[0056] 402. Determine the employee information inclusion ratio based on the positional relationship between the target encoding unit and any encoding unit.
[0057] Here, according to the above method, the corresponding optimal similarity value and the corresponding most similar CU (i.e., target coding unit) of the j-th CU in the video frame to be processed and the R historical continuous frames can be calculated. Then, by analyzing the positional relationship between these most similar CUs (i.e., target coding units) and the j-th CU, the employee information inclusion ratio in the j-th CU is determined. In this way, by analyzing the target coding units similar to any coding unit and the positional relationship between any coding units, the proportion of employee information included in any coding unit, i.e., the employee information inclusion ratio, can be accurately identified.
[0058] In some possible implementations, the above step 402 may be implemented by the following steps: In the first step, a first number of target coding tree units to which the center coordinates of any coding unit are distributed and a second number of other coding tree units to which the center coordinates of any coding unit are distributed are determined respectively.
[0059] The other coding tree units are coding tree units before the target coding tree unit among the multiple coding tree units corresponding to the to-be-processed video frame.
[0060] In a second step, based on the second number, the center coordinates of the any coding unit and the center coordinates of the target coding unit, a moving range of the any coding unit is determined.
[0061] In some possible implementations, first, the distance between the center coordinates of any coding unit and the center coordinates of the target coding unit is determined. Then, based on the distance and the second number, the moving range of any coding unit is obtained. In this way, by combining the moving range of the coding unit with the first number of the target coding tree units to which the center coordinates of any coding unit are distributed, the employee information inclusion ratio in the coding unit can be accurately analyzed.
[0062] The third step is to determine the employee information inclusion ratio based on the first quantity and the moving range.
[0063] Here, first obtain the center coordinates of the jth CU in the video frame to be processed and the most similar R CUs in the R historical continuous frames. Then mark the center coordinates of the R CUs in the video frame to be processed. Since the range of employees' actions in the historical continuous video frames is disordered and wide, while the movement of office objects such as chairs is small. Therefore, based on the distribution of the center coordinates of the most similar R CUs (i.e., R target coding units) in the R historical continuous frames in the video frame to be processed, determine the employee information inclusion ratio in the jth CU in the video frame to be processed, as shown in formula (2): (2); in: Represents the employee information inclusion ratio in the j-th CU in the video frame to be processed. Represents the normalization function. Indicates the number of the most similar R center coordinates distributed in the CTU where the j-th CU is located (ie, the first number). It represents the number (ie, the second number) of the most similar R center coordinates distributed in other CTUs (not distributed in the CTU where the j-th CU is located). represents the Euclidean distance. Indicates the frame number of all historical consecutive frames. Represents the pth center coordinate among the most similar R center coordinates. Represents the center coordinates of the j-th CU in the video frame to be processed.
[0064] The smaller the value of , the more similar the R center coordinates are located in other CUs, and the pixels in the corresponding j-th CU show a larger range of movement. The larger the value of , the farther the distance between the center coordinates of the pth CTU and the center coordinates of the jth CU is, and the wider the movement range of the pixels in the corresponding jth CU is. The larger the value, the The larger the value of .
[0065] Represents the movement range of any coding unit. The larger the range of movement of the j-th CU in the video frame to be processed and the wider the range of movement, the more the movement in the corresponding j-th CU is the movement of the employee. Therefore, the employee information inclusion ratio in the j-th CU in the corresponding video frame to be processed is larger. Based on this, the employee information inclusion ratio of each CU in the video frame to be processed can be calculated. In this way, the proportion of employee information included in each coding unit can be accurately identified through the movement of pixels in each CU in the video frame to be processed in the historical video frame, thereby improving the accuracy of calculating the employee information inclusion ratio in each CU.
[0066] 204. Determine the importance weights of different regions in each coding unit based on the employee information inclusion ratio.
[0067] Here, by first analyzing the uniformity between the coding tree units at the same position in the to-be-processed video frame and the previous video frame, and combining the employee information inclusion ratio, different importance weights can be assigned to different areas in the coding unit.
[0068] In some possible implementations, by first calculating the uniformity of the CTU at the same position of the video frame to be processed and the previous video frame, and then combining the employee information inclusion ratio in each coding unit, it is possible to more accurately assign different importance weights to different areas in the coding unit, thereby highlighting the important areas in the coding unit, thereby improving the quality of video compression storage. The above step 204 can be implemented by the following process: First, in the to-be-processed video frame and the previous video frame, the uniformity between the coding tree units at the same position is determined.
[0069] Here, when each CTU is divided, the flat part of the video frame will be divided into a larger CU, and the area with complex texture will be divided into a smaller CU. Therefore, if an object or employee in a CTU moves, the corresponding CU division results of the same CTU in consecutive frames will be different. Therefore, for the video frame to be processed, the degree of uniformity of the division results of the same CTU in the previous video frame can be analyzed to determine the degree of movement of the pixels in each CTU in the video frame to be processed. Specifically: For the i-th CTU in the processed video frame, the CU number similarity and the corresponding CU size similarity of each corresponding position CTU in the processed video frame and the previous video frame are calculated respectively. The uniformity of the CTU at the same position in the processed video frame and the previous video frame is shown in formula (3): (3); in: Indicates the uniformity of the CTU at the same position of the video frame to be processed and the previous video frame. is to avoid the denominator being 0. Represents an exponential function with a natural constant as base. Indicates the number of CUs in the i-th CTU in the video frame to be processed. Indicates the number of CUs in the i-th CTU in the previous video frame. express and The maximum value in . Indicates the size of the jth CU in the i-th CTU in the video frame to be processed. For example, if a CU is 3*3, the size is 3. Indicates the size of the jth CU in the i-th CTU in the previous video frame.
[0070] The smaller the value of is, the more similar the number of divisions of the i-th CTU of the video frame to be processed and the previous video frame is.
[0071] The smaller the value of is, the more similar the size of the jth CU in the i-th CTU in the video frame to be processed is to that in the previous video frame. (In particular, when all CUs in a CTU with a smaller number of CUs have been traversed, the smaller the value of is, the more similar the size of the jth CU in the i-th CTU in the previous video frame is.) Remaining or The value is set to 100 to show the difference as much as possible). The larger the value of indicates that the CU size in the i-th CTU in the video frame to be processed is more similar to that in the previous video frame. A larger value indicates that the uniformity of the CTU at the same position of the to-be-processed video frame and the previous video frame is greater, and the corresponding to-be-processed video frame moves less on the CTU.
[0072] Secondly, based on the uniformity and the employee information inclusion ratio, the importance of each coding unit is determined.
[0073] Here, according to the above method, the uniformity of each CTU in the video frame to be processed and the CTU at the same position in the previous video frame can be calculated, which can show the degree of movement of each CTU in the video frame to be processed. At the same time, the employee information inclusion ratio in each CU in the video frame to be processed is calculated. Therefore, the importance of each CU in the video frame to be processed can be obtained by combining the two; as shown in formula (4): (4); in: Indicates the importance of the j-th CU in the video frame to be processed. Indicates the uniformity of the CTU at the same position (the CTU where the j-th CU is located) of the video frame to be processed and the previous video frame. Represents the employee information inclusion ratio in the j-th CU in the video frame to be processed. The larger the value of , the higher the importance of the j-th CU in the video frame to be processed.
[0074] Finally, for any motion region in each coding unit, an importance weight of the any motion region is determined based on the importance of the any coding unit and the importance of the plurality of coding units.
[0075] Here, by summing up the importance of the multiple coding units, the summed result and the minimum coding unit of the multiple coding units are summed again to obtain another summed result; the two summed results are fused to obtain a fused result; based on the ratio between the importance of any coding unit and the fused result, the importance weight of any motion area in each coding unit is obtained.
[0076] In some possible implementations, the importance of each CU in the video frame to be processed can be calculated according to the above method. Then, the video frame to be processed and the previous video frame are subjected to two-frame difference processing to obtain a frame difference image. The two-frame difference method is an existing method and will not be described here. Then, the white area in the frame difference image is marked in each CU of the video frame to be processed as a motion area. Therefore, the importance weight of the motion area in each CU is shown in formula (5): (5); in: Represents the importance weight of the motion area in the jth CU in the video frame to be processed. Indicates the importance of the j-th CU in the video frame to be processed. Indicates the importance of the qth CU in the video frame to be processed. J indicates the number of CUs in the video frame to be processed. Indicates the minimum value of the importance of all J CUs. Represents the sum of the importance of all J CUs in the video frame to be processed. This is to unify the importance of the non-motion area in each CU to . The larger the value of corresponds to the importance weight of the motion area in the jth CU in the video frame to be processed. Therefore, the importance weight of the non-motion area in each CU is uniformly set to .
[0077] 205. Compress and store the office video based on the importance weight.
[0078] Here, the best matching block is found in adjacent frames by the importance weights of different regions in each CU, so that the office video is compressed and stored by the best matching block. Figure 5 The steps shown achieve: 501 , based on importance weights of different regions of coding units in the video frame to be processed, perform motion estimation on the video frame to be processed, and determine the best matching block of the video frame to be processed in adjacent video frames of the video frame to be processed.
[0079] Here, the adjacent video frames of the video frame to be processed include: the previous video frame and the next video frame of the video frame to be processed. According to the above operation, the importance weights of different regions in each CU in the video frame to be processed can be calculated. When performing motion estimation to find the best matching block of each CU block in the current video frame in the previous video frame or the next video frame and calculating the matching error between the blocks, the pixels in different regions are weighted according to the importance weights.
[0080] 502: Compress and store the to-be-processed video frame based on the best matching block.
[0081] Here, according to the calculated matching error between blocks, the candidate position with the smallest error is found in the adjacent video frames, and this position is the best matching block found. After that, the subsequent motion compensation, intra-frame prediction and other operations of HEVC encoding are used to compress and store the video frames to be processed. Finally, the same operation is performed on all subsequent video frames to compress and store the employee office video. In this way, by setting the importance weights of different areas in each CU, a higher weight can be set for the area where the employee moves, and a smaller weight can be set for the unimportant area; in this way, in the video compression process, by fully considering the importance weights of different areas in the coding unit, the best matching block can be found more accurately from the adjacent frames, so that the video is compressed according to the nearest matching block, which can improve the compression quality of the video.
[0082] In an embodiment of the present invention, after obtaining the office video of the employee, the employee information inclusion ratio of each CU is quantified by calculating multiple coding tree units in each video frame to be processed and calculating the employee information inclusion ratio of each coding unit based on the various coding units included in the multiple coding tree units. Based on the employee information inclusion ratio of each CU, the importance weights of different regions in each coding unit are calculated, thereby achieving the setting of importance weights for different regions in each CU; in this way, a higher weight can be set for the employee-like moving region in each CU, and a smaller weight can be set for the unimportant region, thereby improving the compression quality of the video.
[0083] The embodiment of the present invention provides a system for collecting and storing employee office monitoring videos. Figure 6 As shown, the system 600 includes: The acquisition module 601 is used to acquire the office video of the employee; The first determination module 602 is used to determine a coding tree unit in the to-be-processed video frame of the office video; wherein the coding tree unit includes: a plurality of coding units; A second determination module 603 is used to determine the employee information inclusion ratio in each of the plurality of encoding units; A third determination module 604 is used to determine the importance weights of different regions in each coding unit based on the employee information inclusion ratio; The storage module 605 is used to compress and store the office video based on the importance weight.
[0084] In some possible implementations, the first determining module 602 is further configured to divide the to-be-processed video frame into a plurality of coding tree units; and divide each of the plurality of coding tree units into a plurality of coding units according to preset numbers.
[0085] In some possible implementations, the second determination module 603 is further used to search, for any coding unit of the video frame to be processed, in multiple historical continuous video frames of the video frame to be processed, for a target coding unit similar to any coding unit of the video frame to be processed; and determine the employee information inclusion ratio based on the positional relationship between the target coding unit and any coding unit.
[0086] In some possible implementations, the second determination module 603 is further used to respectively determine a first pixel mean of any coding unit of the video frame to be processed and a second pixel mean of a coding unit of any historical continuous video frame; respectively determine a gradient feature similarity between any coding unit of the video frame to be processed and a coding unit of any historical continuous video frame; based on the first pixel mean and the second pixel mean, determine a pixel mean difference between any coding unit of the video frame to be processed and a coding unit of any historical continuous video frame; based on the pixel mean difference and the gradient feature similarity, determine a similarity between any coding unit of the video frame to be processed and a coding unit of any historical continuous video frame; if the similarity satisfies a preset similarity threshold, determine that the coding unit of any historical continuous video frame is the target coding unit.
[0087] In some possible implementations, the second determination module 603 is further used to respectively determine a first number of target coding tree units to which the center coordinates of any coding unit are distributed, and a second number of other coding tree units to which the center coordinates of any coding unit are distributed; wherein the other coding tree units are coding tree units before the target coding tree unit among the multiple coding tree units corresponding to the video frame to be processed; based on the second number, the center coordinates of any coding unit and the center coordinates of the target coding unit, determine a moving range of any coding unit; based on the first number and the moving range, determine the employee information inclusion ratio.
[0088] In some possible implementations, the second determination module 603 is further used to determine the distance between the center coordinates of any coding unit and the center coordinates of the target coding unit; based on the distance and the second number, the moving range of any coding unit is obtained.
[0089] In some possible implementations, the second determination module 603 is further used to determine the ratio between the first number and the number of frames of the multiple historical continuous video frames; and merge the ratio and the distance to obtain the moving range of any encoding unit.
[0090] In some possible implementations, the third determination module 604 is further used to determine the uniformity between the coding tree units at the same position in the video frame to be processed and the previous video frame; determine the importance of each coding unit based on the uniformity and the employee information inclusion ratio; and determine the importance weight of any motion area in each coding unit based on the importance of any coding unit and the importance of the multiple coding units.
[0091] In some possible implementations, the storage module 605 is further used to perform motion estimation on the video frame to be processed based on importance weights of different regions of the coding units in the video frame to be processed, determine the best matching block of the video frame to be processed in adjacent video frames of the video frame to be processed; and compress and store the video frame to be processed based on the best matching block.
[0092] Optionally, the transmission medium can be a wired link (such as but not limited to coaxial cable, optical fiber and digital subscriber line (DSL)) or a wireless link (such as but not limited to wireless Fidelity (WIFI), Bluetooth and mobile device network).
[0093] It should be noted that: the device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0094] Figure 7 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Figure 7As shown, the electronic device 700 includes: a memory 701, a processor 702, and a computer program 703 stored in the memory 701 and running on the processor 702, wherein when the processor 702 executes the computer program 703, the device can execute any of the employee office monitoring video collection and storage methods described above. In addition, the embodiment of the present invention also protects a device, which may include a memory and a processor, wherein the memory stores an executable program code, and the processor is used to call and execute the executable program code to execute an employee office monitoring video collection and storage method provided by the embodiment of the present invention.
[0095] This embodiment can divide the functional modules of the device according to the above method example. For example, it can correspond to each functional module, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation. In the case of dividing each module corresponding to each function, the device may also include a signal uploading module, a determination module, an adjustment module, etc. It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, which will not be repeated here.
[0096] It should be understood that the device provided in this embodiment is used to execute the above-mentioned employee office monitoring video acquisition and storage method, so the same effect as the above-mentioned implementation method can be achieved. In the case of an integrated unit, the device may include a processing module and a storage module. Among them, when the device is applied to a device, the processing module can be used to control and manage the actions of the device. The storage module can be used to support the device to execute mutual program codes, etc. Among them, the processing module can be a processor or a controller, which can implement or execute various exemplary logic boxes, modules and circuits described in combination with the disclosure of the present invention. The processor can also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc., and the storage module can be a memory.
[0097] In addition, the device provided in the embodiment of the present invention may be a chip, a component or a module, and the chip may include a connected processor and a memory; wherein the memory is used to store instructions, and when the processor calls and executes the instructions, the chip may execute a method for collecting and storing employee office monitoring videos provided in the above embodiment. This embodiment also provides a computer-readable storage medium, in which a computer program code is stored, and when the computer program code is run on a computer, the computer executes the above-mentioned related method steps to implement a method for collecting and storing employee office monitoring videos provided in the above embodiment.
[0098] This embodiment also provides a computer program product. When the computer program product is run on a computer, the computer executes the above-mentioned related steps to implement a method for collecting and storing employee office monitoring videos provided in the above embodiment. Among them, the device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here. Through the description of the above implementation mode, the technicians in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In practical applications, the above-mentioned function allocation can be completed by different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In the embodiments provided by the present invention, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiment described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, which may be electrical, mechanical or other forms.
[0099] It should be noted that the sequence of the above-mentioned embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The process depicted in the accompanying drawings does not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-tasking and parallel processing are also possible or may be advantageous. The various embodiments in this specification are described in a progressive manner, and the same and similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments. The above content is only a specific implementation method of the present invention, but the protection scope of the present invention is not limited to this. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered within the protection scope of the present invention.
Claims
1. A method for collecting and storing employee office surveillance videos. It is characterized in that The method comprises: Get employees’ office videos; Determine a coding tree unit in a to-be-processed video frame of the office video; wherein the coding tree unit comprises: a plurality of coding units; In each of the plurality of encoding units, determining an employee information inclusion ratio; Determining the importance weights of different regions in each coding unit based on the employee information inclusion ratio; Based on the importance weight, the office video is compressed and stored.
2. According to claim 1, a method for collecting and storing employee office monitoring videos, It is characterized in that The method further comprises: Dividing the to-be-processed video frame into a plurality of coding tree units; Each of the plurality of coding tree units is divided into a plurality of coding units according to a preset number.
3. According to claim 1, a method for collecting and storing employee office monitoring videos, It is characterized in that The step of determining the employee information inclusion ratio in each of the plurality of encoding units comprises: For any coding unit of the to-be-processed video frame, searching for a target coding unit similar to the any coding unit in a plurality of historical continuous video frames of the to-be-processed video frame; The employee information inclusion ratio is determined based on the positional relationship between the target encoding unit and any one of the encoding units.
4. According to claim 3, a method for collecting and storing employee office monitoring videos, It is characterized in that The step of searching, for any coding unit of the to-be-processed video frame, a target coding unit similar to the any coding unit in a plurality of historical continuous video frames of the to-be-processed video frame, comprises: Respectively determining a first pixel mean value of any coding unit of the to-be-processed video frame and a second pixel mean value of any coding unit of any historical continuous video frame; Respectively determining the gradient feature similarity between any coding unit of the to-be-processed video frame and any coding unit of the historical continuous video frame; Determine, based on the first pixel mean and the second pixel mean, a pixel mean difference between any coding unit of the to-be-processed video frame and any coding unit of the historical continuous video frame; Determining the similarity between any coding unit of the to-be-processed video frame and any coding unit of the historical continuous video frame based on the pixel mean difference and the gradient feature similarity; If the similarity satisfies a preset similarity threshold, the coding unit of any one of the historical continuous video frames is determined as the target coding unit.
5. According to claim 3, a method for collecting and storing employee office monitoring videos, It is characterized in that The determining the employee information inclusion ratio based on the positional relationship between the target encoding unit and any encoding unit includes: Respectively determine a first number of target coding tree units to which the center coordinates of any coding unit are distributed, and a second number of other coding tree units to which the center coordinates of any coding unit are distributed; wherein the other coding tree units are coding tree units before the target coding tree unit among the multiple coding tree units corresponding to the to-be-processed video frame; Determine a moving range of any one of the encoding units based on the second number, the center coordinates of any one of the encoding units, and the center coordinates of the target encoding unit; The employee information inclusion ratio is determined based on the first number and the moving range.
6. A method for collecting and storing employee office monitoring videos according to claim 5, It is characterized in that The determining, based on the second number, the center coordinates of the any coding unit and the center coordinates of the target coding unit, a moving range of the any coding unit includes: Determine the distance between the center coordinates of any one of the encoding units and the center coordinates of the target encoding unit; Based on the distance and the second number, a moving range of any one encoding unit is obtained.
7. A method for collecting and storing employee office monitoring videos according to claim 6, It is characterized in that The obtaining, based on the distance and the second number, a moving range of any one of the encoding units, comprises: determining a ratio between the first number and the number of frames of the plurality of historical consecutive video frames; The ratio and the distance are combined to obtain the moving range of any coding unit.
8. The method for collecting and storing employee office monitoring videos according to claim 1, It is characterized in that Before determining the importance weights of different regions in each coding unit based on the employee information inclusion ratio, the method further includes: Determining uniformity between coding tree units at the same position in the to-be-processed video frame and a previous video frame; The determining the importance weights of different regions in each coding unit based on the employee information inclusion ratio includes: Determining the importance of each coding unit based on the uniformity and the employee information inclusion ratio; For any motion region in each coding unit, an importance weight of the motion region is determined based on the importance of the any motion region and the importance of the plurality of coding units.
9. The method for collecting and storing employee office monitoring videos according to claim 1, It is characterized in that The compressing and storing the office video based on the importance weight includes: Based on the importance weights of different regions of the coding unit in the video frame to be processed, motion estimation is performed on the video frame to be processed, and the best matching block of the video frame to be processed is determined in the adjacent video frames of the video frame to be processed; Based on the best matching block, the to-be-processed video frame is compressed and stored.
10. An employee office monitoring video acquisition and storage system, It is characterized in that The employee office monitoring video acquisition and storage system includes: The acquisition module is used to obtain employees' office videos; A first determination module is used to determine a coding tree unit in a to-be-processed video frame of the office video; wherein the coding tree unit includes: a plurality of coding units; A second determining module is used to determine the employee information inclusion ratio in each of the plurality of encoding units; A third determination module, configured to determine the importance weights of different regions in each coding unit based on the employee information inclusion ratio; A storage module is used to compress and store the office video based on the importance weight.
Citation Information
Patent Citations
Panoramic video fast coding method based on distortion threshold
CN114567779A
Intra-frame prediction method and device, electronic equipment and storage medium
CN115834882A
Video coding method, device and equipment and readable storage medium
CN116828183A
Video processing method and related device
WO2024066649A1
Cited By
Intelligent traffic video data coding method and system
CN120529080A
