Type Error in code

I am getting an error

cv2.imshow(“Face Section”,face_section)
TypeError: Expected Ptrcv::UMat for argument ‘mat’

this is the following code-https://ide.codingblocks.com/s/179271

This error occurs in the line number 49, when there is no face detected in the frame, so face_section = [], and it will be unable to plot it, to remove this error, either to place web cam such that every time you starts your programme, it would be able to get the face section, or simply use try catch block, to deal with the exception.
Also instead of this, you can initialize face_section = np.zeros((100,100,3)). Use any of the way you like.

Hope this cleared your doubt. :blush: