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 https://www.youtube.com/watch?v=J9EJ52Za7IE

for face-recognition I followed https://www.youtube.com/watch?v=PttoKt6TMDk

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)

simple-camera.py

and

dual-camera.py

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 face_detect.py returns :

Traceback (most recent call last):
  File "face_detect.py", line 83, in <module>
    face_detect()
  File "face_detect.py", 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
GST_ARGUS: 
PowerServiceHwVic::cleanupResources
bart@bart-desktop:~/CSI-Camera$ 

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 :

from facedetect.py

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'

from camshift.py

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. https://www.youtube.com/watch?v=-0iZlv8M8a4
I’m sure you will enjoy it

I

.

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
2:facedetect.py, src.empty seems img loaded failed, are you check the image loaded OK?
3:camshift.py, 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 dual_camera.py, 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:CSI-Camera/simple_camera.py at master · JetsonHacksNano/CSI-Camera · GitHub, 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”)
return
to avoid such error

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