Phase unwrapping is an important and challenging process in optical interferometry. Difficulties in phase unwrapping are usually caused by either noise (“bad” pixels) or invalid areas (“bad” regions). If the “bad” pixels can be removed, the problems due to the noise are solved. Further, if the “bad” regions can be identified, they can be avoided in phase unwrapping. In our previous work the noise can be successfully removed using a windowed Fourier transform [Optics and Lasers Technology, 37:458-462 (2005)]. In this paper we will show that the invalid areas can be identified by the same windowed Fourier transform. Thus a single windowed Fourier transform is able to process both “bad” pixels and “bad” regions simultaneously, which makes the phase unwrapping simple and effective.