A ted s image lossless compression method and system based on adaptive difference

By using an adaptive differential method, which dynamically adjusts the differential gain by combining local spatiotemporal activity and response hysteresis, the problem of low compression efficiency of TEDS images is solved, and efficient lossless compression is achieved.

CN121442089BActive Publication Date: 2026-03-27HUITIE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-04
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing lossless image compression techniques struggle to adapt to changes in local texture complexity when processing TEDS images, resulting in large prediction errors and low compression efficiency.

Method used

An adaptive differential method is adopted, which dynamically adjusts the differential gain coefficient by calculating the local spatiotemporal activity and response hysteresis, and combines it with the median edge detection algorithm to perform image prediction and residual coding.

Benefits of technology

It effectively suppresses overshoot error in areas of abrupt texture change, improving the image compression ratio and lossless compression efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121442089B_ABST
    Figure CN121442089B_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of image processing, and particularly relates to a TEDS image lossless compression method and system based on adaptive difference, which comprises the following steps: obtaining original gray data stream collected by TEDS trackside equipment, and establishing a space-time mapping reference; calculating local space-time activity based on space-time neighborhood pixel difference, and obtaining response lag by comparing with historical reference data; determining adaptive difference gain coefficient according to the response lag, and obtaining a final prediction value by weighted summation of the basic prediction value and the pixel at the previous spatial position using the coefficient; and calculating prediction residual and performing entropy coding. By introducing a physical response lag model, the present application dynamically adjusts the prediction gain, improves the prediction problem of non-stationary signals in the skin flat area and the mechanical assembly complex area of the EMU image, suppresses the prediction overshoot, reduces the residual dynamic range, and improves the efficiency of lossless compression.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology. More specifically, this invention relates to a lossless image compression method and system based on adaptive difference (TEDS). Background Technology

[0002] TEDS (Trouble of Moving EMU Detection System) uses high-speed linear array cameras installed along the trackside to scan and image high-speed moving EMUs line by line to identify potential faults. Because TEDS generates massive amounts of image data at high speeds, efficient lossless compression of the acquired image data stream is typically required to alleviate pressure on transmission bandwidth and storage space.

[0003] Existing lossless image compression techniques employ a predictive coding framework, in which the median edge detection algorithm is the basic prediction method. This algorithm detects edge direction by analyzing the relationship between the left, top, and top-left neighboring pixels of a pixel, and predicts the gray value of the current pixel accordingly.

[0004] However, TEDS images possess unique non-stationary signal characteristics, containing both large areas of smooth-textured vehicle skin and complex mechanical components such as bogies with rich high-frequency details. The MED algorithm has certain limitations when processing such images. Due to its relatively fixed prediction logic, it lacks the ability to adapt to changes in the local texture complexity of the image. When faced with drastic grayscale fluctuations or complex textures in the mechanical component regions of TEDS images, the MED algorithm often struggles to accurately track signal changes, easily leading to misjudgments and large prediction errors. This results in large and discretely distributed prediction residuals, reducing the compression efficiency of subsequent entropy coding. Summary of the Invention

[0005] To address the aforementioned technical problem of poor image compression performance in TEDS, the present invention provides solutions in the following aspects.

[0006] In a first aspect, the present invention provides a lossless compression method for TEDS images based on adaptive difference, comprising:

[0007] The process involves: acquiring the raw grayscale data stream collected by the TEDS trackside device; calculating the local spatiotemporal activity of any coordinate based on the grayscale difference and spatiotemporal distance of neighboring pixels; obtaining the response hysteresis based on the ratio of the local spatiotemporal activity to the historical local spatiotemporal activity; determining the adaptive differential gain coefficient of the coordinate based on the response hysteresis value, wherein the adaptive differential gain coefficient is negatively correlated with the response hysteresis; calculating the basic predicted value of any coordinate based on the grayscale difference of neighboring pixels; performing a weighted summation of the basic predicted value and the grayscale value of the spatiotemporal neighboring coordinate to obtain the final predicted value of the coordinate, wherein the adaptive differential gain coefficient is used to determine the weight of the basic predicted value; obtaining the prediction residual of the coordinate based on the difference between the final predicted value and the original grayscale value of the coordinate; constructing a prediction residual matrix from the prediction residuals of each coordinate; performing residual encoding on the prediction residual matrix; and packaging and outputting a compressed bitstream.

