A method of assigning selected depth values to RGB subpixels for a colored depth frame packing and depacking, wherein an RGB format comprises an R subpixel, a G subpixel and a B subpixel in order, a RGB depth frame comprises a group of four pixels, the R subpixels, G subpixels and B subpixels of the group of four pixels are vertically or horizontally arranged, the group of four pixels comprises a first pixel, a second pixel, a third pixel and a fourth pixel, the first pixel is located neighboring the second pixel and the third pixel, the fourth pixel is located neighboring the second pixel and the third pixel, and geometrical positions of the first pixel, the second pixel, the third pixel and the fourth pixel correspondingly have a first pixel depth value, a second pixel depth value, a third pixel depth value and a fourth pixel depth value, respectively, the method comprising:
- obtaining two depth values from each of the first pixel depth value and the fourth pixel depth value, and obtaining one depth value from each of the second pixel depth value and the third pixel depth value, wherein the six depth values obtained from the first pixel depth value, the second pixel depth value, the third pixel depth value and the fourth pixel depth value have interleaved positions;
- and
- assigning one of the two depth values obtained from the first pixel depth value to an R-subpixel value of the first pixel in a converted RGB format, assigning the other one of the two depth values obtained from the first pixel depth value to a B-subpixel value of the first pixel in the converted RGB format, assigning the depth value obtained from the second pixel depth value to an R-subpixel value, a G-subpixel value and a B-subpixel value of the second pixel in the converted RGB format, assigning the depth value obtained from the third pixel depth value to an R-subpixel value, a G-subpixel value and a B-subpixel value of the third pixel in the converted RGB format, assigning one of the two depth values obtained from the fourth pixel depth value to a G-subpixel value of the first pixel in the converted RGB format, and assigning the other one of the two depth values obtained from the fourth pixel depth value to an R-subpixel value, a G-subpixel value and a B-subpixel value of the fourth pixel in the converted RGB format.