A computer-implemented method for using a mobile device to detect a document depicted in a digital image, the method comprising: detecting a plurality of identifying features of the document, wherein the plurality of identifying features are located internally with respect to the document, wherein detecting the plurality of identifying features comprises analyzing a plurality of feature vectors each corresponding to pixels within a patch of the digital image to determine whether the patch includes a sharp transition in intensity; identifying a plurality of distinctive pixels within the plurality of identifying features of the document, wherein the distinctive pixels are located in a patch exhibiting a rapid change in pixel intensity; matching the digital image depicting the document to one of a plurality of reference images, each reference image depicting a known document type, wherein said matching comprises determining whether the document includes distinctive pixels that correspond to distinctive pixels present in one or more of the plurality of reference images; and determining whether a candidate match between a distinctive pixel in the digital image and a candidate corresponding distinctive pixel present in one of the plurality of reference images is unique, wherein a candidate match is determined to be unique if said distinctive pixel in the digital image and said candidate corresponding distinctive pixel present in said one of the plurality of reference images match each other but do not match any other distinctive pixels in said one of the plurality of reference images or said digital image respectively, and, in response to determining the candidate match is not unique, designating said candidate match as an outlier and removing the respective distinctive pixels from the matching process; and estimating a location of one or more edges of the document based at least in part on the plurality of identifying features, by: estimating, using a Random Sample Consensus, RANSAC, algorithm, a transform defining a point-to-point correspondence between the document depicted in the digital image and the known document type depicted in said matched one of the plurality of reference images; and estimating the location of one or more edges of the document depicted in the digital image based on one or more corresponding edge locations determined from the matched one of the plurality of reference images, via said transform. detecting a plurality of identifying features of the document, wherein the plurality of identifying features are located internally with respect to the document, wherein detecting the plurality of identifying features comprises analyzing a plurality of feature vectors each corresponding to pixels within a patch of the digital image to determine whether the patch includes a sharp transition in intensity; identifying a plurality of distinctive pixels within the plurality of identifying features of the document, wherein the distinctive pixels are located in a patch exhibiting a rapid change in pixel intensity; matching the digital image depicting the document to one of a plurality of reference images, each reference image depicting a known document type, wherein said matching comprises determining whether the document includes distinctive pixels that correspond to distinctive pixels present in one or more of the plurality of reference images; and determining whether a candidate match between a distinctive pixel in the digital image and a candidate corresponding distinctive pixel present in one of the plurality of reference images is unique, wherein a candidate match is determined to be unique if said distinctive pixel in the digital image and said candidate corresponding distinctive pixel present in said one of the plurality of reference images match each other but do not match any other distinctive pixels in said one of the plurality of reference images or said digital image respectively, and, in response to determining the candidate match is not unique, designating said candidate match as an outlier and removing the respective distinctive pixels from the matching process; and estimating a location of one or more edges of the document based at least in part on the plurality of identifying features, by: estimating, using a Random Sample Consensus, RANSAC, algorithm, a transform defining a point-to-point correspondence between the document depicted in the digital image and the known document type depicted in said matched one of the plurality of reference images; and estimating the location of one or more edges of the document depicted in the digital image based on one or more corresponding edge locations determined from the matched one of the plurality of reference images, via said transform. estimating, using a Random Sample Consensus, RANSAC, algorithm, a transform defining a point-to-point correspondence between the document depicted in the digital image and the known document type depicted in said matched one of the plurality of reference images; and estimating the location of one or more edges of the document depicted in the digital image based on one or more corresponding edge locations determined from the matched one of the plurality of reference images, via said transform.