[0008] This invention calculates the local spatiotemporal activity and introduces the concept of response hysteresis to obtain the degree of deviation of the current signal fluctuation relative to historical inertia. By dynamically adjusting the differential gain coefficient using the response hysteresis, the prediction strategy is made to adaptively switch between full structure prediction and neighborhood preservation. This suppresses overshoot error in texture abrupt change regions and reduces the dynamic range of prediction residuals, thereby improving the image compression ratio while ensuring lossless data restoration.

[0009] Preferably, the local spatiotemporal activity satisfies the expression:

[0010] ;

[0011] In the formula, Representing coordinates Local spatiotemporal activity at a given location; Representing coordinates The set of spatiotemporal neighborhood coordinates at a given location; Representing coordinates The average gray value of the set of spatiotemporal neighborhood coordinates at a given location; Representing coordinates The pixel grayscale value at that location; Indicates the dimensional correction factor; This represents the absolute value function.

[0012] This invention eliminates the difference in physical dimensions between longitudinal temporal sampling and lateral spatial sampling by introducing a dimensional correction factor, and uses the reciprocal of the spatiotemporal distance as a weight, so that the neighboring points closer to the current pixel have a greater impact on the activity assessment, and can more accurately reflect the intensity of the signal in the spatiotemporal dimension of a certain coordinate point in the linear array image.

[0013] Preferably, the acquisition of the response hysteresis includes:

[0014] Obtain the average value of multiple historical local spatiotemporal activities along the time axis within a preset historical reference duration;

[0015] The ratio of the local spatiotemporal activity of the coordinates to the average value is used as the response hysteresis.

[0016] Preferably, the adaptive differential gain coefficient satisfies the expression:

[0017] ;

[0018] In the formula, Representing coordinates Adaptive differential gain coefficient at the location; Indicates the base prediction gain; Representing coordinates The response lag at the location; This represents the sensitivity adjustment constant.

[0019] This invention constructs a negative feedback adjustment model to map the unbounded physical response hysteresis into a normalized adaptive differential gain coefficient. This allows the system to automatically reduce the gain coefficient when complex texture abrupt changes are detected, entering a conservative mode, reducing reliance on structure prediction, and preventing prediction divergence; conversely, it maintains high gain in flat regions. This ensures that the prediction strength matches the current physical signal state, avoiding the failure of a single prediction mode in complex scenarios.

[0020] Preferably, the basic predicted value of the arbitrary coordinates satisfies the expression:

[0021] ;

[0022] In the formula, Representing coordinates The base forecast value at the location; , representing the original grayscale value collected by the sensor at position x-1 at sampling time y; , representing the original grayscale value collected by the sensor at position x at sampling time y-1; , represents the original grayscale value collected by the sensor at position x-1 at sampling time y-1.

[0023] This invention utilizes an improved median edge detection logic as the basic prediction method. By analyzing the size relationship of the left, top, and top-left neighboring pixels, it can automatically identify horizontal, vertical, or flat region features in an image. Since the pipes, crossbeams, and other components at the bottom of a high-speed train typically exhibit a clear geometric distribution, this invention can capture the orientation of these basic structures, providing a high-precision benchmark value for the final weighted prediction.

[0024] Preferably, the final predicted value satisfies the expression:

[0025] ;

[0026] In the formula, Representing coordinates The final predicted value at; Representing coordinates Adaptive differential gain coefficient at the location; Representing coordinates The base forecast value at the location; This represents the original grayscale value collected by the sensor at position x-1 at sampling time y.

[0027] This invention utilizes adaptive differential gain coefficients as weights to mix the geometrically based base prediction with the inertial component of the physically nearest preceding pixel value. In regions with fragmented or extremely complex textures, the system automatically increases the weight of the nearest neighbor pixel, using spatial correlation to suppress errors; in regions with clear structures, it relies on geometric prediction.

[0028] Preferably, obtaining the prediction residual of the coordinates includes:

[0029] The difference between the original grayscale value of the coordinate and the rounded value of the final predicted value is used as the prediction residual of the coordinate.

[0030] Preferably, the coordinates The set of spatiotemporal neighborhood coordinates at a given location includes:

