Solder paste inspection using region-based defect detection