| The new coronavirus is spreading around the world.Although the epidemic situation in China is now under good control,the global epidemic has not yet ended.It is still necessary to do a good job of epidemic prevention and control without relaxation and scientific precision.At present,in public places,testing whether to wear a mask has become one of the primary tasks of prevention and control.Mask detection will be affected by various factors,especially in the complex lighting environment,the detection of wearing a mask will test the performance of the detector.However,the problems existing in the current mainstream detection algorithms in this environment should be solved.Therefore,the main contents of the thesis are summarized as follows:Aiming at the problem that the mask detection will be affected by complex lighting at this stage,and the open source datasets that meet the complex lighting conditions are missing,after synthesizing the feature information of the images,an algorithm for selecting complex lighting images is proposed to construct the dataset required in this thesis.First,the overall information and the number of detail information of the image are calculated,and the changes of the two-dimensional entropy and the number of details of the image before and after correction are obtained through Gamma transformation of different coefficients,and then the corresponding thresholds are compared to screen out the images required for the experiment.Afterwards,an image de-similarity method is designed to remove images with high similarity in the dataset and improve the quality of the dataset.Finally,after data enhancement,a data set of face wearing masks under complex lighting is constructed,and the validity of the data set is verified by experimental comparison.For the image of the face wearing a mask under complex lighting conditions,the phenomenon of low contrast and low brightness will appear in the natural scene,which will destroy the ideal feature extraction effect of the image.This thesis proposes an improved image enhancement algorithm based on the Retinex-Net algorithm.First,the defects of the previous algorithm are analyzed in detail through the experimental results.Then,convert the image color space.This feature enhances the luminance component alone and improves the color distortion problem.At the same time,in view of the problem of blurred edges and artifacts caused by insufficient expression of edge feature information,after denoising the reflectivity image of the luminance component,the Laplacian operator is used to preserve the high-frequency information of the image to sharpen the image.This protects details and enhances edge details.After that,the destruction of image contrast caused by a single adjustment of brightness is solved by enhancing saturation.Finally,the effectiveness of the algorithm is verified by comparative experiments.Aiming at the requirement that detecting whether a face wears a mask in a public place needs to overcome the damage of the detection accuracy due to the light factor,this thesis designs a face wearing mask detection algorithm for complex illumination on the basis of the YOLOv4 detection algorithm.After researching and analyzing the network structure of YOLOv4,in order to ensure that the model has a certain robustness to illumination,an improved scheme is proposed in the main feature extraction part and feature pyramid part of the network,and the anchor frame is redesigned to ensure that the overall real-time model is satisfied.At the same time,the average accuracy rate reached 92.1%.Finally,the feasibility of the algorithm is verified by experiments. |