Automatic grain boundary detection and grain size analysis using polarization micrographs or orientation images