| Nowadays,with the continuous development of computers and the Internet,online shopping has become a part of people’s lives.In the glasses industry,the way to sell is not limited to physical stores,but various glasses websites are becoming more and more.The combination of the network and the traditional sales model further promotes the sale of glasses.However,when buying glasses online,users can’t see their own try-on effects,so there will be various after-sales problems.The emergence of virtual glasses try-on technology has made up for the lack of sales under the traditional Internet,helping users to achieve the effect of glasses try-on.This paper proposes a video-based approach to virtual glasses to try on,allowing users to try on them in real time and achieve a better natural and comprehensive try-on effect.The main research contents of this paper are as follows:In the face alignment stage,this paper implements the facial landmark localization that meets the virtual glasses trying on the basis of the MTCNN method.Specifically,five relatively stable feature points are selected to complete the positioning of the glasses image.When preprocessing the image,it is necessary to pyramid the image.Since the appropriate minimum face size and scaling factor can be set to optimize the calculation efficiency,this paper sets the appropriate value for this adjustment to meet the face detection alignment in the glasses try-on.In the stage of head pose estimation,this paper uses the idea of transfer learning,uses the model parameters of MTCNN,transfers learning of the fully connected layer of MTCNN’s O-Net network,retrains the head pose dataset,acquires the pose model,and finally realize the estimation of the head pose.In the glasses processing stage,it is proposed that after acquiring the gesture,the glasses image is deflected by the same angle following the head,and the glasses are subjected to perspective transformation processing.In order to realize the three-dimensional effect of the try-on,the mirror is scaled,and the temples are presented to the appropriate length according to the angle of deflection.Finally,this paper implements a real-time,better natural,comparable and personalized virtual glasses try-on system to improve user experience.Through experimental comparison,the method of this paper does not require the assistance of a depth camera,and does not require time-consuming work such as 3D modeling,and can realize the try-on effect satisfactory to the user in real time. |