[0031] , , , , Indicates and The coordinates of the previous spatial position at the same sampling time. Indicates and The coordinates of the previous sampling time at the same spatial location. , They are in The left and right adjacent coordinates of the x-space position at the previous sampling time.

[0032] Preferably, the step of constructing a prediction residual matrix from the prediction residuals of each coordinate, performing residual encoding on the prediction residual matrix, and packaging and outputting a compressed bitstream includes:

[0033] Obtain the prediction residual matrix and convert it into a one-dimensional data stream. Then, use the entropy coding algorithm to encode the residual data to obtain compressed residual data.

[0034] The basic prediction gain, sensitivity adjustment constant, and dimensional correction factor are standardized and encoded to form the parameter information header;

[0035] The parameter information header and residual compressed data are concatenated and packaged to output a complete compressed bitstream.

[0036] Secondly, the present invention provides a TEDS image lossless compression system based on adaptive difference, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the aforementioned TEDS image lossless compression method based on adaptive difference is implemented.

[0037] By adopting the above technical solution, a computer program is generated from the aforementioned TEDS image lossless compression method based on adaptive difference and stored in the memory so that it can be loaded and executed by the processor. This allows for the creation of a terminal device based on the memory and processor, making it convenient to use.

[0038] The beneficial effects of this invention are as follows: Based on the characteristics of linear scan images, the complexity changes of the mechanical structure are quantitatively assessed by calculating the ratio of current local activity to historical inertia (hysteresis). A negative feedback mechanism is constructed using this hysteresis to dynamically adjust the weighting coefficients between structured prediction (MED) and neighborhood inertia preservation. This method solves the problem that traditional linear predictors cannot simultaneously adapt to smooth skins and complex components, effectively suppresses overshoot errors in abrupt regions, and significantly improves lossless compression efficiency. Attached Figure Description

[0039] Figure 1 This is a flowchart illustrating an adaptive difference-based TEDS image lossless compression method according to the present invention;

[0040] Figure 2 This is a schematic diagram illustrating the raw grayscale data stream of TEDS.

[0041] Figure 3 This is a schematic diagram illustrating the local spatiotemporal activity distribution corresponding to the visualization of the original grayscale data stream of TEDS;

[0042] Figure 4 This is a schematic diagram illustrating the response hysteresis distribution corresponding to a visual representation of the original grayscale data stream of TEDS.

[0043] Figure 5 This is a schematic diagram illustrating the distribution of predicted residuals corresponding to a visualization of the original grayscale data stream of TEDS. Detailed Implementation

[0044] This invention discloses a lossless TEDS image compression method based on adaptive difference, referring to... Figure 1 This includes steps S1-S4:

[0045] S1: Obtain the raw grayscale data stream collected by the TEDS trackside device. The raw grayscale data stream contains grayscale values ​​of several coordinates, and establish a spatiotemporal mapping reference.

[0046] It should be noted that TEDS uses a high-speed linear array camera mounted on the trackside to perform line-by-line scanning imaging of high-speed trains operating at speeds exceeding 300 km / h. Unlike traditional area array imaging, the data generated by TEDS is not generated instantaneously in frames, but rather accumulated over time in pixel rows. To meet the requirements of real-time lossless compression, this invention treats the continuous scan data as a dynamic spatiotemporal matrix, and the algorithm processing follows a strict streaming sequence, making it impossible to predict future scan rows. Therefore, establishing accurate spatiotemporal coordinate definitions is a prerequisite for subsequent causal analysis.

[0047] Specifically, the process involves acquiring the raw grayscale data stream collected by the TEDS trackside device. This raw grayscale data stream contains grayscale values ​​for several coordinates. A spatiotemporal mapping reference is then established, including:

[0048] The raw grayscale data stream is obtained through the TEDS trackside device and denoted as a matrix. .

[0049] Define matrix In The physical dimensions are as follows: the vertical axis y represents the discrete sampling time during the train's movement; the horizontal axis x represents the spatial position of the sensor. Within the same sampling time y, the data is read out serially in ascending order of x. This represents the original grayscale value collected at sensor position x at sampling time y. Representing coordinates The original pixel grayscale value at that location.

[0050] Set dimensional correction factor It is used to eliminate differences in spatiotemporal dimensions. ,in, The vertical physical sampling interval is expressed in mm / line. This represents the horizontal physical sampling interval, in mm / pixel. It should be noted that when... When the pixel is square, the pixel is square; when When this occurs, it indicates that the train is moving too fast or the scan is too slow, causing the image to be stretched vertically; when At this time, the image is compressed vertically. Exemplarily, the present invention... .

