1. A three-dimensional measuring method, comprising: providing a structured light pattern; capturing an object image of an object on which the structured light pattern is projected; analyzing the object image to obtain a space coding image and a phase coding image according to a gray level distribution of the object image; calculating phase information of each of a plurality of coordinate points in the phase coding image, wherein the plurality of coordinate points comprises at least one point of discontinuity; calculating compensation information of a coordinate position, corresponding to a coordinate position of the point of discontinuity, in the space coding image; compensating the phase information of the point of discontinuity in the phase coding image by the compensation information; and calculating height information of the object according to the phase information of each of the plurality of coordinate points after the phase information of the point of discontinuity is compensated.