i am cofuse how to approach this problem. i already applied the eye cascade file to get the coordinates of both eyes.but confuse how to place the glass image on top of it.
Snapchat filter
You can use the following snippet to just place a glass image on top of the frame, once you got coordinates of eyes.
x,y,w,h=eyes[0]
glass=cv2.resize(glass,(h,w))
for i in range(glass.shape[0]):
for j in range(glass.shape[1]):
if(glass[i,j,3]>0):img[y+i,x+j,:]=glass[i,j,:-1]
I hope I’ve cleared your doubt.
If you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
but i am getting : index 3 is out of bounds for axis 2 with size 3
Please share your code
can you explain this for loop?