I don’t quite understand what you mean by “quality”, if you mean the quality setting in the JPG compression algorithm, then you can extract it from the EXIF tags of the image (it relies on installing a capture device and no one overwrites them) for see your library here:
http://www.aurigma.com/Support/DocViewer/30/JPEGFileFormat.htm.aspx
If you mean any other “quality," then you need to find a better definition of quality. For example, overexposure can be a problem, in which case looking for saturated pixels will help determine a specific type of quality. Or, more generally, you can see the statistics (mean, standard deviation) of the histogram of the image in three-color channels. The image may not be in focus, and in this case, you can look for a cutoff in the spatial frequencies of the Fourier transform image. If you are worried about speckle noise, you can try applying a median filter to the image and compare it with the original image (a sharper noise will make a bigger change). I have a little guess here.
If by "quality" you mean aesthetic properties of the composition, etc., then - good luck!
Ian hopkinson
source share