As a proof of concept I wanted to see how the Raspberry Pi Zero would hold up to be used to control the Pi camera for the eye of my InMoov along with the head and eye servos
 
I have OpenCV 3.1.0 compiled on the latest Jessie OS build on the Pi Zero with the latest MRL build (v 1.0.1852) also running on the Zero
 
I'm seeing around 7 to10 fps at 320x240 with the PyramidDown filter
 
The cpu on the Zero gets maxed out. I somehow expected that though :)
 
Hi Mats, thanks for the guidance on the MRL startup parameters :)
 
 
 

GroG

7 years 3 months ago

Hi Acapulco Rolf,

Thanks for posting - appreciate the video.. 
As they say a picture is worth 1000 words - so Video is worth 30 fps X time = words  :)

I'm glad your getting a video feed, but why is there ~20 mrl instances with different pids ?
We can begin looking into optimizing speed, but I would start by getting resources back (like memory) - which means killing 19 zombies to begin with..

Cheers,
GroG

I hope that you also post the steps that you went through.  Also have you tried to bring in video from a USB camera? I think there must be something that is required to get the USB camera to be recognized that is keeping me from working right now...

 

 

 

 

Acapulco Rolf

7 years 3 months ago

In reply to by kyle.clinton

Hi Kyle,
 
For information, I'm using a Raspberry Pi camera module attached to the Pi
 
For the challenges that you're facing compiling OpenCV on the Raspberry Pi, follow these steps:
 
These are the steps that I followed to get OpenCV 3.1.0 compiled and installed on the Pi:
 
Follow the instructions here to the letter, choose the article that fits your use case:
 
 
Work your way through each step to the letter
Now, when you get to the step where you run cmake, examine the outcomes of the cmake command
 
I ran the following on the cmake log file to check for fatal errors
 
cat /home/pi/opencv-3.1.0/build/CMakeFiles/CMakeError.log | grep fatal
 
If you do not have any cmake errors then run the make command as per the intructions 
 
Once you've got OpenCV built and then installed, then work the example that is linked
in the same article to confirm that you have a successful build
 
Posts that I used to troubleshoot and resolve specific cmake errors that I encountered are linked below
They may or may not be relavent in your case, but sharing here for reference
 
 
 
 
In terms of getting a usb web cam working, take a look here then check in with the guys in the thread:
 
 
 
Hope this helps

Acapulco Rolf

7 years 3 months ago

In reply to by Acapulco Rolf

 

Hi Kyle

By way of a demonstration, I've attached three cameras to my Raspberry Pi (3)

 
The cameras are:
1.Raspberry Pi Camera
2.Logitech C920 webcam (USB)
3.Logitech 4000 Pro webcam (USB)
 
The three cameras all show video output in the MyRobotLab OpenCV video widget as expected
 
Video: 
 
Which USB web camera do you have?
Check here for your web cam's compatibility with the Raspberry Pi
 
 
Hope this helps

 

Hi Kyle, yes that particular usb webcam appears to have been confirmed to work with the Pi according to the wikipage

For a usb webcam-Pi setup, use these Python/OpenCV tutorial and demos to prove your installation and setup before you tackle MRL

It's a three part series. Well worth walking through it end to end:

1

http://www.pyimagesearch.com/2015/12/21/increasing-webcam-fps-with-pyth…

2

http://www.pyimagesearch.com/2015/12/28/increasing-raspberry-pi-fps-wit…

3

http://www.pyimagesearch.com/2016/01/04/unifying-picamera-and-cv2-video…

 

Chime back in when you've had a chance to do some tests :)

 

So I followed the step by step tutorial on installing OpenCV 3.1.0 on the PI.  Which was awesome, good detail and seems to all worky.  I then am able to see my USB cam on the PI and installed fswebcam or something like that and was able to take a photo with the cam. Woohoo!  

Next, I am sure I jumped a bunch of steps and tries opening MRL and connecting OpenCV from a little Python script... and No Worky.  Then I decided to reboot, open up cv again and ran the following from command line:

$ source ~/.profile
$ workon cv
$ python
>>> import cv2
>>> cv2.__version__
'3.1.0'
>>>
 
this all seemed good.
I then stayed on the cv virtual environment and started MRL:
 
$ java --jar myrobotlab.jar
 
then ran my script again.
 
Still no video in the openCV tab???
 
I sent a No Worky but I am not sure there is really an issue with MRL.
 
A little more guidance would be great!
 
THANKS!
 
Kyle
 
 

Hi Kyle

I have a hunch

If you've followed all steps with succesful outcomes, the one final step is this:

From the command shell on the Pi run the following:

sudo apt-get install libunicap2

That's the step you need if you've not already installed that component

After some experiment, I've found that without that component the MRL OpenCV video widget will not show video output

Mats mentioned in an earlier post that Kwatters advised that this is a prerequisite

 

kyle.clinton

7 years 3 months ago

In reply to by Acapulco Rolf

So I worked with Kwatters a bit on this and the opencv inside MRL was just fine it just need that libunicap2 so. I am not sure if it just works because I am using USB and other stuff is needed for pi camera.

Thanks!