Xml files and Goggles image

First of All something is wrong with Files attached for frontaleye and nose detection. It gives the error as following

OpenCV(4.1.1) /io/opencv/modules/objdetect/src/cascadedetect.cpp:1689: error: (-215:Assertion failed) !empty() in function ‘detectMultiScale’

and if we convert Goggles image into rgba format,the opacity comes out be 255 at every pixel so how to figure which pixels of goggles to be put on man’s face ?

If you think the xml file is wrong you can download the same xml file from the internet as well, just type the name of file and you will get it.

while reading the image, put one parameter, cv2.IM_UNCHANGED
Googles image was png img, which had 4th channel as opacity. So while superimposing the google on the man’s eyes you need to you need to check if the 4th channel value of that particular pixel is >0 then only you should replace that pixel, if the 4th channel of that pixel is 0 , it means transparent so, don’t superimpose that pixel on man’s eyes.