1. A method of determining overlay error in semiconductor device fabrication, the method comprising: receiving an image of an overlay mark formed on a substrate; separating the image into a first image and a second image, wherein the first image includes an image of features formed on a first layer of the substrate and the second image includes an image of the features formed on a second layer of the substrate; after separating the image into the first and second images, defining a background area of the second image; determining a distribution of pixel values for the background area; altering the pixel values for an unwanted portion of the second image according to the distribution of the pixel values for the background area; determining a quality indicator for the first image; and determining a quality indicator for the second image.