3D Printed head and OpenCV (RPi4)

Okay.....so the Raspberry Pi 4 arrived and I decided to spend a couple of hours setting it up to match the RPi 3+ and get OpenCV running on it and test how it performs with the OpenCV code.

I had my fingers crossed that it would just blow away the Rock Pi X and the RPi 3.....however.... it was time to assemble the parts and get it up and running:


It came with a rather nifty case too:


Non-scientific benchmarking test

I performed an OOTB RPi 4 install and configuration, followed my own instructions (as per this page)

It took about 2hours to do the OpenCV make - I could probably have made it quicker using the make -j4 command, but y'know, I wasn't in that much of a rush.


Besides, during the wait, it gave me a great excuse to make my way through the "C"'s of the PiCADE:


I used exactly the same code as before and the same web-cams.

The following is what I found.


I did notice the 'detection time' values were significantly smaller than the Rock Pi X at 750ms, and about 50% of the Raspberry Pi 3+'s 300ms, coming in at around 165-170ms.

I did notice that the CPU usage was pretty much the same for all 4 cores as per the Raspberry Pi 3+, which was interesting.

I do wonder if this 'detection time' increase was due to the fact the web-cams were plugged into the USB 3.0 ports..... that would certainly explain the twice-as-fast throughput... (NOPE - just tested this and it is pretty much the same)

Video evidence

As you can see this is the Raspberry Pi 4 performing the task that is required of it:


Conclusion

I was hoping that the Raspberry Pi 4b would have had a lot more grunt CPU-wise...but it didn't seem to.  Hmmm.... okay, so this does help me quite a bit.

The Rock Pi X has just been retired to a box over there in the corner, that may or may not get used for something in the future - maybe something will require it's usage.  As it stands, it's not really worth the effort.

The RPi 3+ and the RPi 4 are going to be regulars on my desk and give me a good benchmarking comparison - i'll be able to see how the code execution differs on each of the devices.

I just signed up for a couple of Udemy courses:

Course 1

Course 2

To see how they explain the best options for using OpenCV for face/object detection.

After going through some of the content, the vibe I'm getting (apart from it all being in bl00dy python), is that I might be better off not relying on the OpenCV Haar algorithm - one of the courses did actually do a great explanation of what is actually going on behind the scenes with these algorithms and how potentially SSD and GANs could be a more efficient option to go with, which may or may not improve the CPU demand.

Well, at least I know that I "can" do what I want and as I said before, if it's just performance that is the issue, we all know we can work on that afterwards!


Comments