In the face of rampant global disease transmission, effective preventive strategies are imperative. This study tackles the challenge of ensuring compliance in crowded settings by developing a sophisticated face mask detection system. Utilizing MATLAB and the Cascade Object detector, the system focuses on detecting white surgical masks in frontal images. Training the system is critical for accuracy; therefore, cross-validation is employed due to limited data. The results reveal accuracies of 76.67% for initial training, 67.50% for a 9:11 cropping ratio, and 89.17% for a 9:4:7 cropping ratio, highlighting the system's remarkable precision in mask detection. Looking ahead, the system's adaptability can be further expanded to include various mask colors and types, extending its effectiveness beyond COVID-19 to combat a range of respiratory illnesses. This research represents a significant advancement in reinforcing preventive measures against future disease outbreaks, especially in densely populated environments, contributing significantly to global public health and safety initiatives.