[0051] It should be noted that, as Figure 2This is a visualization of the raw grayscale data stream from TEDS. The horizontal axis corresponds to the spatial sampling position of the sensor, the vertical axis corresponds to the time sampling moment of the train's movement, and the color bars represent the grayscale value of each pixel, ranging from 0 to 255. This constructs a mapping relationship between spatiotemporal coordinates and grayscale values.

[0052] At this point, the original grayscale data stream was obtained, and a spatiotemporal processing benchmark for streaming data was established.

[0053] S2: Calculate the local spatiotemporal activity of any coordinate based on the grayscale difference and spatiotemporal distance of the spatiotemporal neighboring pixels; obtain the response hysteresis of any coordinate based on the difference in local spatiotemporal activity between the arbitrary coordinate and historical reference data; determine the adaptive differential gain coefficient of the coordinate based on the response hysteresis value of the arbitrary coordinate.

[0054] It should be noted that in TEDS images, the texture changes slowly in the skin region, exhibiting spatiotemporal stability, while the bogie and other mechanical component regions have more high-frequency details, exhibiting dramatic spatiotemporal fluctuations. Traditional linear predictors typically use fixed prediction coefficients, making it difficult to adapt to this transition from stable to abrupt states simultaneously. They are prone to noise in the stable region and overshoot errors in the abrupt region. Therefore, this invention introduces a physical response hysteresis model, which assesses the current mechanical structure complexity by using the ratio of current instantaneous fluctuations to historical inertial fluctuations, thereby adaptively controlling the aggressiveness of the predictor.

[0055] Specifically, based on the grayscale differences and spatiotemporal distances of pixels in the spatiotemporal neighborhood, the local spatiotemporal activity at any coordinate is calculated, including:

[0056] It should be noted that, in order to capture instantaneous high-frequency features such as cracks and bolt edges, this invention first constructs a spatiotemporal hybrid neighborhood of the current pixel. The spatiotemporal hybrid neighborhood follows the causal law and only includes the left-hand pixel that has been processed at the current moment and the previous row pixel that has been cached at the previous moment.

[0057] Get coordinates The set of spatiotemporal neighborhood coordinates of a location, wherein the spatiotemporal neighborhood coordinates include , , , .in, Indicates and The coordinates of the previous spatial position at the same sampling time. Indicates and The coordinates of the previous sampling time at the same spatial location. , They are in The left and right adjacent coordinates of the x-space position at the previous sampling time.

[0058] It should be noted that the greater the pixel difference within the spatiotemporal neighborhood coordinate set of any coordinate, the greater the local spatiotemporal activity of that coordinate. Furthermore, coordinates that are spatiotemporally closer to the coordinate have a greater impact on the evaluation of its local spatiotemporal activity. Therefore, the local spatiotemporal activity of any coordinate is constructed.

[0059] Get coordinates The average gray value of the set of spatiotemporal neighborhood coordinates at a given location.

[0060] The local spatiotemporal activity at any coordinate satisfies the expression:

[0061] ;

[0062] In the formula, Representing coordinates Local spatiotemporal activity at a given location; Representing coordinates The set of spatiotemporal neighborhood coordinates at a given location; Representing coordinates The average gray value of the set of spatiotemporal neighborhood coordinates at a given location; Representing coordinates The pixel grayscale value at that location; Indicates the dimensional correction factor; This represents the absolute value function.

[0063] In the formula, Representing coordinates The absolute deviation of the pixels in the spatiotemporal neighborhood coordinate set at a given location from the local grayscale mean; the larger this deviation, the closer the distance to the coordinates. Before that pixel, the signal had already begun to fluctuate violently; This means that the reciprocal of the spatiotemporal distance between the spatiotemporal neighborhood coordinates is used as the weight; the closer the distance, the greater the weight, thus having a greater impact on the local spatiotemporal activity at the x-th spatial location at the y-th sampling time. By converting the vertical row index difference into an equivalent horizontal pixel distance, the physical dimension of spatiotemporal distance is unified. It accumulates the fluctuation information of coordinates in various spatiotemporal neighborhoods and comprehensively represents the local spatiotemporal activity at the x-th spatial location and the y-th sampling time.

[0064] It should be noted that, as Figure 3This is a local spatiotemporal activity distribution map corresponding to the visualization diagram of the TEDS raw grayscale data stream. Each color in the color bar represents a local spatiotemporal activity value, ranging from 0 to 35. The horizontal axis corresponds to the spatial sampling position of the sensor, and the vertical axis corresponds to the time sampling moment of the train's movement. It shows the local spatiotemporal activity value corresponding to each coordinate position in the visualization diagram of the TEDS raw grayscale data stream. The higher the local spatiotemporal activity in the figure, the more dramatic the grayscale changes and the richer the high-frequency details; the lower the local spatiotemporal activity, the more stable the regional texture.

[0065] Preferably, the response lag of any coordinate is obtained based on the difference in local spatiotemporal activity between any coordinate and historical reference data, including:

[0066] It should be noted that the gradient energy at a single point is easily affected by imaging noise. In order to accurately distinguish between random noise and structural abrupt changes, this invention compares the current local spatiotemporal activity with the historical inertia accumulated along the time axis. Abrupt changes in physical signals often have anti-inertial characteristics. If the current local fluctuations far exceed the long-term historical average fluctuations, it indicates that a new component edge or foreign object has been detected.

[0067] A historical reference duration is set to compare the local spatiotemporal activity of the coordinates being evaluated. For example, the historical reference duration is 5 sampling times.

[0068] The response hysteresis at any coordinate satisfies the expression:

[0069] ;

[0070] In the formula, Representing coordinates The response lag at the location; Representing coordinates Local spatiotemporal activity at a given location; Indicates the duration of historical reference; Representing coordinates The local spatiotemporal activity at the t-th sampling time; This indicates a small positive value, used to avoid a denominator of 0. For example, .

[0071] In the formula, This indicates the time axis is used to represent the past. The average local spatiotemporal activity at each sampling moment represents the structural inertia of the train's mechanical structure along the direction of travel; Representing coordinates The relative spatiotemporal activity at a location; the larger the value, the stronger the coordinate. The signal activity at that location has exceeded that of the past. The inertial reference established at a given moment indicates that a new mechanical component edge or foreign object has been detected. A value of approximately 1 indicates that the coordinates... In the continuation of the structure, the smaller this value, the stronger the coordinates. The activity level at this location is lower than historical inertia, indicating that the structure has moved from a rough region to a relatively smooth region.

[0072] It should be noted that, as Figure 4 This is a response hysteresis distribution diagram corresponding to the visualization of the TEDS raw grayscale data stream. Each color in the color bar represents a response hysteresis value, ranging from 0 to 1.75. The horizontal axis in the diagram corresponds to the spatial sampling position of the sensor, and the vertical axis corresponds to the time sampling time of the train's movement. It shows the response hysteresis value corresponding to each coordinate position in the visualization of the TEDS raw grayscale data stream.

[0073] Preferably, determining the adaptive differential gain coefficient of the coordinates based on the response hysteresis value of any coordinate includes:

[0074] It should be noted that the construction of the adaptive differential gain coefficient follows the principle of negative feedback adjustment. In flat skin regions, a high prediction gain should be maintained to make full use of spatial correlation for data compression; in complex component regions, the gain should be reduced to suppress prediction overshoot and prevent error amplification.

[0075] The adaptive differential gain coefficient for arbitrary coordinates satisfies the following expression:

[0076] ;

[0077] In the formula, Representing coordinates Adaptive differential gain coefficient at the location; Indicates the base prediction gain; Representing coordinates The response lag at the location; This represents the sensitivity adjustment constant.

[0078] It should be noted that, Used to set the maximum predictive strength of the system, for example, Set to 1 to achieve full prediction; Used to control the rate of gain decay. The larger the value, the more conservative the system is in responding to changes in response lag. For example, .

[0079] In the formula, This means normalizing the unbounded response lag to ; This causes the response lag to increase. Tend to This causes the subsequent predictor to switch from an aggressive mode to a conservative mode, which is more inclined to directly use the neighborhood value rather than forcibly extrapolate, thereby adapting to the non-stationary signal changes in TEDS images caused by the high-speed movement of the train. This represents the final gain value after modulating the basic prediction gain using an attenuation factor based on response hysteresis, ensuring that the prediction strength adapts to the current physical signal state. It dynamically converges within a certain range, thereby adapting to the non-stationary signal changes in TEDS images caused by the high-speed movement of the train.

[0080] At this point, the adaptive differential gain coefficients for each coordinate have been obtained.

[0081] S3: Based on the grayscale difference of pixels in the spatiotemporal neighborhood, calculate the basic predicted value of any coordinate; using the adaptive differential gain coefficient as the weighting basis, perform a weighted summation of the basic predicted value of any coordinate and the grayscale value of the spatiotemporal neighborhood coordinate to obtain the final predicted value of the coordinate; based on the difference between the final predicted value of any coordinate and the original grayscale value, obtain the prediction residual of the coordinate.

[0082] It should be noted that the core objective of lossless compression is to minimize the information entropy of the residual signal. To achieve this objective while ensuring lossless reversibility, this invention employs a two-stage prediction strategy. First, the classic MED (median-edge detector) algorithm is used to obtain the basic structure prediction. Then, an adaptive differential gain coefficient is used to weight and correct the basic prediction, thereby effectively avoiding large residuals caused by misjudgments in complex texture areas with high response lag due to the MED algorithm.

[0083] Specifically, based on the grayscale differences of pixels in the spatiotemporal neighborhood, the basic predicted value for any coordinate is calculated, including:

[0084] It should be noted that the MED predictor automatically detects edge directions using three known pixels: left, top, and top-left. These three pixels are correlated with the coordinates of their spatiotemporal neighborhood. , and Consistent. Since the pipes, crossbeams, and other components at the bottom of the EMU (Electric Multiple Unit) typically exhibit obvious horizontal or vertical geometric distribution characteristics, this algorithm can accurately capture the orientation of these structures, providing a precise benchmark for subsequent differential calculations.

[0085] Will Let it be 'a', and... Let it be denoted as b, and Let it be denoted as c.

[0086] Indicates and The coordinates of the previous spatial position at the same sampling time. Indicates and The coordinates of the previous sampling time at the same spatial location. , They are in The left and right adjacent coordinates of the x-space position at the previous sampling time.

[0087] The basic predicted value for any coordinates satisfies the expression:

[0088] ;

[0089] In the formula, Representing coordinates The base forecast value at the location; , representing the original grayscale value collected by the sensor at position x-1 at sampling time y; , representing the original grayscale value collected by the sensor at position x at sampling time y-1; , represents the original grayscale value collected by the sensor at position x-1 at sampling time y-1.

[0090] In the formula, At that time, corresponding to the vertical edge, take This is the best estimate; When the corresponding horizontal edge is reached, b is taken as the best estimate; For flat areas, planar prediction is used. .

[0091] Preferably, the final predicted value of the coordinates is obtained by weighting the base predicted value and the gray value of the spatiotemporal neighborhood coordinates based on the adaptive differential gain coefficient, including:

[0092] It should be noted that although the MED algorithm is sensitive to edges, it is prone to misjudgment in noisy regions or complex texture areas with high local spatiotemporal activity. Considering that spatiotemporal neighborhood coordinates can serve as a relatively robust estimation basis, this invention uses an adaptive differential gain coefficient to combine the basic predicted value and the grayscale value of the spatiotemporal neighborhood coordinates.

[0093] The final predicted value at any coordinate satisfies the expression:

[0094] ;

[0095] In the formula, Representing coordinates The final predicted value at; Representing coordinates Adaptive differential gain coefficient at the location; Representing coordinates The base forecast value at the location; This represents the original grayscale value collected by the sensor at position x-1 at sampling time y.

[0096] In the formula, This represents the basic prediction components based on structural analysis; This represents the inertial retention component based on proximity correlation; This indicates that the adaptive differential gain coefficient is used as the weighting basis to allocate weights to the base prediction value and the inertia hold component. This value means that when the response lag is large, the adaptive differential gain coefficient is small, and the final prediction value will transition to a smaller value. This means that when the vertical correlation becomes unreliable due to texture fragmentation, the horizontal neighboring pixels are usually the reference points with the closest physical distance and the strongest correlation. This can suppress prediction divergence in complex regions and reduce the dynamic range of the residuals.

