A pattern discriminator receives scanning data obtained by raster scanning objects within predefined window regions with a photoelectric converter, converts the scanned data into pixel binary data by using a threshold value dependent upon the scanning position and window region and evaluates the binary data in accordance with predetermined criteria to produce an output signal indicative of the evaluation. Data specifying the shapes of the desired window regions approximated by polygons is obtained by specifying the apexes of the polygons and a programmed CPU computes the coordinates of each picture element or pixel on the lines connecting adjacent apexes along each window region perimeter. A memory stores the apex and coordinate data which defines the starting and ending points of each window region. Polygonal masks within each window and sub-mask polygonal window regions within each mask can be defined in a similar manner. A shifting detector and position corrector detects the amount of any positional shift of an object being scanned in relation to the position of a previously scanned reference object, and shifts the locations of the defined window regions by the amount of the positioned shift detected.