1. A method for detecting an edge in scan data, comprising: analyzing RGB scan data for determining an approximate location of a background in the scan data representing a background adjacent a document having a similar color as the background; setting a threshold for at least one of R, G, and B, the threshold being based in part on RGB values of the background and a predefined color threshold; setting an intensity threshold; analyzing the scan data using the thresholds for generating distribution points; detecting a first edge of the document based on a location of a contour in the distribution points; and outputting the scan data and information about the detected edge.