[0097] Preferably, the prediction residual of the coordinates is obtained based on the difference between the final predicted value and the original grayscale value of any coordinate, including:

[0098] It should be noted that the core constraint of lossless compression is that the decoding end can reconstruct the original data where every bit is identical. Therefore, the calculation of the residual must be based on the rounded predicted value to eliminate the uncertainty of floating-point operations.

[0099] The prediction residuals for any coordinates satisfy the expression:

[0100] ;

[0101] In the formula, Representing coordinates Predicted residuals at the location; Representing coordinates The original grayscale value at that location; Representing coordinates The final predicted value at; This represents the rounding function.

[0102] It should be noted that on the decoding side, due to It relies solely on historical data for calculation, therefore the decoder can reproduce it completely. Perform the inverse operation It can restore the original pixels.

[0103] It should be noted that, as Figure 5This is a visualization diagram of the TEDS raw grayscale data stream, corresponding to the prediction residual distribution. Each color in the color bar represents a prediction residual value, ranging from -100 to 100. The horizontal axis in the diagram corresponds to the spatial sampling position of the sensor, and the vertical axis corresponds to the time sampling moment of the train's movement. It shows the prediction residual value corresponding to each coordinate position in the visualization diagram of the TEDS raw grayscale data stream, demonstrating the prediction effect of the present invention. The smaller the prediction residual value, the greater the degree of removal of redundant information in the original image.

[0104] At this point, the predicted residuals for each coordinate have been obtained.

[0105] S4: Construct a prediction residual matrix from the prediction residuals of each coordinate, perform residual encoding on the prediction residual matrix, and package and output a compressed bitstream.

[0106] It should be noted that after obtaining the prediction residuals, the high-dimensional spatial redundancy of the original grayscale data stream has been removed, and the generated residual matrix exhibits the characteristics of a Laplace distribution, with most values ​​being 0 or... Small integers are more common than large integers. Fixed-length coding is less efficient for this distribution characteristic, while variable-length coding achieves a higher compression ratio.

[0107] Specifically, the prediction residuals of each coordinate are used to construct a prediction residual matrix, the prediction residual matrix is ​​residual encoded, and then packaged and output as a compressed bitstream, including:

[0108] The predicted residual matrix is ​​obtained and converted into a one-dimensional data stream. The residual data is then encoded using an entropy coding algorithm to obtain compressed residual data. For example, the entropy coding algorithm uses Golomb-Rice coding.

[0109] The compressed bitstream satisfies the expression:

[0110] ;

[0111] In the formula, Indicates a compressed bitstream; For the file header, containing ; This indicates the number of horizontal values ​​in the prediction residual matrix. This indicates the number of vertical numerical values ​​in the predicted residual matrix; This represents the sensitivity adjustment constant; Indicates the base prediction gain; Indicates the dimensional correction factor; This represents the compressed residual data.

[0112] It should be noted that the lossless restoration process at the decoding end depends entirely on the transmission of the above parameters. The decoder reads... Then, the distance can be calculated. The weights used are exactly the same as those used at the encoding end, thereby reproducing the local spatiotemporal activity. and response hysteresis Finally, the corresponding value for each pixel is calculated. and Combined with the decompressed This method enables lossless reconstruction of TEDS images. The process eliminates the need to transmit the adaptive differential gain coefficients for each pixel, thus saving bitrate.

[0113] This completes the lossless compression of TEDS images based on adaptive difference.

[0114] This invention also discloses a lossless TEDS image compression system based on adaptive difference, including a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement a lossless TEDS image compression method based on adaptive difference according to the present invention.

[0115] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.

[0116] While this specification has shown and described numerous embodiments of the invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Many modifications, alterations, and alternatives will occur to those skilled in the art without departing from the spirit and essence of the invention. It should be understood that various alternatives to the embodiments of the invention described herein may be employed in the practice of this invention.

Claims

