Text this: Defect detection based on extreme edge of defective region histogram