A computer implemented method for filtering pixels in a depth-map, the method characterized in that it comprises, for a pixel of the depth map called current pixel: - determining (201, 203) coefficients of a plurality of weight functions associated with said current pixel, said coefficients being determined (201, 203) based on pixels belonging to a group of pixels of said depth-map centered on the current pixel, called neighboring pixels, wherein a coefficient determined (201, 203) for a neighboring pixel is a function of a geometrical distance between the current pixel and said neighboring pixel as well as of an intensity associated with the current pixel and an intensity of said neighboring pixel, wherein for a first weight function the intensity associated with the current pixel is the intensity of the current pixel, for a second weight function the intensity associated with the current pixel is the intensity of the pixel adjacent to the current pixel having the highest intensity among the pixels adjacent to the current pixel, for a third weight function the intensity associated with the current pixel is the intensity of the pixel adjacent to the current pixel having the lowest intensity among the pixels adjacent to the current pixel, and for a fourth weight function the intensity associated with the current pixel is the median of the intensities of the pixels adjacent to the current pixel, - selecting one weight function among the determined (201, 203) weight functions, wherein the selected weight function is the weight function having the maximum sum of coefficients among the determined weight functions, and - filtering said current pixel by applying a convolution filter generated (202, 204) based on the selected weight function. - determining (201, 203) coefficients of a plurality of weight functions associated with said current pixel, said coefficients being determined (201, 203) based on pixels belonging to a group of pixels of said depth-map centered on the current pixel, called neighboring pixels, wherein a coefficient determined (201, 203) for a neighboring pixel is a function of a geometrical distance between the current pixel and said neighboring pixel as well as of an intensity associated with the current pixel and an intensity of said neighboring pixel, wherein for a first weight function the intensity associated with the current pixel is the intensity of the current pixel, for a second weight function the intensity associated with the current pixel is the intensity of the pixel adjacent to the current pixel having the highest intensity among the pixels adjacent to the current pixel, for a third weight function the intensity associated with the current pixel is the intensity of the pixel adjacent to the current pixel having the lowest intensity among the pixels adjacent to the current pixel, and for a fourth weight function the intensity associated with the current pixel is the median of the intensities of the pixels adjacent to the current pixel, - selecting one weight function among the determined (201, 203) weight functions, wherein the selected weight function is the weight function having the maximum sum of coefficients among the determined weight functions, and - filtering said current pixel by applying a convolution filter generated (202, 204) based on the selected weight function.