This application claims priority from European Patent Application No. 16306837.2 entitled, “METHOD AND APPARATUS FOR ENCODING AND DECODING LISTS OF PIXELS”, filed on Dec. 28, 2016, the contents of which are hereby incorporated by reference in its entirety.
The present disclosure relates to the domain of encoding and decoding relations between pixels of an image for example when a clustering of pixels of an image is used at different stages of an image or video processing pipeline.
Pixel clustering is a mandatory step in a wide set of image and video processing pipelines. Gathering pixels of an image (and a fortiori of each images of a video sequence) in clusters is a preparatory operation for a broad variety of computation. For example, in computer vision, image segmentation is the process of partitioning a digital image into multiple segments (sets of pixels, also known as super-pixels). Another example is given by multi-view or plenoptic images. Such images are arrays of images of a same view captured from different point of views. These images are commonly used for numerous reconstruction techniques (refocusing, 3D reconstruction or photogrammetry, for example).
Such an operation may be very time and resource consuming according to the relationships to detect or to estimate between pixels and according to the size and the number of images. For instance, in multi-view images, retrieving a cluster of pixels associated with a common point in the three-dimension space is a very complex process.
An image processing pipeline is composed of a connection of image processing applications which may be executed by different devices at different nodes of a network. A same pixel clustering may be useful for different stages of the processing. Efficiently encoding, decoding and scanning such clusters of pixel is required in order to avoid having to compute the clustering several times at several nodes in the pipeline. A first way to encode pixel clusters consists in building a list of list of integers: for each cluster, listing the indices of its pixels. Another way consists in encoding a matrix of integers of the same size than the image, storing for each pixel of the image, an identifier of the cluster that the pixel belongs to. These approaches have two main drawbacks. First data they generate are not prepared for lossless compression and, as a consequence will offer a low compression rate. Second, they are not adapted to a quick scanning of the image and of the clusters at the same time. There is a lack for an encoding and a decoding methods which overcome these drawbacks.
4. SUMMARY
The purpose of the present disclosure is to overcome the lack of an encoding and decoding method to store, compress and transmit lists of pixels of an image.
The purpose of the present disclosure is to overcome the lack of an encoding and decoding method to store, compress and transmit lists of pixels of an image.
The present disclosure relates to a method of encoding lists of pixels of an image in a matrix of integers. The matrix is created with the same size than the image. The method comprises, for a first pixel at a first index in the image and this pixel belonging to a list of the pixel lists:
The advantage of the method is to generate a matrix that is easy to compress with image lossless compression methods with a high level of compression, in particular when the lists of pixels are sorted in ascending or descending order of indices of their pixels.
In an embodiment, the integer to be encoded equals the second index. For multi-view images or for computer vision for instance, the matrix contains gradients of integers with clear borders. Such a low frequency matrix is compressed with a very high level of compression by image lossless compression methods.
In another embodiment, the integer to be encoded is the difference between the second index and the first index, optionally modulo the size of the matrix. For multi-view images or for computer vision for instance, the matrix large regions of a same integer. Here again, this type of matrix is compressed with a very high level of compression by image lossless compression methods.
According to a specific characteristic, the method further comprising transmitting the image associated with the matrix to a destination medium, the destination medium being a local or a remote module or device.
The present disclosure also relates to a method of decoding lists of pixels of an image from a matrix of integers. The matrix has a size equal to the size of the image. The method comprises, for a first pixel at a first index in the image, the first pixel belonging to a list of pixels:
According to this method each list of pixels is decoded and scanned at the same time. Such a representation of relationship between pixels allows computing nodes of an image processing pipeline to access circular lists of pixels.
According to a specific characteristic, a list is created and initialized with the first pixel.
The present disclosure also relates to an apparatus configured for encoding lists of pixels of an image in a matrix of integers, the matrix having a size equal to the size of the image and the apparatus comprising a memory associated with at least one processor configured to, for a first pixel at a first index in the image, this first pixel belonging to a first list of said pixel lists:
The present disclosure also relates to an apparatus configured for decoding lists of pixels of an image from a matrix of integers, the matrix having a size equal to the size of the image, the apparatus comprising, a memory associated with at least one processor configured to, for a first pixel at a first index in the image, said pixel belonging to a list of said lists of pixels:
The present disclosure will be better understood, and other specific features and advantages will emerge upon reading the following description, the description making reference to the annexed drawings wherein:
The subject matter is now described with reference to the drawings, wherein like reference numerals are used to refer to like elements throughout. In the following description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the subject matter. It is understood that subject matter embodiments can be practiced without these specific details.
It is usual in the domain of image processing to encode coordinates of a pixel as an integer index. The index is calculated as the number of the pixel when scanning the image on a row base (according to equations [1]) or on a column base (according to equations [2]). This encoding as several advantages. First coordinates are represented by one integer instead of two and the indices are ordered in a way which reflects a scanning operation: comparing two indices is a quick calculus that says if a pixel is before or after another pixel in a given scanning In this document, a pixel index is the equivalent of pixel coordinates as it is simple and common to convert an index in coordinates and reciprocally when knowing the width and the height of the image and the chosen scanning method.
n=x+w*y {x=n % w; y=(n−x)/w} [1]
n=y+h*x{y=n % h; x=(n−y)/h} [2]
It will be appreciated that those skilled in the art will be able to devise various arrangements that, although not explicitly described or shown herein, embody the principles of the disclosure.
According to a non-limitative embodiment of the present principles, a method and a device to encode lists of pixels of an image are disclosed. The pixels of an image are clustered according to at least one relationship. It is usual, because of the technical nature of the memory of computers, to store clusters or sets in general as lists of items. A list, for example a list of pixels, may be sorted according to an ordering, for example in the ascending or descending order of the pixel's indices in the image. According to the present principles, a matrix of integers of the same size (w*h) than the image is generated. A pixel P1 of the image at the index N1 belongs to one list L. The next pixel in list L is a pixel P2 which has the index N2 in the image. An integer is calculated according to N1 and/or N2 and is stored at the index N1 in the matrix. The integer is calculated according to at least of the two indices N1 and N2. The integer to encode in the matrix is obtained relatively to a group of indices comprising at least one of the index of P1 and the index of P2. For instance, this integer is N2. In a variant, this integer is N2-N1. This method is further described in details on example calculus and special cases. The generated matrix may then be compressed according to a lossless compression method and may be associated with the image (which may be compressed too). They may be transmitted to a next stage of the image or video processing pipeline.
According to another non-limitative embodiment of the present principles, a method and a device to decode lists of pixels of an image are disclosed. An image of size (w*h) and a matrix of integers of the same size (w*h) are received as input. These data are potentially compressed and, if so are decompressed using an appropriate decompression method. A pixel P1 of the image with the index N1 is associated with a list L of pixels. Different embodiments of this initial association are further described in detail in this description. An index N2 is calculated according to the integer I at index N1 in the matrix and the pixel P2 at index N2 in the image is set as the pixel next to P1 in the list L. For instance, N2 is I. In a variant, N2=N1+I. This method allows a quick scanning of the pixels of the list L. In other words, the present method allows a fast scanning of all of the pixels of the image associated to P1 in the list L. The index N2 is calculated according to at least of the one of the values of the index N1 and the integer I. The index N2 is obtained relatively to a group of values comprising at least one of the index of P1 and the integer I read in the matrix at the index N1.
Clusters 11 and 12 are connected groups of pixels while clusters 13 and 14 are composed of several distinct regions of the image. Clusters have been formed by an algorithm according to a relationship between pixels of the image. In the example of
According to the present principles, decoding a matrix of integers allows the decoder to retrieve the lists of pixels. So, it is not needed to calculate the relationship between pixels again. If it has been compressed, the matrix is first decompressed using the appropriate decompression algorithm. The method begins by considering an integer in the matrix at a position that has not been decoded yet. At the very first step, the integer at index 0, for example, is considered. A new list is created and initiated with pixel 0: La={0}. The integer at index 0 in the matrix is read and the index of the next pixel in the list is calculated according to the integer, 1 in the present example, and the index actually considered, 0 in the present example. In the embodiment illustrated on
The integer at position 16 is read and the next pixel in the list is calculated. In the present example, the pixel 2 is added to the list Lb. This operation is iterated until pixel 16 is determined as the next pixel in the list. When all indices have been considered (all pixels has been added to a list), every lists have been reconstructed.
In a variant, for each list, a data is generated pairing the index of one pixel of the list with information relative to the list. A set of these data is transmitted in association with the matrix. In this variant, the decoding method creates lists described by the data and start decoding them at the paired index.
At the decoding, lists are retrieved form the decompressed matrix as in the embodiment described for
Advantageously, the device 50 is connected to one or more display devices (not represented) of display screen type directly to the graphics card 55 to display images calculated in the graphics card. In a variant, the one or more display device is connected to the graphic card 55 via the bus 52.
It is noted that the word “register” used in the description of memories 53, 54 and 55 designates in each of the memories mentioned, both a memory zone of low capacity (some binary data) as well as a memory zone of large capacity (enabling a whole program to be stored or all or part of the data representative of data calculated or to be displayed).
When switched-on, the microprocessor 51, according to the program in a register of the ROM 53, loads and executes the instructions of the program in registers of the RAM 54.
According to one particular embodiment, the algorithms implementing the steps of the method specific to the present disclosure and described hereafter are advantageously stored in a memory GRAM of the graphics card 55 associated with the device 50 implementing these steps.
According to a variant, the power supply 56 is external to the device 50.
In initialization steps 61 and 62, lists of pixels of an image are obtained. In the present document, obtaining data, like lists of pixels, has to be understood as receiving the data from a source. For example, the source belongs to a set comprising:
In step 61, the size of the image is obtained and the image itself may be obtained too. Advantageously, the lists of pixels are sorted, for example, in the ascending order of the pixel indices. In step 62, a matrix of integers of the same size than the image is created in the RAM 54 of the device 50. It may be initialized with a default integer value, for example zero. In a variant, the matrix is created in the memory of the graphic board 55 and lists are processed by the GPU.
In step 63, a pixel P1 of a list L is considered. It is for example the first pixel of the first list. This pixel is located at a position with an index I1 according to a scanning mode in the image. The present method is selecting the pixel P2 next to P1 in the list L. P2 is located at a position with the index I2 in the image. In step 64, an integer value V is computed according to I1 and I2; for example, V=I2. In a variant V=I2−I1. In another variant V=(I2−I1) % (W x H) where W is the width of the image (or the matrix) and H the height of the image (or the matrix). Any function of I1 and I2 may be used as long as the function for retrieving I2 for given V and I1 is known by (or transmitted to) the decoder. In step 65, the value V is stored in the matrix at the position with the index L. Advantageously, a new pixel that has not yet been considered is selected to be P1 and the method is iterated at step 63. This new pixel may be the actual P2. If the new pixel is the last pixel of a list, then the next pixel in the list is the first pixel of the list. When every pixel of a list has been considered, the method may be repeated for a pixel in another list. This operation is advantageously repeated until all pixels of all lists have been considered.
In step 66, the matrix may be compressed by an image lossless compression method and may be associated to the image to be transmitted to another module of an image processing pipeline. Other data may be transmitted via the same means or different means, for example parameters representative of the function used to compute the matrix.
In initialization step 71, a matrix of integers is obtained from a source. Optionally, the matrix is in a compressed form and is first decompressed using the appropriated image lossless decompression method. In variants, additional data are obtained jointly or separately to the matrix. For example, an image of the same size than the matrix may be obtained. Data pairing description of a list with a pixel of the list may be obtained. For instance, parameters representative of a function used to encode the lists of pixels is also obtained from the same or from a different source.
In step 72, a pixel P1 at index I1 in the image is considered. This pixel is known to belong to a list L. If needed, a new list of pixels is created and initialized with pixel P1. The integer value V is read in the matrix at index L. As the matrix has the same size than the image, this index always exists. In step 73, a second index I2 is calculated according to I1 and V; for example, I2=V. In a variant I2=V+L. In another variant I2=(V+I1) % (W x H) where W is the width of the image (or the matrix) and H the height of the image (or the matrix). In step 74, the pixel P2 at index I2 in the image is added to the list L as the pixel next to P1 in the list. Advantageously, a new pixel that has not yet been considered is selected to be P1 and the method is iterated at step 72. This new pixel may be the actual P2. If the new pixel is the first pixel of the list, then the list has been entirely decoded and scanned; the method selects a pixel of the image which has not been considered yet. When all pixels of the image have been considered, all the lists have been decoded and scanned.
Naturally, the present disclosure is not limited to the embodiments previously described. In particular, the present disclosure is not limited to method of coding and decoding lists of pixels but also extends to any method of transmitting and scanning lists of pixels encoded as a matrix of integers. The implementation of calculations necessary to encode and decode lists of pixels is not limited either to an implementation in shader type microprograms but also extends to an implementation in any program type, for example programs that can be executed by a CPU type microprocessor. The use of the methods of the present disclosure is not limited to a procedural implementation but also extends to implementations in parallel using several microprocessors.
The implementations described herein may be implemented in, for example, a method or a process, an apparatus, a software program, a data stream, or a signal. Even if only discussed in the context of a single form of implementation (for example, discussed only as a method or a device), the implementation of features discussed may also be implemented in other forms (for example a program). An apparatus may be implemented in, for example, appropriate hardware, software, and firmware. The methods may be implemented in, for example, an apparatus such as, for example, a processor, which refers to processing devices in general, including, for example, a computer, a microprocessor, an integrated circuit, or a programmable logic device. Processors also include communication devices, such as, for example, Smartphones, tablets, computers, mobile phones, portable/personal digital assistants (“PDAs”), and other devices that facilitate communication of information between devices and/or end-users.
Implementations of the various processes and features described herein may be embodied in a variety of different equipment or applications, particularly, for example, equipment or applications associated with data encoding, data decoding, view generation, texture processing, and other processing of images and related texture information and/or depth information. Examples of such equipment include an encoder, a decoder, a post-processor processing output from a decoder, a pre-processor providing input to an encoder, a video coder, a video decoder, a video codec, a web server, a set-top box, a laptop, a personal computer, a cell phone, a PDA, and other communication devices. As should be clear, the equipment may be mobile and even installed in a mobile vehicle.
Additionally, the methods may be implemented by instructions being performed by a processor, and such instructions (and/or data values produced by an implementation) may be stored on a processor-readable medium such as, for example, an integrated circuit, a software carrier or other storage device such as, for example, a hard disk, a compact diskette (“CD”), an optical disc (such as, for example, a DVD, often referred to as a digital versatile disc or a digital video disc), a random access memory (“RAM”), or a read-only memory (“ROM”). The instructions may form an application program tangibly embodied on a processor-readable medium. Instructions may be, for example, in hardware, firmware, software, or a combination. Instructions may be found in, for example, an operating system, a separate application, or a combination of the two. A processor may be characterized, therefore, as, for example, both a device configured to carry out a process and a device that includes a processor-readable medium (such as a storage device) having instructions for carrying out a process. Further, a processor-readable medium may store, in addition to or in lieu of instructions, data values produced by an implementation.
As will be evident to one of skill in the art, implementations may produce a variety of signals formatted to carry information that may be, for example, stored or transmitted. The information may include, for example, instructions for performing a method, or data produced by one of the described implementations. For example, a signal may be formatted to carry as data the rules for writing or reading the syntax of a described embodiment, or to carry as data the actual syntax-values written by a described embodiment. Such a signal may be formatted, for example, as an electromagnetic wave (for example, using a radio frequency portion of spectrum) or as a baseband signal. The formatting may include, for example, encoding a data stream and modulating a carrier with the encoded data stream. The information that the signal carries may be, for example, analog or digital information. The signal may be transmitted over a variety of different wired or wireless links, as is known. The signal may be stored on a processor-readable medium.
A number of implementations have been described. Nevertheless, it will be understood that various modifications may be made. For example, elements of different implementations may be combined, supplemented, modified, or removed to produce other implementations. Additionally, one of ordinary skill will understand that other structures and processes may be substituted for those disclosed and the resulting implementations will perform at least substantially the same function(s), in at least substantially the same way(s), to achieve at least substantially the same result(s) as the implementations disclosed. Accordingly, these and other implementations are contemplated by this application.
Number | Date | Country | Kind |
---|---|---|---|
16306837.2 | Dec 2016 | EP | regional |