A BIST-based Solution for the Diagnosis of Embedded Memories Adopting Image Processing Techniques