1. A method of image processing in a structured light imaging system, the method comprising: receiving a captured image of a scene, wherein the captured image is captured by a camera of a projector-camera pair comprised in the structured light imaging system, and wherein the captured image comprises a binary pattern projected into the scene by the projector; rectifying the captured image to generated a rectified captured image; applying a filter to the rectified captured image to generate a local threshold image, wherein the local threshold image comprises a local threshold value for each pixel in the rectified captured image; and extracting a binary image from the rectified captured image wherein a value of each location in the binary image is determined based on a comparison of a value of a pixel in a corresponding location in the rectified captured image to a local threshold value in a corresponding location in the local threshold image.