Picture elastic compression method based on content awareness
By combining key point comparison and redundancy elimination methods with an elastic compression scheme, the adaptability problem of image compression methods under different devices and hardware conditions is solved, and efficient and flexible image compression is achieved, which is suitable for a variety of application scenarios.
Patent Information
- Application Number
- CN202510921135.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-04
- Publication Date
- 2025-09-05
AI Technical Summary
Existing image compression methods have difficulty balancing image quality and compression rate, especially their lack of adaptability to different devices and hardware conditions, resulting in low compression efficiency or poor image quality in some scenarios.
The key point comparison method is used to identify the changes in key points of the previous and next frames, the redundancy elimination method is used to eliminate background redundancy, and the elastic compression scheme is automatically configured according to the user's device status and hardware conditions to achieve intelligent compression.
It achieves efficient image compression under different equipment and hardware conditions, retains key information, reduces data storage requirements, adapts to the compression requirements of different scenarios, and improves compression efficiency and image quality.
Smart Images

Figure CN120602652A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and in particular relates to a content-aware image elastic compression method. Background Art
[0002] Image compression is a key technology in digital image processing, designed to reduce image data size to save storage space and transmission bandwidth. Image compression plays a key role in digital photography, video communications, medical imaging, and other fields. During network transmission, large image files can lead to slow data transmission or consume excessive bandwidth resources. Image compression enables faster transmission and more efficient network communication. With the increasing popularity of mobile devices and the growing demand for image transmission and display, efficient image compression has become increasingly important.
[0003] Existing compression methods are mainly divided into two categories: lossy and lossless. Lossless compression preserves the original image information without loss and can be compressed repeatedly without damage, making it suitable for applications requiring accurate reproduction. However, the compression ratio is low, requiring more storage space and transmission bandwidth. Lossy compression achieves higher compression ratios and is suitable for applications with lower image quality requirements and large-scale image transmission and storage. However, information loss occurs, reducing image quality, and repeated compression may even lead to quality degradation. Therefore, it is extremely important to develop a lossy compression method that achieves low information loss and high image quality. Summary of the Invention
[0004] The purpose of the present invention is to overcome the deficiencies in the prior art and provide a content-aware image elastic compression method.
[0005] In order to achieve the purpose of the present invention, the present invention is implemented by adopting the following technical solutions.
[0006] A content-aware image elastic compression method includes the following steps:
[0007] S1. Use key point comparison method to identify key point changes between previous and next frames and save the difference frame;
[0008] S2, performing background recognition and eliminating unnecessary image content on the difference frame saved in step S1 by a redundancy elimination method;
[0009] S3. Automatically configure a compression scheme for the image processed in step S2 using a flexible compression scheme to achieve flexible compression.
[0010] Furthermore, the key point comparison method comprises the following steps:
[0011] S21. Key point extraction: Calculate the response value R of each image pixel (x, y). Points with high response values are considered key points based on a preset threshold. The response function is defined as follows:
[0012] R=λ1λ2-k(λ1+λ2) 2
[0013] Where λ1 and λ2 are the two eigenvalues at (x, y) in the image, and k is an empirical parameter. If the R value is greater than the threshold, the (x, y) point is considered a key point. The calculation of the two eigenvalues at (x, y) is:
[0014] |M-λI|=0
[0015] Where M represents the structured matrix at (x, y), which is used to describe the gradient change and image intensity information around the point, and I is the unit matrix;
[0016] S22, converting the extracted key points into encoding or representation vector Y i =[γ i1 ,γ i2 ,...,γ in ],i=1,2,...,N;
[0017] S23, using distance metric to measure the similarity between key points p and q of the previous and next frames;
[0018]
[0019] S24, save the video frame H with large similarity difference t .
[0020] Furthermore, the redundancy elimination method includes the following specific measures:
[0021] For the saved video frame H t , t=0,1,...,m, perform block matching and redundancy elimination for the background outside the key points; the block matching window size is known to be M×M, and the initial frame H t A reference block in the video frame H t+1 Find the best matching block in ; calculate the difference between the two blocks by the following formula;
[0022]
[0023] Where (i, j) is the displacement vector and E(i, j) represents the error between the reference block and the candidate block;
[0024] The background redundancy between two frames is estimated by finding the displacement vector that minimizes the error within a given search range:
[0025]
[0026] The smaller the error, the more redundant the background is. The redundant block is located and the background is eliminated based on the displacement vector of the redundant block.
[0027] Furthermore, the elastic compression scheme automatically configures the image compression scheme according to the user's device status and hardware conditions; specifically:
[0028] If the user's device is offline and the hardware conditions meet the compression requirements, lossless compression is performed directly;
[0029] If the user's device is offline and the hardware conditions do not meet the compression requirements, lossy compression is performed directly;
[0030] If the user device is online, regardless of hardware conditions, the image is compressed using a content-aware image elastic compression method that includes a specific key point comparison method and a redundancy elimination method.
[0031] Application of a content-aware image elastic compression method in micro-expression image compression.
[0032] Application of a content-aware image elastic compression method in medical image data compression.
[0033] Application of a content-aware image elastic compression method in surveillance image data compression.
[0034] Beneficial effects
[0035] The present invention designs a key point comparison method to identify the changes in key points of the previous and next frames, and only retains the video image frames with key point changes, thereby realizing data screening and reducing data memory; designs a redundancy elimination method to perform background identification and elimination, and further performs repeated background elimination on the retained video image frames, retaining only key point image data, further reducing data memory; designs an elastic compression scheme to automatically configure the compression scheme according to the current device status and hardware conditions. The elastic compression scheme realizes intelligent compression for different devices and has strong universality. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is the overall framework diagram of the present invention;
[0037] Figure 2 Schematic diagram of the key point comparison method process of the present invention;
[0038] Figure 3 Schematic diagram of the redundancy elimination method process of the present invention. DETAILED DESCRIPTION
[0039] The present invention will be further described with reference to the embodiments and the accompanying drawings.
[0040] Example 1, as Figure 1 As shown, a content-aware elastic image compression method is designed. A key point comparison method is designed to identify the changes in key points of previous and next frames; a redundancy elimination method is designed to identify and eliminate the background; and an elastic compression scheme is designed to automatically configure the compression scheme according to the current device status and hardware conditions.
[0041] The elastic compression method is designed as follows: it collects user device status and hardware conditions, automatically configures different compression schemes for different states and hardware conditions, and implements elastic compression. If the user's device is offline and the hardware conditions meet the compression requirements, lossless compression is performed; if the user's device is offline and the hardware conditions do not meet the compression requirements, lossless compression is performed. If the user's device is online, regardless of hardware conditions, compression is performed after image processing using a content-aware elastic image compression method that includes specific key point comparison methods and redundancy elimination.
[0042] Example 2, as Figure 2 and Figure 3 As shown, the application of the present invention in micro-expression image compression
[0043] A mental health test platform was developed, consisting of 100 questions. To ensure the accuracy of students' responses, the entire process was recorded. Assuming that the video is divided into 10 frames per question, 100 questions would generate 100 * 10 = 1000 images. Considering the limited storage capacity of the school's computer room equipment, this data needs to be compressed. This compression is achieved using the present invention.
[0044] The first step, such as Figure 2 As shown in the figure, the key point comparison method is used to identify the key points of the 10 frames of image data for each question, and only the image data with changed key points are retained. The process is as follows:
[0045] Step 1: Feature extraction. For each image pixel (x, y), calculate its response value R. Points with high response values are considered key points based on the set threshold. The response function is defined as follows:
[0046] R=λ1λ2-k(λ1+λ2) 2
[0047] λ1 and λ2 are two eigenvalues at (x, y) in the image. k is an empirical parameter. If the R value is greater than the threshold, the (x, y) point is considered a key point. The two eigenvalues at (x, y) are calculated as follows:
[0048] |M-λI|=0
[0049] Where M represents the structured matrix at (x, y), which is used to describe the gradient changes and image intensity information around the point, and I is the unit matrix.
[0050] Step 2: Convert the extracted feature points into encoding or representation vector Y i =[γ i1 ,γ i2 ,...,γ in ],i=1,2,...,N;
[0051] Step 3: Use distance metric to measure the similarity between key points p and q of the previous and next frames;
[0052]
[0053] Step 4: Save the video frames with large similarity differences.
[0054] The second step is Figure 3 As shown, all saved video frame data is subjected to background recognition using a redundancy elimination method, and repeated backgrounds are only retained once. The process is as follows:
[0055] For the saved video frame H t , t=0,1,...,m, perform block matching and redundancy elimination for the background outside the key points. Knowing that the block matching window size is M×M, for the initial frame H t A reference block in the video frame H t+1 The best matching block is found in . The difference between two blocks is calculated as follows:
[0056]
[0057] where (i, j) is the displacement vector and E(i, j) represents the error between the reference block and the candidate block.
[0058] The background redundancy between two frames is estimated by finding the displacement vector that minimizes the error within a given search range:
[0059]
[0060] The smaller the error, the more redundant the background is. The redundant block is located and the background is eliminated based on the displacement vector of the redundant block.
[0061] The third step is to select a flexible compression scheme based on the user status and hardware conditions. The compression schemes are as follows:
[0062] If the user's device is offline and the hardware conditions meet the compression requirements, lossless compression is performed directly;
[0063] If the user's device is offline and the hardware conditions do not meet the compression requirements, lossy compression is performed directly;
[0064] If the user device is online, regardless of hardware conditions, the image is compressed using a content-aware image elastic compression method that includes a specific key point comparison method and a redundancy elimination method.
[0065] In this embodiment, the micro-expression data is stored in an offline local device, and the micro-expression data collection places high demands on the device, so the hardware device has a strong CPU and memory. Therefore, in order to retain all pixel values and color information of the micro-expression image, the image data is directly compressed in a lossless compression method;
[0066] Example 3, as Figure 2 and Figure 3 As shown, the application of the present invention in medical image data compression
[0067] The imaging department of a tertiary hospital collects more than 10TB of medical imaging data every day, and to ensure convenient medical treatment for patients, the data storage period is at least 15 years. Faced with such a large data storage demand, the batch of data needs to be compressed. The present invention is used to achieve compression.
[0068] The first step, such as Figure 2 As shown in the figure, the key point comparison method is used to identify the key points of the 10 frames of image data for each question, and only the image data with changed key points are retained. The process is as follows:
[0069] Step 1: Feature extraction. For each image pixel (x, y), calculate its response value R. Points with high response values are considered key points based on the set threshold. The response function is defined as follows:
[0070] R=λ1λ2-k(λ1+λ2) 2
[0071] λ1 and λ2 are two eigenvalues at (x, y) in the image. k is an empirical parameter. If the R value is greater than the threshold, the (x, y) point is considered a key point. The two eigenvalues at (x, y) are calculated as follows:
[0072] |M-λI|=0
[0073] Where M represents the structured matrix at (x, y), which is used to describe the gradient changes and image intensity information around the point, and I is the unit matrix.
[0074] Step 2: Convert the extracted feature points into encoding or representation vector Y i =[γ i1 ,γ i2 ,...,γ in],i=1,2,...,N;
[0075] Step 3: Use distance metric to measure the similarity between key points p and q of the previous and next frames;
[0076]
[0077] Step 4: Save the video frames with large similarity differences.
[0078] The second step is Figure 3 As shown, all saved video frame data is subjected to background recognition using a redundancy elimination method, and repeated backgrounds are only retained once. The process is as follows:
[0079] For the saved video frame H t , t=0,1,...,m, perform block matching and redundancy elimination for the background outside the key points. Knowing that the block matching window size is M×M, for the initial frame H t A reference block in the video frame H t+1 The best matching block is found in . The difference between two blocks is calculated as follows:
[0080]
[0081] where (i, j) is the displacement vector and E(i, j) represents the error between the reference block and the candidate block.
[0082] The background redundancy between two frames is estimated by finding the displacement vector that minimizes the error within a given search range:
[0083]
[0084] The smaller the error, the more redundant the background is. The redundant block is located and the background is eliminated based on the displacement vector of the redundant block.
[0085] The third step is to select a flexible compression scheme based on the user status and hardware conditions. The compression schemes are as follows:
[0086] If the user's device is offline and the hardware conditions meet the compression requirements, lossless compression is performed directly;
[0087] If the user's device is offline and the hardware conditions do not meet the compression requirements, lossy compression is performed directly;
[0088] If the user device is in an online state, regardless of hardware conditions, the image is compressed using the compression schemes described in claims 1 to 3.
[0089] In this embodiment, medical image data collection requires professional physicians to collect data online in real time. In order to preserve the key feature points in the medical image and meet the compression requirements, the medical image data is processed in step 1 and step 2 and then losslessly compressed.
[0090] Example 4: Application of the present invention in monitoring image data compression
[0091] A large residential complex (with more than 2,000 households) is typically equipped with 200-800 cameras, covering entrances, roads, parking lots, buildings, and other areas. This generates at least 10GB of surveillance data daily. Considering the storage capacity of residential property management equipment, this data needs to be compressed. This compression method is used to achieve this.
[0092] The first step, such as Figure 2 As shown in the figure, the key point comparison method is used to identify the key points of the 10 frames of image data for each question, and only the image data with changed key points are retained. The process is as follows:
[0093] Step 1: Feature extraction. For each image pixel (x, y), calculate its response value R. Points with high response values are considered key points based on the set threshold. The response function is defined as follows:
[0094] R=λ1λ2-k(λ1+λ2) 2
[0095] λ1 and λ2 are two eigenvalues at (x, y) in the image. k is an empirical parameter. If the R value is greater than the threshold, the (x, y) point is considered a key point. The two eigenvalues at (x, y) are calculated as follows:
[0096] |M-λI|=0
[0097] Where M represents the structured matrix at (x, y), which is used to describe the gradient changes and image intensity information around the point, and I is the unit matrix.
[0098] Step 2: Convert the extracted feature points into encoding or representation vector Y i =[γ i1 ,γ i2 ,...,γ in ],i=1,2,...,N;
[0099] Step 3: Use distance metric to measure the similarity between key points p and q of the previous and next frames;
[0100]
[0101] Step 4: Save the video frames with large similarity differences.
[0102] The second step is Figure 3As shown, all saved video frame data is subjected to background recognition using a redundancy elimination method, and repeated backgrounds are only retained once. The process is as follows:
[0103] For the saved video frame H t , t=0,1,...,m, perform block matching and redundancy elimination for the background outside the key points. Knowing that the block matching window size is M×M, for the initial frame H t A reference block in the video frame H t+1 The best matching block is found in . The difference between two blocks is calculated as follows:
[0104]
[0105] where (i, j) is the displacement vector and E(i, j) represents the error between the reference block and the candidate block.
[0106] The background redundancy between two frames is estimated by finding the displacement vector that minimizes the error within a given search range:
[0107]
[0108] The smaller the error, the more redundant the background is. The redundant block is located and the background is eliminated based on the displacement vector of the redundant block.
[0109] The third step is to select a flexible compression scheme based on the user status and hardware conditions. The compression schemes are as follows:
[0110] If the user's device is offline and the hardware conditions meet the compression requirements, lossless compression is performed directly;
[0111] If the user's device is offline and the hardware conditions do not meet the compression requirements, lossy compression is performed directly;
[0112] If the user device is online, regardless of hardware conditions, the image is compressed using a content-aware image elastic compression method that includes a specific key point comparison method and a redundancy elimination method.
[0113] In this embodiment, the monitoring data is stored in an offline local device, and the video data collection has low requirements on the device, so the hardware performance is not high. The video data is only used for retrospective purposes, so the image quality requirements are not high. Therefore, the monitoring data is directly compressed using a lossy compression method;
[0114] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.
Claims
1. A content-aware image elastic compression method, characterized by: The steps include: S1. Use key point comparison method to identify key point changes between previous and next frames and save the difference frame; S2, performing background recognition and eliminating unnecessary image content on the difference frame saved in step S1 by a redundancy elimination method; S3. Automatically configure a compression scheme for the image processed in step S2 using a flexible compression scheme to achieve flexible compression.
2. The content-aware image elastic compression method according to claim 1, characterized in that: The key point comparison method comprises the following steps: S21. Key point location: Calculate the response value R of each image pixel (x, y). Points with high response values are considered key points based on a preset threshold. The response function is defined as follows: R=λ1λ2-k(λ1+λ2) 2 Where λ1 and λ2 are the two eigenvalues at (x, y) in the image, and k is an empirical parameter. If the R value is greater than the threshold, the (x, y) point is considered a key point. The calculation of the two eigenvalues at (x, y) is: |M-λI|=0 Where M represents the structured matrix at (x, y), which is used to describe the gradient change and image intensity information around the point, and I is the unit matrix; S22, converting the extracted key points into encoding or representation vector Y i =[γ i1 ,γ i2 ,...,γ in ],i=1,2,...,N; S23, using distance metric to measure the similarity between key points p and q of the previous and next frames; S24: Save the video frames Ht with large similarity differences.
3. The content-aware image elastic compression method according to claim 2, characterized in that: The redundancy elimination method includes the following specific measures: For the saved video frame H t , t=0,1,...,m, perform block matching and redundancy elimination for the background outside the key points; the block matching window size is known to be M×M, and the initial frame H t A reference block in the video frame H t+1 Find the best matching block in ; calculate the difference between the two blocks by the following formula; Where (i, j) is the displacement vector and E(i, j) represents the error between the reference block and the candidate block; The background redundancy between two frames is estimated by finding the displacement vector that minimizes the error within a given search range: The smaller the error, the more redundant the background is. The redundant block is located and the background is eliminated based on the displacement vector of the redundant block.
4. The content-aware image elastic compression method according to claim 3, characterized in that: The flexible compression scheme automatically configures the image compression scheme based on the user's device status and hardware conditions; specifically: If the user's device is offline and the hardware conditions meet the compression requirements, lossless compression is performed directly; If the user's device is offline and the hardware conditions do not meet the compression requirements, lossy compression is performed directly; If the user device is in an online state, regardless of hardware conditions, the image is compressed using the compression schemes described in claims 1 to 3.
5. Application of a content-aware image elastic compression method in micro-expression image compression.
6. Application of a content-aware image elastic compression method in medical imaging data compression.
7. Application of a content-aware image elastic compression method in surveillance image data compression.