We present a set of algorithms that can be used to locate and crop the chess-board/chesspieces from the picture, including every rectangular grid with any pattern. Our method is nonparametric, and thus does not require the prior knowledge from computer vision and machine learning, which is instead inferred from data. We illustrate the application of our method to a variety of examples, such as chess-board cropping and regular grid-pattern localization. In addition, we present two independent algorithms: PAMG (vertices detector) and FAPL (thermal lines) that can be widely used for other tasks in computer vision.