Patent attributes
In some implementations, a device may detect edges in an image, and may identify, based on the edges, a rectangle that bounds a document in the image. The device may detect lines in the image, and may identify edge candidate lines by discarding one or more of the lines. The device may identify intersection points where lines, included in the edge candidate lines, intersect with one another. The device may identify corner candidate points by discarding one or more points included in the intersection points, and may identify a corner point included in the corner candidate points. The corner point may be a point, included in the corner candidate points, that is closest to one corner of the bounding rectangle. The device may perform perspective correction on the image of the document based on identifying the corner point.