Perceptual analysis is an interesting topic in the field of image processing, and can be considered a missing link between image processing and human vision. Of the various forms of perception, one of the most important and best known is shape perception. In this paper, a framework based on the online nonlocal patch means (NLPM) method is developed, which is designed to infer possible perceptual observations of an input image using the knowledge images provided. Thanks to the speed of online NLPM, the proposed method can simulate the transformation of the input image to the final perceptual image in real time. In order to improve the performance of the method, a hidden chain series is considered for the model that delivers faster convergence. The capability of the method is evaluated on several well-known perceptual examples.