The vibration signal of roller bearings contains important information, but the strong background noise makes fault diagnosis difficult. In this paper, inspired by the idea of a block-matching 3D algorithm, using local and nonlocal correlation of vibration signal, a patch-matching 2D (PM2D) denoising method is proposed for the first time to suppress noise in vibration signals. The proposed denoising method constructs similarity matrices of component modules, which are used for threshold processing to determine the coefficients of the 2D discrete cosine transform, so as to achieve optimal denoising performance. Then, empirical mode decomposition and envelope analysis are employed to perform fault diagnosis. The proposed PM2D denoising method and fault diagnosis strategies are applied to both simulated and measured signals. A comparison study shows the superiority of the proposed method over the other existing denoising methods.