Quantitative criteria for the detection and characterization of nanocrystals from high-resolution electron microscopy images