1. A lossless image compression method based on adaptive difference (TEDS), characterized in that, include: Acquire the raw grayscale data stream collected by the TEDS trackside equipment; Based on the grayscale difference and spatiotemporal distance of pixels in the spatiotemporal neighborhood, the local spatiotemporal activity of any coordinate is calculated. The response lag is obtained based on the ratio of the local spatiotemporal activity to the historical local spatiotemporal activity. Based on the response hysteresis value, the adaptive differential gain coefficient of the coordinates is determined, and the adaptive differential gain coefficient is negatively correlated with the response hysteresis. Based on the grayscale differences of pixels in the spatiotemporal neighborhood, calculate the basic predicted value for any coordinate; The gray values ​​of the base predicted value and the spatiotemporal neighborhood coordinates are weighted and summed to obtain the final predicted value of the coordinates. The adaptive differential gain coefficient is used to determine the weight of the base predicted value. Based on the difference between the final predicted value and the original gray value of any coordinate, the prediction residual of the coordinate is obtained; The prediction residuals of each coordinate are used to form a prediction residual matrix. The prediction residual matrix is ​​then residual encoded and packaged into a compressed bitstream.

2. The TEDS image lossless compression method based on adaptive difference according to claim 1, characterized in that, The local spatiotemporal activity satisfies the expression: ; In the formula, Representing coordinates Local spatiotemporal activity at a given location; Representing coordinates The set of spatiotemporal neighborhood coordinates at a given location; Representing coordinates The average gray value of the set of spatiotemporal neighborhood coordinates at a given location; Representing coordinates The pixel grayscale value at that location; Indicates the dimensional correction factor; This represents the absolute value function.

3. The TEDS image lossless compression method based on adaptive difference according to claim 1, characterized in that, The acquisition of the response hysteresis includes: Obtain the average value of multiple historical local spatiotemporal activities along the time axis within a preset historical reference duration; The ratio of the local spatiotemporal activity of the coordinates to the average value is used as the response hysteresis.

4. The TEDS image lossless compression method based on adaptive difference according to claim 1, characterized in that, The adaptive differential gain coefficient satisfies the expression: ; In the formula, Representing coordinates Adaptive differential gain coefficient at the location; Indicates the base prediction gain; Representing coordinates The response lag at the location; This represents the sensitivity adjustment constant.

5. The TEDS image lossless compression method based on adaptive difference according to claim 1, characterized in that, The basic predicted value for any coordinate satisfies the expression: ; In the formula, Representing coordinates The base forecast value at the location; , representing the original grayscale value collected by the sensor at position x-1 at sampling time y; , representing the original grayscale value collected by the sensor at position x at sampling time y-1; , representing the original grayscale value collected by the sensor at position x-1 at sampling time y-1.

6. The TEDS image lossless compression method based on adaptive difference according to claim 1, characterized in that, The final predicted value satisfies the expression: ; In the formula, Representing coordinates The final predicted value at; Representing coordinates Adaptive differential gain coefficient at the location; Representing coordinates The base forecast value at the location; This represents the original grayscale value collected by the sensor at position x-1 at sampling time y.

7. The TEDS image lossless compression method based on adaptive difference according to claim 1, characterized in that, The acquisition of the predicted residuals of the coordinates includes: The difference between the original grayscale value of the coordinate and the rounded value of the final predicted value is used as the prediction residual of the coordinate.

8. The TEDS image lossless compression method based on adaptive difference according to claim 2, characterized in that, The coordinates The set of spatiotemporal neighborhood coordinates at a given location includes: , , , , Indicates and The coordinates of the previous spatial position at the same sampling time. Indicates and The coordinates of the previous sampling time at the same spatial location. , They are in The left and right adjacent coordinates of the x-space position at the previous sampling time.

9. A lossless TEDS image compression method based on adaptive difference according to claim 2 or 4, characterized in that, The step of constructing a prediction residual matrix from the prediction residuals of each coordinate, performing residual encoding on the prediction residual matrix, and packaging and outputting a compressed bitstream includes: Obtain the prediction residual matrix and convert it into a one-dimensional data stream. Then, use the entropy coding algorithm to encode the residual data to obtain compressed residual data. The basic prediction gain, sensitivity adjustment constant, and dimensional correction factor are standardized and encoded to form the parameter information header; The parameter information header and residual compressed data are concatenated and packaged to output a complete compressed bitstream.

10. A TEDS image lossless compression system based on adaptive difference, characterized in that, include: A processor and a memory, the memory storing computer program instructions that, when executed by the processor, implement a lossless TEDS image compression method based on adaptive difference according to any one of claims 1-9.

Citation Information

Patent Citations

  • Transform-based spatial-temporal spectrum combined aurora spectral image lossless compression method

    CN119450083A

  • KR20240168409A