This paper presents a method to cut the invalid pixels in unwrapped phase around the boundary using the unwrapping technique based on composite template matching.The invalid pixels are identified according to adjacent unwrapped phase differences first,then cut the non segmented discontinuity invalid pixels to get valid unwrapped phase.The experimental result show that the technique is efficient and simple to implement.