Pattern detection for recognizing and analyzing particular region of images