1. A method comprising: receiving, by a system including a processor, an image of a document against a background; finding, by the system, a bounding box that bounds a region of the image that is distinguishable from the background; finding, by the system, coordinates of a plurality of points of the distinguishable region, each point of the plurality of points being a point of the distinguishable region that is closest to the respective corner of the bounding box, wherein finding the coordinates of the plurality of points comprises: defining windows at respective corners of the bounding box, and within each of the windows, identifying a first portion of the window and a second portion of the window, the first portion including content of the document, and the second portion including the background; and identifying the plurality of points based on identifying the first and second portions in each of the windows; and identifying, by the system, the document within the image as a region of the image whose corners are defined by the found coordinates.