Machine vision systems provide significant advantages when compared to conventional methods. Inspired from this idea, a visual inspected system that is independent of dust and dirt is presented for glass production systems. The method consists of a camera, a conveyor system, and an image segmentation method. Architecture of proposed system is as follows: a specific area of the conveyor is isolated from the outside. When glass enters this area, defect inspection process begins. In the inspection process, damaged and undamaged regions on glass surface are segmented. Gabor filter is very effective to detect orientation and thickness of these defects. But, Gabor filter bank should be created using appropriate Gabor coefficients for real-time applications. Otherwise, the processing time will be too long or fail results will be obtained. For this purpose, a new Gabor filter bank is created using gray wolf optimizer. In the hardware section, light beams are injected into the glass and the movements of these beams are observed to increase the perceptibility of the damage. Beam distribution is homogenous in the undamaged regions, but homogeneity is disturbed in defected areas. To avoid irregular glare on the glass surface, external lights are blocked and an artificial light source is used. Artificial light beams are injected into perpendicularly in the glass. So, homogeneous illumination in the glass can be occurred. Finally, optimized Gabor filter bank is applied to glass images. Proposed system detects all defects on the glass surface in the experiments. Size of the smallest defect is 0.4 mm. Defect detection performance of proposed system is nearly 100%. If it is evaluated in terms of shape and size, accuracy rate is 98.1%.