CV2 DNN face detection assertion failed

asked 2018-11-24 01:17:10 -0600

hansenmaster gravatar image

Basically it's the same problem with

I tried the tutorial from but it said "OpenCV Error: Assertion failed (input.dims == 4 && (input.type() == 5 || input.type() == 6)) in finalize, file /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/dnn/src/layers/convolution_layer.cpp, line 78"

Is it because the Python in ROS is 2.7 and the DNN need python 3? I tried in my friend's laptop which is installed with ROS and gave same error. Could anyone help me to integrate this with ROS?

Thank you

edit retag flag offensive close merge delete


I have exactly the same problem. But I think I have found the problem. If you look for the samples/dnn/face_detector folder you will not find it. Hence, the problem is the OpenCV version preinstalled with ROS. Now I am trying to use OpenCV 3.4.4 with ROS which has the necessary files.

pskampas gravatar image pskampas  ( 2018-12-20 08:51:13 -0600 )edit

Hi, I have the same problem, Can you please tell me how can I install another version (other than 3.3.1) of OpenCV with ROS ? Your help will be highly appreciated. @pskampas

Ibrahim_aerospace gravatar image Ibrahim_aerospace  ( 2019-07-21 13:59:37 -0600 )edit