OpenCV build problems with SSD

Hey Guys,

I printed a robot that has to learn a lot, with my Raspberry it did some nice tricks but with the Jetson Nano I’m stuck with OpenCV.

During my first install the Nano already started complaining about my 64GB SD card. I wanted enough space so I bought the Samsung 500GB and followed Jetson Hacks Tutorial

for face-recognition I followed

The video explains the face-recognizer need’s CUDA with OpenCV and comes with a install-script.

I have the CSI-Camera working with the RaspicamV2 I bought with the Nano (a sharp picture)


also works, thou it cleans up with :

GStreamer-CRITICAL **: 19:27:40.258: gst_mini_object_set_qdata: assertion ‘object != NULL’ failed

The CSI-Camera returns :

Traceback (most recent call last):
  File "", line 83, in <module>
  File "", line 58, in face_detect
    faces = face_cascade.detectMultiScale(gray, 1.3, 5)
cv2.error: OpenCV(4.1.0) /home/bart/opencv-4.1.0/modules/objdetect/src/cascadedetect.cpp:1658: error: (-215:Assertion failed) !empty() in function 'detectMultiScale'

GST_ARGUS: Cleaning up
CONSUMER: Done Success
GST_ARGUS: Done Success

This is after a successful install of OpenCV4.1.0 . I tried the python demo’s I found that for al the modules it returns errors like these :


cv2.error: OpenCV(4.1.0) /home/bart/opencv-4.1.0/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'


vis = self.frame.copy()
AttributeError: ‘NoneType’ object has no attribute ‘copy’

More info :
I found that the SD card has /usr/share/opencv4
the SSD has not but it has gained most of the GB’s during the installation.

I consider myself new to Linux (1 year raspberry experience) I hope you guys could help me removing the wrong installed files and building this face detector on the nano.

Thanks for your help.
I made a movie about the robot.
I’m sure you will enjoy it



hi b.vanderhaagen76:
sorry for late response,
1:for this cascadedetect.cpp error ,how you loaded the *.xml(such as haarcascade_frontalface_default.xml), are you added the absolute path of xml? if not ,please try it, src.empty seems img loaded failed, are you check the image loaded OK?, NoneType it same with 2, you should check the self.frame is a valid frame you captured

Thanks for your response. I was focussing on hardware so im late too.

1> how do i add the absolute path of XML?

The files its pointing to are located on the SSD but the filemap opencv4.1.1 is in home directory
is this a build mistake with the SSD?

2> I see both camera’s in, why can opencv not read that?

3> how do I check the self.frame is a valid frame

hi b.vanderhaagen76:
1: like this /my/files/location/cacade.xml,before debug, you could try :vim /my/files/location/cacade.xml, if you can open this file ,path is ok
2:, try this code to test whether camera opened or not
3:before you read frame ,you can add
if (cap.isOpened() == False):
print(“Error opening video stream or file”)
to avoid such error

Thank you so much I will try this when coming home tonight.