1. A method of identifying cast shadows in a digital image, the method comprising: segmenting, by at least one processor, the digital image into a plurality of grid cells; determining, for image patches of the digital image, one or more nearest neighbor patches from the plurality of grid cells by identifying, for a given image patch, one or more corresponding image patches that have one or more visual features in common with the given image patch; detecting, by the at least one processor, shadows in the digital image based on feature vectors of the image patches and their one or more nearest neighbor patches; segmenting, by the at least one processor, the detected shadows into one or more shadow regions based on luminance variations of the detected shadows; and identifying, by the at least one processor, a cast shadow in the digital image based on the one or more shadow regions.