Contact network image compression method based on block chain coding and differential coding
By dynamically adjusting the size and shape of image blocks using blockchain-like coding and enhanced differential coding, the problems of detail loss and low efficiency in contact network image compression are solved, achieving efficient and accurate image compression and monitoring.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SOUTHWEST JIAOTONG UNIV
- Filing Date
- 2025-12-15
- Publication Date
- 2026-04-21
AI Technical Summary
Existing overhead contact line image compression technologies suffer from the loss of details in critical areas due to fixed blocks when processing highly redundant continuous surveillance videos. Traditional differential coding is inefficient and cannot effectively adapt to subtle differences in dynamic images.
A blockchain-like encoding method that dynamically adjusts the size and shape of image blocks, combined with an enhanced differential encoding strategy, is adopted. Redundant information is transmitted through the chain structure, and dynamic threshold control and high-sensitivity difference detection are used to encode only blocks that change significantly.
It achieves accurate retention of information in key areas, improves compression efficiency and quality, ensures accurate monitoring and rapid response capabilities for important parts of the overhead contact line, and adapts to the needs of different monitoring environments.
Smart Images

Figure CN121908014A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of overhead contact line image compression technology, and more specifically to an overhead contact line image compression method based on blockchain-like coding and differential coding. Background Technology
[0002] Overhead contact line image compression plays a crucial role in the maintenance of railways and urban rail transit. It primarily serves efficient data transmission, storage, and management, ultimately ensuring the safe and efficient operation of railway transportation. Overhead contact line image compression is a key bridge connecting "front-end data acquisition" and "back-end intelligent analysis and application," and is an indispensable technical component of modern, intelligent railway inspection systems, directly improving the safety, economy, and efficiency of railway operation and maintenance.
[0003] Existing image compression technologies mainly rely on traditional fixed-size block compression methods and basic inter-frame differential coding. However, these methods face two major challenges when processing highly redundant continuous monitoring videos of overhead contact lines: First, fixed-size blocks cannot effectively adapt to different feature-dense areas in the image, causing details in key areas of the overhead contact line image to be easily lost during compression; second, basic differential coding strategies do not take into account the special importance of subtle differences in real-time dynamic images, and therefore cannot provide sufficiently efficient compression performance. Summary of the Invention
[0004] To overcome the shortcomings of existing technologies, this invention discloses a contact network image compression method based on blockchain-like coding and differential coding. The purpose of this invention is to address the problems encountered by existing image compression technologies, which mainly rely on traditional fixed-size block compression methods and basic inter-frame differential coding. These problems include detail loss due to fixed blocks and low efficiency of traditional differential coding when processing highly redundant continuous monitoring videos of contact networks. This invention dynamically adjusts the size and shape of image blocks and uses a chain-like structure to transmit redundant information, thereby more accurately reflecting the characteristics of different parts of the image. This allows for more detailed processing of critical areas, such as damaged parts of insulators, ensuring that this critical information is not lost during compression. This invention employs an enhanced differential coding strategy, combined with dynamic threshold control and high-sensitivity difference detection. Only image blocks that differ significantly from the previous frame are encoded, reducing unnecessary data processing and storage. The dynamic threshold is automatically adjusted according to changes in scene content, enabling the compression method to flexibly respond to different monitoring environment requirements.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A method for compressing contact network images based on blockchain-like coding and differential coding includes the following steps: I. Image Preprocessing S1. Preprocess the contact wire image to obtain a standardized image; Preferably, in step S1, the preprocessing includes: Use a Gaussian filter on the contact wire image Filtering is performed to obtain the denoised filtered image. ; Use grayscale correction functions to filter the image. Adjust the brightness and contrast to obtain the corrected image. ; For the corrected image Standardization is performed to normalize the image pixel values to a range. To obtain a standardized image .
[0006] Preferably, in step S1, the normalization includes:
[0007] in, For standardized images; To correct the image; To correct the minimum pixel value of the image; To correct the maximum pixel value of the image.
[0008] II. Dynamic Block Adjustment and Chain Structure Construction S2. Adaptive block division is performed on the standardized image. During block division, the block size is dynamically adjusted based on the relative size between the complexity function of the standardized image content and the preset threshold. The block shape is dynamically adjusted based on the feature edges in the standardized image. After block division, adjacent blocks are connected through a chain structure to form a linked list structure, and the blocks in the linked list structure are chain-encoded. Preferably, in step S2, the complexity function is defined as the magnitude of the image gradient:
[0009] in, The complexity function; To standardize images in Gradient in direction; To standardize images in Gradient in the direction.
[0010] Preferably, in step S2, the block size is dynamically adjusted based on the relative size between the complexity function of the standardized image content and the preset threshold as follows:
[0011] in, Block size; For small block sizes; For large block sizes; The complexity function; This is a preset threshold.
[0012] In this invention, the block size is dynamically adjusted based on the relative size between the complexity function of the standardized image content and a preset threshold. The advantage of this approach is that it adaptively selects the block size according to the complexity of local image features; in regions with complex textures, the higher the complexity function value, the smaller the block size is used. To retain more detail, larger blocks are used in flat areas. This aims to improve compression efficiency and achieve an optimal balance between compression ratio and image quality.
[0013] Preferably, in step S2, the dynamic adjustment of the block shape based on the feature edges in the standardized image includes: using the Canny edge detection algorithm to obtain the feature edges in the standardized image, and constructing irregularly shaped blocks based on the feature edges.
[0014] In this invention, the shape of the blocks is dynamically adjusted based on the feature edges in the standardized image. The advantages of this setting are: the block boundaries are aligned with the feature edges in the image, avoiding the interruption of continuous edges by traditional rectangular blocks, reducing block artifacts that may appear in the edge area after compression, maintaining the integrity and sharpness of the outline of key components of the contact network (such as insulators, suspension wires, etc.), and improving the visual quality of the reconstructed image.
[0015] Preferably, in step S2, connecting adjacent blocks through a chain structure to form a linked list structure includes: connecting adjacent blocks... A linked list structure is formed by connecting the links in a chain-like manner. ,in This represents the total number of blocks.
[0016] In this invention, adjacent blocks are connected by a chain structure to form a linked list. The advantage of this approach is that it explicitly records the spatial adjacency relationships between blocks. This allows for priority encoding of spatially adjacent blocks in subsequent chain-encoding steps. Since the pixel content of adjacent blocks typically has high correlation, using the preceding block as a prediction reference for differential encoding effectively reduces data redundancy, thereby generating a more compact compressed data representation.
[0017] Preferably, in step S2, the chain-like encoding of blocks in the linked list structure includes: recording only the differences between two adjacent blocks during the encoding process; for adjacent blocks in the linked list structure, information sharing is achieved by utilizing their common characteristics; assuming the average gray values of adjacent blocks are respectively... and Common features Represented as:
[0018] in, Common characteristics; For the current block; For neighboring blocks.
[0019] In this invention, the above-mentioned chain-encoding of blocks in the linked list structure has the following advantages: the chain-encoding strategy utilizes the highly correlated characteristics of adjacent blocks in the linked list structure to represent visually continuous image regions as extremely small data increments, thereby significantly reducing the overall data volume and achieving a higher compression ratio; at the same time, this lightweight encoding mechanism significantly reduces computational overhead, making the encoding process more efficient.
[0020] III. Enhanced Differential Coding Strategy S3. For the standardized image of the current frame and the previous frame, after performing adaptive block division, calculate the difference degree of each block and the global average difference degree of all blocks, and calculate the dynamic adjustment threshold based on the global average difference degree. Then compare the difference degree of each block with the dynamic adjustment threshold, and perform differential encoding on the blocks with the difference degree greater than the dynamic adjustment threshold to obtain the encoded differential data. Preferably, in step S3, the calculation of the difference degree of each block is as follows: for the current frame And the previous frame The corresponding block Calculate the degree of difference :
[0021] in, For the first The degree of difference between individual blocks; For blocks The number of pixels contained; The column index for pixels; The row index of the pixel; For the first One block; The current frame image; This is the previous frame image.
[0022] Preferably, in step S3, the calculation of the global average difference across all blocks is as follows:
[0023] in, The global average difference. The total number of blocks; For the first The degree of difference between individual blocks.
[0024] Preferably, in step S3, the dynamic adjustment threshold calculated based on the global average difference is as follows:
[0025] in, To dynamically adjust the threshold; The adjustment coefficients are set according to the needs of the scenario; This represents the global average difference.
[0026] In this invention, the degree of difference for each block is calculated. Global average difference between all blocks ,according to Calculate dynamic threshold and for those that meet the conditions Differential coding is performed on the blocks. The advantages of this setting are: through the dynamic threshold mechanism, it can automatically identify and encode only the blocks that change significantly between frames, without the need for repeated encoding and transmission, which greatly eliminates time redundancy and improves the overall compression efficiency of continuous frame sequences. Compared with fixed threshold selection, it can avoid missing important blocks in scenarios with drastic overall changes.
[0027] Preferably, in step S3, comparing the difference degree of each block with a dynamic adjustment threshold, and performing differential encoding on blocks with a difference degree greater than the dynamic adjustment threshold to obtain encoded differential data, includes: for each block : If its corresponding degree of difference > Dynamically adjust threshold If so, it is determined that the block has undergone significant changes and needs to be encoded. If its corresponding degree of difference ≤Dynamic adjustment threshold If the block has not changed significantly, its current frame image data references the previous frame image data. For the blocks that need to be encoded, calculate the differential data. and the difference data The data volume is compressed using Huffman coding to obtain the encoded differential data.
[0028] Preferably, in step S3, the difference data is:
[0029] in, For the first Differential data for each block; The current frame image; The previous frame image; For the first Each block.
[0030] In this invention, for each block If the corresponding If a block shows a significant change, it is considered to require encoding; the remaining blocks directly reference data from the previous frame. For blocks requiring encoding, differential data is calculated. and to Perform Huffman coding. The advantage of this setup is that it combines the "reference" and "differential + Huffman coding" methods. For static regions that have not changed, it achieves near-lossless compression by directly referencing data from the previous frame. For changing regions, differential coding eliminates inter-frame redundancy, while subsequent Huffman coding further compresses the data by utilizing the statistical properties of the differential data itself.
[0031] IV. Data Output S4. Output the data after block partitioning, the data after blockchain-like encoding, and the differential data after differential encoding.
[0032] The beneficial effects of this invention are: 1. To address the issue of detail loss caused by fixed blocks in existing technologies, this invention proposes an improved blockchain-like encoding method. This method dynamically adjusts the size and shape of image blocks and uses a chain-like structure to transmit redundant information, thereby more accurately reflecting the characteristics of different parts of the image. This allows for more detailed processing of critical areas, such as damaged parts of insulators, ensuring that this critical information is not lost during compression, thus optimizing the compression ratio while maintaining image quality.
[0033] 2. To address the inefficiency of traditional differential coding, this invention employs an enhanced differential coding strategy, combining dynamically adjusted threshold control and high-sensitivity difference detection. Only image blocks that show significant differences from the previous frame are encoded, reducing unnecessary data processing and storage. The dynamically adjusted threshold automatically adjusts according to changes in scene content, enabling the compression method to flexibly respond to different monitoring environment requirements. This method, combining improved blockchain-like coding and enhanced differential coding technology, not only significantly improves data compression efficiency but also ensures accurate monitoring and rapid response capabilities for damage to critical parts of the overhead contact line in actual operation, thus playing a crucial role in ensuring safe railway operation.
[0034] 3. An improved blockchain-like encoding method based on image content complexity function. The block partitioning method implements block size Dynamic adjustments and construction of blockchain table structure. By leveraging the correlation between adjacent blocks, information sharing and coding optimization can be achieved.
[0035] 4. Enhanced differential coding strategy, through difference degree and dynamically adjusted threshold Achieve high-precision detection of subtle changes based on global average difference. Adaptive dynamic threshold adjustment This improves the system's adaptability to different scenarios, while only applying those that meet the requirements. Differential encoding is used for blocks to reduce data redundancy. Attached Figure Description
[0036] Figure 1 This is a flowchart of the contact wire image compression method based on blockchain-like coding and differential coding according to the present invention. Detailed Implementation
[0037] The following will provide a clear and complete description of the concept, specific structure, and technical effects of the present invention in conjunction with the embodiments and accompanying drawings, so as to fully understand the purpose, features, and effects of the present invention.
[0038] A contact network image compression method based on blockchain-like coding and differential coding, such as Figure 1 As shown, it includes the following steps: Step 1: Image Preprocessing First, the raw image data of the overhead contact line. Preprocessing is performed. The preprocessing steps include: applying a Gaussian filter to the image. Filtering is performed to obtain the denoised image. Use grayscale correction functions to correct the image. Adjust the brightness and contrast to obtain the corrected image. ;right Standardization is performed to normalize the image pixel values to a range. To obtain a standardized image The normalization process is as follows:
[0039] in, For standardized images; To correct the image; To correct the minimum pixel value of the image; To correct the maximum pixel value of the image.
[0040] Step 2: Dynamic Block Adjustment and Chain Structure Construction Based on the complexity function of image content This involves adaptively partitioning the image into regions. The complexity function is defined as the magnitude of the image gradient:
[0041] in, The complexity function; To standardize images in Gradient in direction; To standardize images in Gradient in the direction.
[0042] According to the preset threshold Dynamically adjust block size :
[0043] in, Block size; For small block sizes; For large block sizes; The complexity function; This is a preset threshold.
[0044] Simultaneously, the Canny edge detection algorithm is used to obtain image feature edges, constructing irregularly shaped blocks. Adjacent blocks are then... A linked list structure is formed by connecting the links in a chain-like manner. ,in This represents the total number of blocks.
[0045] During the encoding process, only the differences are recorded. For adjacent blocks in the chain, information is shared using their statistical characteristics. Let the average gray values of adjacent blocks be... and Common features It can be represented as:
[0046] in, Common characteristics; For the current block; For neighboring blocks.
[0047] Step 3: Enhanced Differential Coding Strategy First, calculate the difference of each block. and global average difference Then according to Calculate dynamic threshold Finally, for those that meet the conditions Differential encoding is performed on the blocks.
[0048] The difference is calculated as follows: for the current frame And the previous frame The corresponding block Calculate the degree of difference :
[0049] in, For the first The degree of difference between individual blocks; For blocks The number of pixels contained; The column index for pixels; The row index of the pixel; For the first One block; The current frame image; This is the previous frame image.
[0050] Global dissimilarity is calculated by calculating the global average dissimilarity. :
[0051] in, The global average difference. The total number of blocks; For the first The degree of difference between individual blocks.
[0052] The dynamic threshold is set based on the global average difference. Dynamically adjust threshold :
[0053] in, To dynamically adjust the threshold; The adjustment coefficients are set according to the needs of the scenario; This represents the global average difference.
[0054] The difference determination and encoding are as follows: for each block If the corresponding If a block shows a significant change, it is considered to require encoding; the remaining blocks directly reference data from the previous frame. For the blocks requiring encoding, differential data is calculated. and to Huffman coding is performed to further compress the data volume, where Represented as:
[0055] in, For the first Differential data for each block; The current frame image; The previous frame image; For the first Each block.
[0056] Step 4: Data Output Output the encoded differential data and necessary block information.
[0057] The embodiments of the present invention have been described in detail above, but the present invention is not limited to the described embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention, and these equivalents or substitutions are all included within the scope defined by the claims of the present invention.
Claims
1. A method for compressing contact network images based on blockchain-like coding and differential coding, characterized in that, Includes the following steps: S1. Preprocess the contact wire image to obtain a standardized image; S2. Adaptive block division is performed on the standardized image. During block division, the block size is dynamically adjusted based on the relative size between the complexity function of the standardized image content and the preset threshold. The block shape is dynamically adjusted based on the feature edges in the standardized image. After block division, adjacent blocks are connected through a chain structure to form a linked list structure, and the blocks in the linked list structure are chain-encoded. S3. For the standardized image of the current frame and the previous frame, after performing adaptive block division, calculate the difference degree of each block and the global average difference degree of all blocks, and calculate the dynamic adjustment threshold based on the global average difference degree. Then compare the difference degree of each block with the dynamic adjustment threshold, and perform differential encoding on the blocks with the difference degree greater than the dynamic adjustment threshold to obtain the encoded differential data. S4. Output the data after block partitioning, the data after blockchain-like encoding, and the differential data after differential encoding.
2. The contact network image compression method based on blockchain-like coding and differential coding as described in claim 1, characterized in that, In step S1, the preprocessing includes: Use a Gaussian filter on the contact wire image Filtering is performed to obtain the denoised filtered image. ; Use grayscale correction functions to filter the image. Adjust the brightness and contrast to obtain the corrected image. ; For the corrected image Standardization is performed to normalize the image pixel values to a range. To obtain a standardized image .
3. The contact network image compression method based on blockchain-like coding and differential coding as described in claim 1, characterized in that, In step S2, the complexity function is defined as the magnitude of the image gradient: in, The complexity function; To standardize images in Gradient in direction; To standardize images in Gradient in the direction.
4. The contact network image compression method based on blockchain-like coding and differential coding as described in claim 1, characterized in that, In step S2, the block size is dynamically adjusted based on the relative size between the complexity function of the standardized image content and the preset threshold: in, Block size; For small block sizes; For large block sizes; The complexity function; This is a preset threshold.
5. The contact network image compression method based on blockchain-like coding and differential coding as described in claim 1, characterized in that, In step S2, the dynamic adjustment of the block shape based on the feature edges in the standardized image includes: using the Canny edge detection algorithm to obtain the feature edges in the standardized image, and constructing irregularly shaped blocks based on the feature edges.
6. The contact network image compression method based on blockchain-like coding and differential coding as described in claim 1, characterized in that, In step S2, the chain-like encoding of blocks in the linked list structure includes: recording only the differences between two adjacent blocks during the encoding process; for adjacent blocks in the linked list structure, information sharing is achieved by utilizing their common characteristics; assuming the average gray values of adjacent blocks are respectively... and Common features Represented as: in, Common characteristics; For the current block; For neighboring blocks.
7. The contact network image compression method based on blockchain-like coding and differential coding as described in claim 1, characterized in that, In step S3, the calculation of the difference degree of each block is as follows: for the current frame And the previous frame The corresponding block Calculate the degree of difference : in, For the first The degree of difference between individual blocks; For blocks The number of pixels contained; The column index for pixels; The row index of the pixel; For the first One block; The current frame image; This is the previous frame image.
8. The contact network image compression method based on blockchain-like coding and differential coding as described in claim 1, characterized in that, In step S3, the calculation of the global average dissimilarity of all blocks is as follows: in, The global average difference. The total number of blocks; For the first The degree of difference between individual blocks.
9. The contact network image compression method based on blockchain-like coding and differential coding as described in claim 1, characterized in that, In step S3, the calculation of the dynamically adjusted threshold based on the global average difference is as follows: in, To dynamically adjust the threshold; The adjustment coefficients are set according to the needs of the scenario; This represents the global average difference.
10. The contact network image compression method based on blockchain-like coding and differential coding as described in claim 1, characterized in that, In step S3, comparing the difference degree of each block with a dynamic adjustment threshold, and performing differential encoding on blocks with a difference degree greater than the dynamic adjustment threshold to obtain encoded differential data, includes: for each block : If its corresponding degree of difference > Dynamically adjust threshold If so, it is determined that the block has undergone significant changes and needs to be encoded. If its corresponding degree of difference ≤Dynamic adjustment threshold If the block has not changed significantly, its current frame image data references the previous frame image data. For the blocks that need to be encoded, calculate the differential data. and the difference data The data volume is compressed using Huffman coding to obtain the encoded differential data; The differential data are as follows: in, For the first Differential data for each block; The current frame image; The previous frame image; For the first Each block.