A method for processing a depth map, applicable to a controller of an unmanned aerial vehicle, the UAV further comprising an image collection apparatus, the image collection apparatus being communicatively connected to the controller, the method comprising the following steps: correcting an image of a target area that is collected by the image collection apparatus; performing binocular matching on the image to obtain a depth map of the target area; acquiring a distribution of obstacles around the UAV according to the depth map; acquiring an execution time of step S1, an execution time of step S2 and an execution time of step S3 before executing step S1, step S2 and step S3; and establishing at least two threads and at least one ring queue according to the execution time of step S1, the execution time of step S2 and the execution time of step S3, and executing step S1, step S2 and step S3 by the at least two threads to reduce a total execution time, wherein of two of the at least two threads that execute adjacent ones of the steps, a processing result from a thread executing a former step is transmitted to the ring queue, and a thread executing a latter step fetches the processing result from the ring queue and executes the latter step according to the processing result; characterized in that the controller comprises a hardware acceleration channel, and the image collection apparatus comprises at least two sets of binocular units, the hardware acceleration channel comprises at least two hardware acceleration channels, and the images collected by the at least two sets of binocular units comprise a set of images having a first resolution and a set of images having a second resolution, the second resolution being greater than the first resolution; and the performing binocular matching on the image to obtain a depth map of the target area comprises: transmitting the set of images having the second resolution to one of the at least two hardware acceleration channels; and transmitting the set of images having the first resolution to the other of the at least two hardware acceleration channels. correcting an image of a target area that is collected by the image collection apparatus; performing binocular matching on the image to obtain a depth map of the target area; acquiring a distribution of obstacles around the UAV according to the depth map; acquiring an execution time of step S1, an execution time of step S2 and an execution time of step S3 before executing step S1, step S2 and step S3; and establishing at least two threads and at least one ring queue according to the execution time of step S1, the execution time of step S2 and the execution time of step S3, and executing step S1, step S2 and step S3 by the at least two threads to reduce a total execution time, wherein of two of the at least two threads that execute adjacent ones of the steps, a processing result from a thread executing a former step is transmitted to the ring queue, and a thread executing a latter step fetches the processing result from the ring queue and executes the latter step according to the processing result; characterized in that the controller comprises a hardware acceleration channel, and the image collection apparatus comprises at least two sets of binocular units, the hardware acceleration channel comprises at least two hardware acceleration channels, and the images collected by the at least two sets of binocular units comprise a set of images having a first resolution and a set of images having a second resolution, the second resolution being greater than the first resolution; and the performing binocular matching on the image to obtain a depth map of the target area comprises: transmitting the set of images having the second resolution to one of the at least two hardware acceleration channels; and transmitting the set of images having the first resolution to the other of the at least two hardware acceleration channels. transmitting the set of images having the second resolution to one of the at least two hardware acceleration channels; and transmitting the set of images having the first resolution to the other of the at least two hardware acceleration channels.