The three-dimensional (3-D) shape measurement using defocused Ronchi grating is advantageous for the high contrast of fringe. This paper presents a method for measuring spatially isolated objects using defocused binary patterns. Two Ronchi grating with horizontal position difference of one-third of a period and an encoded pattern are adopted. The phase distribution of fringe pattern is obtained by Fourier analysis method. The measurement depth and range is enlarged because the third harmonic component and background illumination is eliminated with proposed method. The fringe order is identified by the encoded pattern. Three gray levels are used and the pattern is converted to binary image with error diffusion algorithm. The tolerance of encoded pattern is large. It is suited for defocused optical system. We also present a measurement system with a modified DLP projector and a high-speed camera. The 3-D surface acquisition speed of 60 frames per second (fps), with resolution of 640 × 480 points and that of 120 fps, with resolution of 320 × 240 points are archived. If the control logic of DMD was modified and a camera with higher speed was employed, the measurement speed would reach thousands fps. This makes it possible to analyze dynamic objects.