Image compression method
The method addresses the challenge of real-time image compression by selectively compressing pixels based on thresholds, ensuring efficient throughput and low resource usage, suitable for sensitive applications.
Patent Information
- Application Number
- FR2024007387
- Authority / Receiving Office
- FR · FR
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2026-01-09
AI Technical Summary
Existing image compression methods prioritize high compression ratios over throughput, making them unsuitable for real-time, on-the-fly applications, especially in sensitive tasks like target detection, where lossless compression is required.
A method that determines the compressibility of each pixel line and pixel based on predefined thresholds, applying compression only to compressible pixels, using predictive coding to reduce redundancy, and storing line and pixel indicators to ensure efficient data storage and transmission.
Ensures constant data throughput with low processing and memory costs, allowing for lossless compression and decompression of images in real-time, optimizing storage and transmission efficiency.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Title of the invention: Method for compressing an image TECHNICAL FIELD OF THE INVENTION
[0001] The technical field of the invention is that of digital image compression.
[0002] In particular, the invention relates to a method for compressing and decompressing digital images on the fly. TECHNOLOGICAL BACKGROUND OF THE INVENTION
[0003] A large number of applications, particularly optronic applications, involve transmitting and receiving, at high frequency, a large quantity of digital images with potentially very high resolution. This is accompanied by an increasing need for system bandwidth and memory capacity to store temporary data.
[0004] To reduce the size of data to be transmitted or received, there are image compression methods that decrease the data volume by compressing the information contained in the images, notably by exploiting the redundancy present in the images. A compression method is thus a coding operation aimed at reducing the size of image data. Conversely, image decompression is the operation aimed at reconstructing the original image from the compressed image.
[0005] When the image, once decompressed, is identical to the original image, the compression method is said to be "lossless." For sensitive applications, such as target detection in an image sequence, this type of compression is preferable. Indeed, lossy compression methods, even if they generally allow for greater data compression, are accompanied by information degradation, which can distort the processing applied to the images.
[0006] Furthermore, for certain applications, it is necessary to be able to process data in real time, that is, as it is acquired by an image sensor. For this purpose, compression can be performed "on the fly," meaning that the image data is compressed at the same rate as it is received from the image sensor. Similarly, decompression can also be performed on the fly, that is, as the (compressed) images are received.
[0007] For these applications, in addition to efficient data compression, it is essential to be able to ensure a constant data throughput.
[0008] Most existing image compression methods aim to achieve the highest possible compression ratio (i.e., to compress the data as much as possible), but few of them address the issue of throughput and are applicable for on-the-fly compression or decompression applications.
[0009] The invention improves the situation. Summary of the invention
[0010] The invention thus proposes a method for compressing and decompressing images on the fly, which requires low processing and memory costs while allowing a constant compression and decompression rate. The compressed images can therefore be stored and / or transmitted economically and efficiently.
[0011] One aspect of the invention thus relates to a computer-implemented method for compressing an image to be compressed, the image to be compressed comprising a plurality of pixel lines, in which each pixel is associated with a pixel value represented by a data point of size m, m being a strictly positive natural number, in which each pixel line is associated with a binary indicator called the line compression indicator, the method comprising:
[0012] - for each pixel line among the plurality of pixel lines, determine if a the number of non-compressible pixels in the pixel line exceeds a predefined threshold,
[0013] a non-compressible pixel corresponding to a pixel for which information associated with the pixel cannot be represented by compressed data of maximum size n, n being a strictly positive predefined integer strictly less than m,
[0014] and:
[0015] if the number of non-compressible pixels exceeds the predefined threshold, assign a first value to the line compression indicator associated with the line of pixels;
[0016] if the number of non-compressible pixels does not exceed the predefined threshold, assign a second value to the row compression indicator associated with the row of pixels and assign to each pixel of the row of pixels a respective value of a second binary indicator, called the pixel compression indicator, indicating whether the pixel is compressible or not;
[0017] - apply a compression method only to the pixels of the image to compress:
[0018] belonging to a line of pixels for which the binary line compression indicator has the second value; and
[0019] for which the values of the pixel compression indicator indicate that the pixels are compressible.
[0020] By "pixel value" is meant any value associated with a pixel of the image, for example a brightness value or a gray level value. By "Data" refers to data representing the pixel value, for example, a pixel value encoding. "Data size" refers to the number of computing units used to express the data. Thus, if the data is a bit string, the data size corresponds to the number of bits in the bit string. Data size is also called data length.
[0021] The data associated with each pixel can thus be a string of m bits, with m a strictly positive integer, representing the value of the pixel.
[0022] A non-compressible pixel is a pixel for which information associated with the pixel cannot be represented by compressed data of maximum size n, with n strictly less than the size of the uncompressed pixel. "Information" is understood to mean information derived from the data associated with the pixel.
[0023] By "compression method" is meant any prior art method for compressing data.
[0024] Thus, within the scope of the invention, it is determined whether the data associated with the pixel (or information allowing access to this data) can be compressed into a data file of size n – i.e., whether the pixel is compressible or not. It is then determined, for each line, whether the number of compressible pixels on that line is sufficiently large for the compression of the line to be worthwhile. If the number of compressible pixels is too small, it is considered that compression is not sufficiently worthwhile, and in this case, no pixels of the line are compressed. If the number of compressible pixels in the line is sufficiently large, the compressible pixels are compressed.
[0025] The pixel compression indicator makes it possible to identify, during decompression, the compressed pixels among all the pixels.
[0026] The line compression indicator, for its part, reduces the amount of information to be stored for decompression. Indeed, when the line is not compressed (i.e., no pixel of the line is compressed), it is much more advantageous, in terms of the amount of data stored, to store only a single value indicating that the line is not compressed, rather than storing a value for each pixel of the line indicating that the pixel is not compressed.
[0027] Thus, the compression process according to the invention can be seen as a "partial" compression process where only certain pixels are compressed, which makes it possible to guarantee an optimal size between the compressed size and the uncompressed size.
[0028] In particular, the compression method may be a lossless compression method.
[0029] Advantageously, the compression method used can be a fixed-size compression method n (in other words, the compressed data is fixed-size data n). It is also possible to use a compression method of variable size (particularly entropy coding methods), but this requires significantly more computing resources. Indeed, if the compression method is variable in size, decompression requires additional information or the use of complex algorithms demanding substantial resources. Such additional data could be, for example, information indicating the size of each compressed data point. Another possibility is to use an algorithm that compares the data to all expected possibilities, which represents 2m comparisons for a compressed data point of size m.
[0030] In one or more embodiments, the information associated with the pixel corresponds to a difference between the value of the pixel and a predicted value for the pixel, the predicted value for the pixel being a function of a value of a pixel belonging to a spatial or temporal neighborhood of the pixel,
[0031] In these embodiments, predictive coding is used: it is not the pixel data that is (possibly) compressed, but the differences between the pixel data and so-called "predicted" data, which are determined from a neighborhood of the pixel in question, and thus have a fairly high probability of being relatively close to the pixel value. This advantageously reduces the amount of information to be compressed, as the differences are less variable and of smaller magnitude than the data themselves.
[0032] By "neighborhood" is meant a group of one or more pixels located in a spatial or temporal neighborhood of the pixel under consideration. It is noted that the pixel itself is not part of the group. A spatial neighborhood corresponds to a group of pixels located around the pixel in the image under consideration. For example, the 3x3 neighborhood corresponds to the 3 pixels (i-1 j- , (i-1, j), (i-1, j + 1), (i, j-1), (i, j + 1), (i + 1, j-1), (i + 1, j), (j+ p j+ 0) located around the pixel (i, j). The spatial neighborhood can also be a single pixel neighboring the current pixel (i, j), for example, the pixel (i, j-1) or the pixel (i-1, j). A temporal neighborhood corresponds to a pixel (or a set of pixels) in "past" frames of a sequence of images to which the image to be compressed belongs.
[0033] In one or more embodiments, the plurality of pixel lines comprises L pixel lines, each pixel line comprising C pixel columns, with L and C two strictly positive integers, in which, for a pixel located in the i-th row and j-th column, with i and j two natural numbers such that l <i<Letl<j<C, le voisinage du pixel est un voisinage spatial comprenant un pixel voisin situé à la ieme ligne et à la (j-l)ème colonne.
[0034] In other embodiments, the image to be compressed is called the current image, the current image belongs to a temporal sequence of images, and each An image in the time sequence of images is associated with a respective instant, the instant associated with the current image being called the current instant. In these embodiments, the neighborhood is a time neighborhood, and the predicted value for the pixel is determined from a pixel value in an image of the image sequence associated with an instant strictly less than the current instant.
[0035] Thus, in these embodiments, it is assumed that the image to be compressed is an image belonging to a sequence of images I, I, ..., Ik. The neighborhood corresponds to the same pixel (i.e., the same position (i, j)) as the pixel under consideration, but in one or more images "passed" from the sequence of images (images from ..., h-ù-
[0036] For example, the neighborhood may include the pixel in question. In the previous image, the predicted value for the pixel may thus be 'p(i, j) = p(i, j), where p(i, j) corresponds to the value of pixel (i, j) in image 1. The difference is then -p(i, j) - p(i, j) where p(i, j) corresponds to the value of pixel (i, j). KK~ 1 KAA in the image to be compressed 1^
[0037] Of course, it is possible to use the values of several past images (rather than a single image / *-])•
[0038] It is noted that the preceding embodiments can be combined, and that the neighborhood can be both temporal and spatial.
[0039] In one or more embodiments, the method further comprises:
[0040] - to store, in memory:
[0041] for each pixel line of the plurality of pixel lines, the corresponding value of the binary line compression indicator;
[0042] for each line of pixels whose value of the binary line compression indicator is equal to the second value, the values of the binary pixel compression indicator of each pixel in the line;
[0043] for each compressible pixel of the image to be compressed, an associated compressed data obtained by applying the compression method;
[0044] for each non-compressible pixel of the image to be compressed, the data associated with the pixel.
[0045] The data thus stored can be retrieved by a decompression module to be decompressed and to reconstruct an image.
[0046] In one or more embodiments, n can be between 0.6 x m and 0.8 x m. In particular, m can be equal to 16 bits and n can be equal to 12 bits.
[0047] In general, the value of n can be determined according to the intended application, and by studying the percentage of image compression (i.e., the number of pixels effectively compressed) depending on the parameters of the compression process (pixel threshold S, size m of uncompressed pixels, clock frequency, etc.).
[0048] In one or more embodiments, the predefined threshold may be between 0.55 x C and 0.85 x C, where C corresponds to the number of pixels per line of pixels in the image to be compressed. In particular, the predefined threshold may be between 0.7 x C and 0.8 x C.
[0049] Another aspect of the invention relates to a computer-implemented method for decompressing data relating to an image, the image comprising a plurality of pixel lines, the method comprising:
[0050] - obtain:
[0051] a plurality of pixel data, each pixel data being associated with a respective pixel of the image;
[0052] a plurality of values of a binary line compression indicator, each value being associated with a line of pixels among the plurality of lines of pixels of the image,
[0053] each value of the binary line compression indicator being equal to a first value or a second value, the first value indicating that no pixel in the line of pixels is compressed, the second value indicating that at least one pixel in the line of pixels is compressed; and
[0054] a plurality of values of a binary pixel compression indicator, each value being respectively associated with a pixel of a line of pixels of the image for which the binary line compression indicator has the second value, the binary pixel compression indicator indicating whether the pixel is compressed or not,
[0055] a compressed pixel corresponding to a pixel associated with compressed pixel data and an uncompressed pixel corresponding to a pixel associated with uncompressed pixel data;
[0056] - among the plurality of pixel data, decompress only the data of pixels associated with compressed pixels.
[0057] By "image data" is meant a set of data, compressed or uncompressed, which represents, directly or indirectly, the pixel values of an original image. "Indirectly" means that a data item may not directly represent the pixel value, but may, for example, represent data derived from that value (in particular, the difference between the pixel value and a predicted value for the pixel in the case of predictive coding).
[0058] In one or more embodiments, the method may further comprise:
[0059] - determining an image, called the reconstructed image, from the pixel data obtained and decompressed pixel data, the reconstructed image being of the same dimensions as the image;
[0060] wherein the determination of the reconstructed image comprises, for each pixel line of the plurality of pixel lines:
[0061] if the binary line compression indicator has the first value, assign to each pixel of the decompressed image pixel line a pixel value corresponding to the pixel data obtained for the pixel;
[0062] If the binary line compression flag has the second value, assign to each pixel of the decompressed image pixel line:
[0063] a pixel value corresponding to the pixel data obtained for the pixel if the pixel compression indicator indicates that the pixel is uncompressed;
[0064] a pixel value determined from the decompressed data for the pixel if the pixel compression indicator indicates that the pixel is compressed.
[0065] By "same dimensions as the image", it is understood that the reconstructed image has the same number of rows and the same number of columns as the initial image, from which the data obtained are derived.
[0066] As previously stated, the data (which may never have been compressed or may have been compressed and then decompressed) represents, directly or indirectly, the pixel value. For example, the data may be an encoding of the value or of a difference between the value and the predicted value for the pixel. The value of a pixel can therefore be determined from this data.
[0067] In one or more embodiments, for each compressed pixel, the decompressed data represents a difference between the pixel's value in the image and a predicted value for the pixel, the predicted value for the pixel being a function of a pixel value belonging to a spatial or temporal neighborhood of the pixel, and the pixel's value in the reconstructed image is obtained by:
[0068] - determining the difference from the decompressed data; and
[0069] - summing the determined difference and the predicted value for the pixel.
[0070] In one or more embodiments, the plurality of pixel lines comprises L pixel lines, each pixel line comprising C pixel columns, with L and C two strictly positive integers, in which, for a pixel located in the i-th row and j-th column, with i and j two natural numbers such that l <i<Letl<j<C, le voisinage du pixel est un voisinage spatial comprenant un pixel voisin situé à la ieme ligne et à la (j-l)ème colonne.
[0071] In other embodiments, the reconstructed image is called the current reconstructed image, in which the current image belongs to a time sequence of reconstructed images, in which each reconstructed image in the time sequence of reconstructed images is associated with a respective instant, in which the instant associated with the current reconstructed image is called the current instant, in in which the neighborhood is a temporal neighborhood, and in which the predicted value for the pixel is determined from a pixel value in an image of the reconstructed image sequence associated with a time strictly less than the current time.
[0072] It is noted that the preceding embodiments can be combined, and that the neighborhood can be both temporal and spatial.
[0073] Another aspect of the invention relates to an image compression and / or decompression device configured to implement a compression process as defined above and / or a decompression process as defined above.
[0074] This device may be any computing module capable of implementing the above decompression process, or may comprise any computing module capable of implementing the above decompression process. Such a computing module may be, but is not limited to, a processor, or an electronic circuit such as a GPU, FPGA, or ASIC.
[0075] A computer program, implementing all or part of the process described above, installed on pre-existing equipment, is in itself advantageous.
[0076] Thus, the present invention also relates to a computer program comprising instructions for the implementation of certain steps of the compression process and / or the decompression process defined above, when this program is executed by a processor.
[0077] This program may use any programming language (for example, an object-oriented language or other), and may be in the form of interpretable source code, partially compiled code or fully compiled code.
[0078] Figures 1 and 5 described in detail below can form the flowchart of the general algorithm of such a computer program.
[0079] The invention and its various applications will be better understood by reading the following description and examining the accompanying figures. BRIEF DESCRIPTION OF THE FIGURES
[0080] Other features and advantages of the invention will become apparent from the description, which can be read in conjunction with the figures. These figures are provided for illustrative purposes only and are not intended to limit the scope of the invention.
[0081] Fig. 1 represents a method for compressing a digital image, according to an embodiment of the invention.
[0082] Fig. 2 illustrates steps of the compression process according to one embodiment.
[0083] Figure [Fig. 3] represents a determination of line and pixel compression indicators, according to one embodiment of the invention.
[0084] Figure 4 illustrates an example of data ordering from compression, according to an embodiment of the invention.
[0085] Figure 5 represents a method for reconstructing an image from decompression data, according to an embodiment of the invention.
[0086] Figures 6 and 7 represent substeps of the data decompression step in one embodiment of the invention. In particular, [Fig. 6] represents a first substep of data extraction for decompression, and [Fig. 7] represents a second substep of decompression of the data extracted in the first substep.
[0087] Figure 8 represents a compression and decompression device according to one embodiment of the invention. DETAILED DESCRIPTION
[0088] Fig. 1 represents a method for compressing a digital image, according to an embodiment of the invention.
[0089] During a step 110, various parameters enabling the implementation of the process 100 may be received. These parameters may include, in particular:
[0090] - the dimensions of the image, as well as the size m of the image pixel data of origin;
[0091] - parameters relating to the compression method used: the size n of the compressed data (i.e., the length of the data after compression, which is preferably fixed according to the invention), the compression algorithm used, parameters related to the prediction technique used (e.g., pixel neighborhood, prediction function, etc.); and
[0092] - the threshold S against which the value of the line compression indicator is compared (defined below).
[0093] In step 120, the digital image to be compressed is received, at least partially. For example, the digital image may be received directly from an image sensor. The received digital image comprises a plurality of pixels arranged in a grid of L rows and C columns, where L and C are two strictly positive natural numbers. By "received at least partially," it is understood that it is not necessary to have received the complete image to begin compression. Indeed, within the scope of the present invention, compression can be performed on the fly. This means that data relating to an image can be received and compressed as it is received. In other words, as soon as data relating to an image (for example, pixel data or data corresponding to a subset of pixels in the image) is received, it can be compressed using method 100 of [Fig. 1].
[0094] For the sake of simplicity, reference is made thereafter to "the image", but it is understood that the process applies equally well to a portion of an image (for example a pixel or a group of pixels), for on-the-fly compression and decompression applications.
[0095] Each pixel of the received digital image is associated with a pixel data point, which represents information carried by the pixel. The pixel data point is typically a light intensity value or a gray level. It is assumed hereafter that each pixel data point of the digital image to be compressed is of size m, i.e., that each pixel data point of the digital image is represented by m computer units of measurement (e.g., m bits). In what follows, the data point of the pixel (i, J) located in the i-th row and j-th column is denoted pii, j, with 1 < i < L and 1 < J. The pixel data point is also referred to as the "value" of the pixel for the sake of simplicity.
[0096] A coding technique is then applied to the pixels of the image received in step 130.
[0097] For example, the coding technique may be predictive coding of pixel data. Predictive coding is a well-known prior art coding technique in which, for each pixel in the image, the coded information corresponds to the difference between the pixel's value and a "predicted" pixel value, determined from data in a neighborhood of the pixel. The purpose of predictive coding is thus to exploit the spatial and / or temporal redundancy of information. Thus, for a pixel U-j), the coded information corresponds to the difference:
[0098] d (i, j) = p (tj) - p (i, j)
[0099] where p ( i. j ) corresponds to the predicted value for pixel ( i, j ).
[0100] The predicted value is determined from a neighborhood of the pixel (i, j). This neighborhood maybe :
[0101] - spatial: the predicted value is determined from the values of the pixels located in a predefined spatial neighborhood (e.g. a 3x3 neighborhood, or a single neighboring pixel, for example pixel (i, j-1) or pixel (i-1, j)). The predicted value is, for example, a linear combination of the values of the pixels located in the predefined neighborhood of the pixel in question;
[0102] - temporal: the image to be compressed belongs to a temporal sequence of images. The predicted value is determined from the values of the same pixel in at least one image prior to the image to be compressed. The predicted value can be the value of the pixel in the image directly preceding the image to be compressed. In this case, the information to be encoded corresponds to the difference di(j) - pii(j) - pt(i, j), where pii(j) denotes the value of pixel (i, j) in the image to be compressed (associated at time 0) and pi(j) denotes the value of pixel (i, j) in the image associated at time t-1 (where (t) is an integer non-zero natural). Of course, the predicted value can be determined from more than one previous image, for example the predicted value can be a linear combination of a plurality of previous images in the image sequence.
[0103] Referring again to Figure 1, when the compression method according to the invention is based on predictive coding, step 130 can thus include a calculation of all the differences d(i, j) for all the pixels (i, j) of the image to be coded.
[0104] In step 140, it is then determined, for each pixel of at least a subset of pixels in the image to be compressed, whether the difference d(i, J) determined in step 130 can be represented by a compressed data item of maximum size n, where n is a strictly positive natural number strictly less than m (m being the size of each pixel value in the image to be compressed). During step 140, it is also determined:
[0105] - for each line Z, 1 < / < £, of the image to be compressed, a value of an indicator binary called line compression indicator, which indicates whether the line contains compressed pixels or not. In the following, when mL(l) = 0, this means that no pixels in line 1 are compressed, and when / ) = 1, this means that at least one pixel in line 1 is compressed (more precisely, as detailed later, this means that at least a minimum number of pixels in line Z are compressed, this minimum number being equal to (C-(Sl)), with $ a predefined threshold, $ being an integer between 1 and C). Of course, these values are given by way of example and not in a limiting manner of the invention;
[0106] - for each pixel (i,j) belonging to a line for which mL(i) = 1, a The value of a binary indicator mP(i, j), called the pixel compression indicator, indicates whether the pixel is compressed or not. Hereafter, when mP(i, j) = 0, it means the pixel is incompressible or uncompressed, and when mP(i, j) = 1, it means the pixel is compressed. Again, these values are given by way of example and not in a way that limits the invention.
[0107] According to the invention, for each line Z, it is determined whether the number of "non-compressible" pixels exceeds the predefined threshold $. By non-compressible pixel, it is understood that a pixel (i, j) is defined as a pixel for which the difference di i, j) determined in step 130 cannot be represented by a data point of maximum size n (i.e., cannot be compressed into a data point of maximum size n). Hereafter, no distinction is made between "compressed into a data point of size n" and "compressed into a data point of maximum size n". It is noted that when the difference can be compressed into a data point of a size strictly less than n, padding bits can, for example, be used so that the compressed data point has a fixed size n.
[0108] If a pixel (i, j) is determined to be compressible, it is associated with a value of mP(i, j) = 1 of the pixel compression indicator. If a pixel (Z, j) is determined to be non-compressible, it is associated with a value of mP( i, j) = 0 of the pixel compression indicator.
[0109] If the number of non-compressible pixels on a line1 does not exceed the predefined threshold S, then the value / ) of the line compression indicator for line 1 is set to 1. In this case, for this line the pixel compression indicators associated with the pixels of the line are retained and indicate, for each pixel of the line, whether the pixel is compressible or not (and therefore, once the compression has been carried out in step 150, this indicator indicates whether the pixel is compressed or not).
[0110] If the number of non-compressible pixels on a line1 exceeds the predefined threshold S, then the value mL{l) of the line compression indicator for line1 is set to 0. In this case, it is decided not to compress any pixels on that line. Thus, for that line, the pixel compression indicators associated with the pixels of the line are cleared.
[0111] Then, in step 150, a compression algorithm is applied to the compressible pixels of the image, i.e., the pixels that belong to a line 1 for which = 1 and for which mP(l, j) = 1. For all other pixels, the compression algorithm is not applied. Thus, the lines of the image for which m / U) = 0 are preserved as is.
[0112] It is therefore understood that the compression algorithm is applied only to a portion of the pixels of the image to be compressed. The pixels to which the compression algorithm is applied are called "compressed pixels," and the pixels to which the compression algorithm is not applied are called "uncompressed pixels." The compressed pixels at the end of step 150 are the pixels associated with a pixel compression indicator having the value mP(i, j) = 1 at the end of step 140. The uncompressed pixels at the end of step 150 are the pixels associated with a pixel compression indicator having the value mP(i, j) = 0, as well as the pixels belonging to a row for which the value of the row compression indicator is equal to 0 at the end of step 140.
[0113] The compressed information can be, according to embodiments: - the data pii j) associated with the pixel in the initial image to be compressed; or - the difference d ( i, j ) between the data associated with the pixel in the initial image to be compressed and the predicted value.
[0114] Preferably, the compression method according to the invention is based on predictive coding, and for each compressible pixel (j, j), it is the difference d(i, j) between the pixel value (i.e., the data associated with pixel (i, j) of the initial image to be compressed) and the predicted pixel value that is compressed. For each incompressible pixel, the data p(j, j) associated with the pixel in the initial image to be compressed is preserved as is.
[0115] During step 160, data relating to the compressed image may be stored (or "written") in memory for decompression by a decompression module. This data relating to the compressed image includes information enabling the decompression module to reconstruct the original image, in particular:
[0116] - for each line l, 1 l L, of the image to be compressed, the associated value respective mL(l) of the line compression indicator;
[0117] - for each line 1 for which the line compression indicator indicates that the line is, at least partially, compressed (i.e., for which mL(l) = 1), the mP(l, j) values of the pixel compression indicator associated with all pixels in line 1 (and indicating whether the pixel is compressed or not);
[0118] - for each pixel associated with a value mP{l, j) = 1 of the indicator of pixel compression (indicating that the pixel is compressible / compressed), the compressed data associated with the pixel; and
[0119] - for each pixel (i, j) associated with a value mP(L j) = 0 of the indicator of pixel compression (indicating that the pixel is incompressible / uncompressed) or belonging to a line for which the line compression indicator indicates that no pixels in the line are compressed (i.e., for which = 0), the uncompressed data associated with the pixel - i.e., the initial pixel data of the image to be compressed.
[0120] The different data can be written in a specific order, known at the level of the decompression module, so that the latter can reconstruct the image from the data. An example of a data writing order resulting from compression is illustrated in [Fig. 4] described below.
[0121] Figure 2 illustrates steps in the compression process according to a method of realization.
[0122] In Figure 2, the top grid represents a portion of the pixel grid of the image to be compressed, for which the differences have been calculated (according to step 130 of Figure 1). A cross (X) indicates that the difference at the considered pixel is compressible to a data point of size n, and a circle (O) indicates that the difference at the considered pixel is not compressible to a data point of size n. The middle grid represents the same portion of the pixel grid, in which each cell contains the value mp(i, j) of the associated pixel compression indicator, before comparison of the number nbNC(l) of incompressible pixels on row 1 at the threshold S. The bottom grid represents the same portion of the pixel grid, in which each cell contains the value mP(i, j) of the associated pixel compression indicator, after comparison of the number nbNC(l) of incompressible pixels on row 1 at the threshold.
[0123] In the example of Figure 2, the number nb^ck 1 ) of non-compressible pixels on the line / = 1 is less than the threshold S. The line is therefore "compressible" (i.e. some of its pixels will be compressed during step 150 of Figure 1) and the associated value of the line compression indicator is mL( 1 ) = 1. The values mP( 1, j ) of the pixel compression indicators are preserved.
[0124] The number nbNC(Z) of non-compressible pixels on the line / = 2 is greater than or equal to the threshold -5. The line is therefore "non-compressible" (i.e. none of its pixels will be compressed during step 150 of Figure 1) and the associated value of the line compression indicator is mL(2) = 0. The values mp(2, _ / ) of the pixel compression indicators are therefore overwritten.
[0125] Figure 3 represents a determination of the line compression indicators and pixel (step 140 of the process in [Fig. 1]), according to an embodiment of the invention.
[0126] Step 1410 corresponds to an initialization step of the so-called "current" line 1: l = 1. During step 1410, the value of the associated line compression indicator is also set to mL(l} - 1.
[0127] At step 1415, a counter nbNC(l) allowing the number of non-compressible pixels on line 1 to be counted is initialized: nbNC(l) - 0.
[0128] Then, in step 1420, a value for the column index j of pixel (i, j) is fixed. For the first iteration of step 1420 (for a fixed value1), this value is set to j = 1. At each subsequent iteration of step 1420 for a fixed value1, the value of the index j is incremented by one.
[0129] In step 1425, it is determined whether the pixel (i = l, j) - called the "current" pixel - is compressible or not. As indicated above with reference to [Fig. 1], this amounts to determining whether the data associated with the current pixel (or data derived from this data, for example the difference between the pixel value and the predicted value) can be compressed into a data of size n.
[0130] If the current pixel is compressible (output of step 1425, arrow "Y"), the value of the pixel compression indicator associated with the pixel is set to 1 in the example considered (step 1455).
[0131] If the current pixel is not compressible (output of step 1425, arrow "N"), the nbNC(l) counter is incremented by one unit (step 1430) and it is determined whether this updated counter reaches the predefined threshold S (test 1435).
[0132] If the updated counter nbNC(l) is strictly less than the threshold S (output of test 1435, arrow "N"), the value of the pixel compression indicator associated with the pixel is set to 0 in the example considered (step 1440).
[0133] It is then checked whether there are any pixels remaining in the line to be processed, i.e., whether the column index j of the current pixel corresponds to the number of columns C of the image to be compressed (step 1445). If there are any pixels remaining to be processed on the current line 1 (exit of step 1445, arrow) "N"), the column index j of the pixel is incremented by one (step 1420) and step 1425 is implemented again for the new value of j. If there are no more pixels to process on the current line 1 (output of step 1445, arrow "Y"), it is checked, in step 1450, whether there are any lines left to process (i.e., whether the current value 1 is equal to the number of lines L of the image to be compressed).
[0134] If there are still lines to be processed (exit from step 1450, arrow "N"), the line index 1 is incremented by one, and this new line is assigned a line compression indicator value of 1 (step 1455). Then, step 1415 is performed again for the new current line. If there are no lines to be processed (exit from step 1450, arrow "Y"), the determination stops (step 1460).
[0135] If the nbNC(l) counter updated in step 1430 is greater than or equal to the threshold S (output of test 1435, arrow "Y"), then the line is indicated as incompressible: the associated value of the line compression indicator mL(l) is set to 0 (step 1465) and all previously determined pixel compression indicator values for pixels in the current line1 are cleared (step 1470). In the example in Figure 3, no further pixels in the current line1 are considered (it is indeed unnecessary to test the compressibility of subsequent pixels, since the line will not be compressed anyway). Thus, step 1450 is directly implemented to check if there are any lines remaining to be processed, as described above.
[0136] Figure 4 illustrates an example of data sequencing from compression, according to an embodiment of the invention. Such sequencing allows the data to be stored in a particular order during step 160 of Figure 1.
[0137] As mentioned above, the data resulting from the compression (allowing the decompression module to reconstruct the partially compressed image) can be written to memory by the compression module in a predefined order, this order being known to the decompression module. Thus, the decompression module can decompress the data it receives on the fly.
[0138] Indeed, it is understood from the above that the data is received by the decompression module in three streams: a stream on the compressibility of the lines (the values), a stream on the compressibility of the pixels if applicable (the mP(l, j) values), and a stream on the values of the pixels (compressed or uncompressed). In order to perform on-the-fly decompression, the decompression module must have simultaneous access to information from all three streams. However, these three streams are not processed at the same speed by the decompression algorithm. Moreover, according to a particular architecture, these three data streams are read into a single memory via a single physical port. The scheduling algorithm thus allows for the scheduling the arrival of information from the different streams in such a way that the decompression module always has access to the data it needs.
[0139] In the example in Figure 4, the values of the line compression indicators mL(l) are first written, at step 1605, into a system memory, for all values of 1 (corresponding to image data already received). Each value can be written as a bit. Thus, at step 1605, L bits are written into memory.
[0140] Then a current value of 1 is fixed (step 1610). At the first iteration of step 1610, / = 1. Then, at each new iteration of step 1610, the value of 1 is incremented by one until all the rows have been processed.
[0141] It is then checked whether the current line 1 is a compressible line (step 1615).
[0142] If line 1 is compressible (output of step 1615, arrow "Y"), a current value of the column index j of the pixel is fixed (step 1620). This value is equal to 1 at the first iteration of step 1620, and it is incremented by one at each subsequent iteration. For each value of j, the value mP(L j) of the pixel flag associated with the pixel (l, j) is written into memory (step 1625). This value of the pixel compression flag can be written as a bit. Then the information carried by the pixel (l, j) is written into memory (step 1630). In the case of a compressible line, the information carried by a pixel corresponds either to the uncompressed data or to the compressed data (depending on the value of mP( l, / )).For a compressed pixel, n bits are written to memory, and for an uncompressed pixel, m bits are written to memory. Thus, when line 1 is compressible, the values are . C + [nbNC(l) xm + (C-nbNC{1)) xn] bits that are written into memory for the C pixels of the line, considering that the value of the compression flag is written in the form of a bit.
[0143] If the line is not compressible (exit from step 1615, arrow "N"), the information carried by the pixels is written at step 1630, in ascending order 1, 2, ..., C of the pixel column numbers. In the case of a non-compressible line, the information carried by the pixel corresponds to uncompressed data (initial pixel data or the difference between the pixel value and the predicted value). In this case, Cxm bits are written to memory at step 1630.
[0144] At the end of step 1630, if there are still lines to be processed, the value of 1 is incremented by one unit (step 1610) and steps 1615, 1620, 1625 and 1630 are repeated.
[0145] In one or more embodiments, the pixel indicator data (if any) and pixel values (compressed or uncompressed) can be written to memory in blocks of B bits, where B is the number of bits that can be read at each memory read access. This means that, for decompression, The decompression module retrieves a block of B bits to be processed (decompressed) with each read.
[0146] It is noted that the order shown in the example in [Fig. 4] is provided by way of example, but does not constitute a limitation of the invention. Other orders may be used. It is only important that this order be known at the level of the decompression module.
[0147] Figure 5 represents a method for reconstructing an image from decompression data, according to an embodiment of the invention.
[0148] In the process of reconstructing an image from decompression data (more simply called the "decompression process") of [Fig. 5], decompression data is received in a first step 210. By "decompression data" is meant a set of data relating to a compressed or partially compressed image and enabling the reconstruction of that image.
[0149] The decompression data corresponds to the compression data written to memory during step 160 of the compression process in [Fig. 1]. This decompression data therefore includes:
[0150] - a plurality of mL(1) values of the line compression indicator, each value being associated with a respective line of the compressed image;
[0151] - a plurality of mP{l, j) values of the pixel compression indicator; and
[0152] - a plurality of pixel data, each pixel data being respectively associated with a pixel of the compressed image.
[0153] The decompression data is typically retrieved (or “read”) from the memory in which the data was written at the end of the compression process of [Fig.1] (step 160).
[0154] In step 220, decompression of the compressed pixel data is implemented. To this end, the received pixel data is identified as corresponding to compressed pixels. This identification is carried out using the line compression indicator values and the pixel compression indicator values.
[0155] Finally, in step 230, an image reconstruction is performed using the received uncompressed data, as well as the data compressed and decompressed in step 220. The reconstructed image has the same dimensions as the original image, and therefore comprises a plurality of pixels arranged in a grid of L rows and C columns. Thus, in step 230, the retrieved and possibly decompressed data is placed in a grid of L x C pixels to form the decompressed image.
[0156] In embodiments of the invention, step 220 of decompressing the received data may comprise two sub-steps:
[0157] - a first substep 220a of data extraction for the purpose of decompression; and
[0158] - a second substep 220b of decompressing the data extracted at the first sub-step 220a.
[0159] It is noted that in the context of on-the-fly compression and / or decompression, the two substeps 220a and 220b are performed in parallel. More precisely, data retrieval 220a can be a succession of read accesses to memory, and decompression 220b can be performed as needed, based on the data read, without waiting for all the data to be read.
[0160] Examples of implementation of these two substeps 220a, 220b are shown in Figures 6 and 7.
[0161] Figure 6 represents an example of implementation of a first substep 220a of data extraction for decompression, according to an embodiment of the invention.
[0162] In the example in Figure 6, it is assumed that the compression data was written according to the ordering in Figure 4. In this example, the decompression module is configured to retrieve the first L bits of the data stored in memory and place them in a first buffer (step 2202). These first L bits correspond to the L line indicator values respectively associated with the L lines of the image. Once these L bits have been retrieved, the first bit of the next memory read corresponds to the pixel compression indicator value of pixel (1,1).
[0163] In some embodiments, the compression data is read from memory by successive memory read accesses, and during each read access, B bits are retrieved, with B defined as previously with reference to [Fig. 4]. These bits retrieved during successive reads are distributed into a second buffer reserved for pixel compression indicators, and into a third buffer reserved for pixel data.
[0164] More specifically, a value of 1 l L, is fixed at step 2204. During the first iteration of this step 2204, the value is fixed at l = 1. At each subsequent iteration, the value of 1 is incremented by one unit.
[0165] It is determined, from the value ) retrieved in step 2202 (bit in position 1 in the first buffer), whether line 1 is compressed or not (step 2206).
[0166] If line 1 is compressed (output of step 2206, arrow "Y"), the data retrieved from memory (in blocks of B bits) is distributed into a second buffer reserved for pixel compression indicators, and into a third buffer reserved for pixel data.
[0167] More precisely, the value of the first bit of the retrieved B-bit block is examined. This bit corresponds to a value of the pixel compression flag (Z, j). This bit is placed in the second buffer (step 2208) and, depending on its value, the following n or m bits are placed in the third buffer.
[0168] More precisely, if this bit indicates that the pixel corresponds to a compressed pixel, n bits are placed in the third buffer (step 2210). If the bit indicates that the pixel corresponds to an uncompressed pixel, m bits are placed in the third buffer (step 2210).
[0169] If line 1 is not compressed (exit from step 2206, arrow "N"), C xm bits are placed in the third buffer (step 2210). Steps 2204, 2206, 2208, 2210 are repeated until no more data remains in memory.
[0170] It is noted that since memory reads are done in blocks of B bits, with B fixed, some strings of m or n bits may be "straddling" two successive read accesses.
[0171] Figure 7 represents a second substep 220b of data decompression extracted in the first sub-step 220a, according to an embodiment of the invention.
[0172] At step 2230, a bit is read from the first buffer. As mentioned above, the bits in the first buffer correspond to the values, for the different lines, of the line compression flag.
[0173] If the bit indicates that the line is not compressed (step 2232, arrow "N"), then C xm bits are retrieved from the third buffer and the pixels of the current line are reconstructed (step 2234). In this case, each group of m bits corresponding to a pixel (l, j) corresponds to the initial data associated with the pixel (Z, j) in the original image, and this group of pixels is translated and displayed as a corresponding value in the reconstructed image.
[0174] If the bit indicates that the line is compressed (step 2232, arrow "Y"), a bit is retrieved from the second buffer (step 2236). This bit corresponds to the value of the pixel compression flag (Z, j) of the current line l. Depending on the value of this bit, n or m bits from the third buffer are processed.
[0175] Thus, it is determined, from this value of the line compression indicator mP(l, j) read in the second buffer, whether the corresponding pixel (Z, j) is compressed or not (step 2238).
[0176] If the pixel is not compressed (exit from step 2238, arrow "N"), m bits are read from the third buffer and the current pixel is reconstructed (step 2240), similarly to step 2234 described above. At the end of steps 2234, 2240, and 2248, the processed bits can be removed from the various buffers.
[0177] It is then checked whether the current pixel (Z, j) corresponds to the last pixel of the line, i.e. if j -C (step 2242).
[0178] If the current pixel ( / , j ) corresponds to the last pixel of the line (step 2242, arrow "Y"), it is then checked whether the current line corresponds to the last line (step 2244), i.e. whether there is still data to be processed in the first buffer.
[0179] If the current line corresponds to the last line to be processed (step 2244, arrow "Y"), the decompression stops: the image is completely reconstructed. Otherwise (step 2244, arrow "Y"), step 2230 is repeated with the next bit of the first buffer.
[0180] If the current pixel (l, j) does not correspond to the last pixel of the line (step 2242, arrow "N"), step 2236 is repeated with the next bit of the second buffer.
[0181] If the current pixel is compressed (output of step 2238, arrow "Y"), n bits are read from the third buffer (step 2248), then decompressed using a decompression technique, and the current pixel is reconstructed (step 2250). Thus, step 2250 can include the following steps:
[0182] - decompress the compressed data (on n bits) into a single data decompressed of m bits, the decompressed data corresponding to the difference 4 ( / , j) = p^ j) -p(l, j) in the original image;
[0183] - determine the pixel value: p(l, j) = d(l, j) + p(l, j), j) is calculated for example from past images of a sequence of images or with respect to the value of a neighboring pixel (for example p(l, j) = p( l, j - 1 ) ) ;
[0184] - translate and display the pixel value in the reconstructed image.
[0185] Step 2242 is then implemented as described above.
[0186] It is noted that at least some steps of [Fig. 6] and [Fig. 7] can be implemented in parallel. Indeed, the buffers can be read and the data decompressed as the buffers are filled. These steps can also be implemented in parallel with the compression process of [Fig. 1]. Indeed, the lines can be decompressed as the corresponding data is added to memory in step 160. In particular, in some embodiments, the data can be read and decompressed at a rate corresponding to the clock frequency of the processor implementing the decompression process. The clock frequency indicates how frequently the various buffers and memory are updated. Decompression can advantageously be performed with each update, based on the new data.
[0187] Figure [Fig.8] represents a compression and / or decompression device 800 according to an embodiment of the invention.
[0188] The device 800 shown in [Fig.8] includes a memory 801 for storing compression data determined by a compression process according to the invention.
[0189] The device 800 further includes a circuit 802. This circuit 802 can be, for example, any computing or data processing module, such as an FPGA, a PLD, a GPU, an ASIC, or a microcontroller.
[0190] The circuit 802 can be configured to implement, according to embodiments, a compression process and / or a decompression process according to the invention. In other words, the circuit 802 can perform the role of the compression module and / or the role of the decompression module.
[0191] The device 800 includes an input interface 803 for receiving the image to be compressed. For example, this input interface can be connected to a sensor configured to acquire images and transmit them to the circuit 802 via the input interface 803. The sensor can be part of the device 800. The device 800 can also include an output interface 804 for providing the decompressed image, or information obtained by processing the decompressed image (for example, the coordinates of a target).
[0192] Furthermore, the functional diagrams shown in Figures 1 and 5 are examples of programs some instructions of which can be carried out by device 800.
[0193] In some embodiments, the device 800 may comprise two separate circuits, each circuit being connected to the memory 801: a circuit dedicated to compression and a circuit dedicated to decompression. The circuit dedicated to compression is configured to compress the received data (including on-the-fly data) according to the process detailed above and store it in the memory 801. The circuit dedicated to decompression is configured to read the compressed data from the memory 801 and decompress it via the decompression process described above. Alternatively, the compressed data may be directly transferred, via the compression circuit, to the decompression circuit for decompression.
[0194] Of course, the present invention is not limited to the embodiments described above by way of example.
Claims
Demands
1. A computer-implemented method (100) for compressing an image to be compressed, the image to be compressed comprising a plurality of pixel lines, wherein each pixel is associated with a pixel value represented by a data item of size m, m being a strictly positive natural number, wherein each pixel line is associated with a binary indicator called the line compression indicator, the method comprising: - for each pixel line among the plurality of pixel lines, determining whether a number of incompressible pixels in the pixel line exceeds a predefined threshold, an incompressible pixel corresponding to a pixel for which information associated with the pixel cannot be represented by a compressed data item of maximum size n, n being a strictly positive predefined integer strictly less than m, and: ■ if the number of incompressible pixels exceeds the predefined threshold,assign (140) a first value to the line compression indicator associated with the pixel line; ■ if the number of incompressible pixels does not exceed the predefined threshold, assign (140) a second value to the line compression indicator associated with the pixel line and assign to each pixel in the pixel line a respective value of a second binary indicator, called the pixel compression indicator, indicating whether the pixel is compressible or not; - apply (150) a compression method only to the pixels of the image to be compressed: ■ belonging to a pixel line for which the binary line compression indicator has the second value; and ■ for which the values of the pixel compression indicator indicate that the pixels are compressible.
2. A method according to claim 1, wherein the information associated with the pixel represents a difference between the value of the pixel and a predicted value for the pixel, the predicted value for the pixel being a function of a value of a pixel belonging to a spatial or temporal neighborhood of the pixel.
3. A method according to any one of the preceding claims, further comprising: - storing (160), in a memory: ■ for each line of pixels in the plurality of lines of pixels, the corresponding value of the binary line compression indicator; ■ for each line of pixels whose value of the binary line compression indicator is equal to the second value, the values of the binary pixel compression indicator of each pixel in the line; ■ for each compressible pixel of the image to be compressed, an associated compressed data obtained by application of the compression method; ■ for each non-compressible pixel of the image to be compressed, the data associated with the pixel.
4. A computer-implemented method (200) for decompressing data relating to an image, the image comprising a plurality of pixel lines, the method comprising: - obtaining (210): ■ a plurality of pixel data, each pixel data being associated with a respective pixel of the image; ■ a plurality of values of a binary line compression indicator, each value being associated with a line of pixels among the plurality of pixel lines of the image, each value of the binary line compression indicator being equal to a first value or a second value, the first value indicating that no pixel of the pixel line is compressed, the second value indicating that at least one pixel of the pixel line is compressed;and ■ a plurality of values of a binary pixel compression indicator, each value being respectively associated with a pixel in a line of pixels of the image for which the binary line compression indicator has the second value, the binary pixel compression indicator indicating whether the pixel is compressed or not, a compressed pixel corresponding to a pixel associated with compressed pixel data and an uncompressed pixel corresponding to a pixel associated with uncompressed pixel data; - among the plurality of pixel data, decompress (220) only the pixel data associated with compressed pixels.
5. A method according to the preceding claim, further comprising: - determining (230) an image, called the reconstructed image, from the obtained pixel data and the decompressed pixel data, the reconstructed image being of the same dimensions as the image; wherein the determination of the reconstructed image comprises, for each pixel line of the plurality of pixel lines: ■ if the binary line compression indicator has the first value, assigning to each pixel of the pixel line of the decompressed image a pixel value corresponding to the pixel data obtained for the pixel; ■ if the binary line compression indicator has the second value, assigning to each pixel of the pixel line of the decompressed image: a pixel value corresponding to the pixel data obtained for the pixel if the pixel compression indicator indicates that the pixel is uncompressed;a pixel value determined from the decompressed data for the pixel if the pixel compression indicator indicates that the pixel is compressed.
6. A method according to claim 5, wherein, for each compressed pixel, the decompressed data represents a difference between the pixel value in the image and a predicted value for the pixel, the predicted value for the pixel being a function of a pixel value belonging to a spatial or temporal neighborhood of the pixel, wherein the pixel value in the reconstructed image is obtained by: - determining the difference from the decompressed data; and - summing the determined difference and the predicted value for the pixel.
7. Image compression and / or decompression device (800) configured to implement a compression method according to any one of claims 1 to 3 and / or a decompression method according to any one of claims 4 to 6.
8. Product computer program comprising instructions to implement the compression process according to any one of claims 1 to 3 and / or the decompression process according to any one of claims 4 to 6 when this program is executed by a processor.
Citation Information
Patent Citations
Image compression method with random access capability
US20110292247A1
Image encoding device and image encoding method
US20130251257A1
Image data encoding device and method
US9741318B2