A computer-implemented method for processing a depth map, comprising: acquiring a depth map to be processed, wherein each pixel in the depth map has a corresponding depth value and a confidence level of the depth value; acquiring a confidence level gradient and a gradient angle of each pixel in the depth map according to the confidence level of the depth value; determining a candidate flying pixel and a target pixel according to the confidence level gradients, and generating a flying pixel depth threshold according to a depth value of the target pixel, wherein the target pixel is a pixel point being distanced from the candidate flying pixel within a preset range; determining a reference direction according to the gradient angle of the candidate flying pixel, and acquiring depth values of a pair of adjacent pixels relative to the candidate flying pixel in the reference direction, wherein the candidate flying pixel is located between the pair of adjacent pixels; and acquiring a depth difference value between depth values of the candidate flying pixel and of each adjacent pixel in the pair of adjacent pixels, and determining whether the candidate flying pixel is a real flying pixel according to the depth difference values and the flying pixel depth threshold; wherein the step of determining a candidate flying pixel and a target pixel according to the confidence level gradients comprises: determining a pixel of which the confidence level gradient is greater than a preset threshold as the candidate flying pixel; determining all pixels located in a preset range distanced from the candidate flying pixel as candidate reference pixels, and acquiring a confidence level of a depth value of each candidate reference pixel in all of the candidate reference pixels; and determining a candidate reference pixel of which the confidence level of a depth value is greater than a preset threshold as a target pixel. acquiring a depth map to be processed, wherein each pixel in the depth map has a corresponding depth value and a confidence level of the depth value; acquiring a confidence level gradient and a gradient angle of each pixel in the depth map according to the confidence level of the depth value; determining a candidate flying pixel and a target pixel according to the confidence level gradients, and generating a flying pixel depth threshold according to a depth value of the target pixel, wherein the target pixel is a pixel point being distanced from the candidate flying pixel within a preset range; determining a reference direction according to the gradient angle of the candidate flying pixel, and acquiring depth values of a pair of adjacent pixels relative to the candidate flying pixel in the reference direction, wherein the candidate flying pixel is located between the pair of adjacent pixels; and acquiring a depth difference value between depth values of the candidate flying pixel and of each adjacent pixel in the pair of adjacent pixels, and determining whether the candidate flying pixel is a real flying pixel according to the depth difference values and the flying pixel depth threshold; wherein the step of determining a candidate flying pixel and a target pixel according to the confidence level gradients comprises: determining a pixel of which the confidence level gradient is greater than a preset threshold as the candidate flying pixel; determining all pixels located in a preset range distanced from the candidate flying pixel as candidate reference pixels, and acquiring a confidence level of a depth value of each candidate reference pixel in all of the candidate reference pixels; and determining a candidate reference pixel of which the confidence level of a depth value is greater than a preset threshold as a target pixel. determining a pixel of which the confidence level gradient is greater than a preset threshold as the candidate flying pixel; determining all pixels located in a preset range distanced from the candidate flying pixel as candidate reference pixels, and acquiring a confidence level of a depth value of each candidate reference pixel in all of the candidate reference pixels; and determining a candidate reference pixel of which the confidence level of a depth value is greater than a preset threshold as a target pixel.