Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Vision co-processor Raspberry Pi (Raspbian Jessie/OpenCV) (http://www.chiefdelphi.com/forums/showthread.php?t=152854)

Skyehawk 12-28-2016 09:13 PM

Vision co-processor Raspberry Pi (Raspbian Jessie/OpenCV)
 
Hello all,
Machine vision routinely finds it's way into every few programming threads. FIRST has yet to give us a task that cannot be solved with the basic control system, but speed is almost always better in vision system, which can become an intensive process. A co-processor is a good way to offload some vision related tasks. The Raspberry pi 3 is readily available and low cost; a good entry level co-processor.

Open-CV is almost a necessity in machine vision, and can sometimes be an issue to get up and running (despite taking a few hours to build and install). I have a image of Raspbian Jessie with Open-CV installed that I am willing to share. I think there may be some licensing issues with my posting a download link, but PM me and I'll get you set up with the image and some documentation. I am not overly knowledgeable on the install process, so I will not be a huge help if issues arise, but the community is a great resource. The image is a bare bones Open-CV install built to run with python 2/3, no vision code or Pi/robot-Rio interface code is included.

Regards,
Skye Leake

SamCarlberg 12-29-2016 06:01 PM

Re: Vision co-processor Raspberry Pi (Raspbian Jessie/OpenCV)
 
Take a look here for some samples. I've built OpenCV python bindings for the pi 3, and there's some examples for python code to get people started.

SamcFuchs 12-29-2016 10:51 PM

Re: Vision co-processor Raspberry Pi (Raspbian Jessie/OpenCV)
 
In case you don't want to use an image, here's a script that automatically sets up an opencv python development environment on a raspberry pi.

Michael Hill 12-30-2016 05:03 AM

Re: Vision co-processor Raspberry Pi (Raspbian Jessie/OpenCV)
 
If anyone has figured out how to utilize the H.264 hardware decoder on the Pi with OpenCV without virtual hardware, that would be awesome. I have a C920 camera, which has H.264 compressed output (which is why you pay so much for it). Just changing the fourcc capture property doesn't seem to do the business. I have heard of setting up a gstreamer pipeline (which does use to hardware decoder) and setting the sink to /dev/video1 can work, but I'd like a cleaner solution.

euhlmann 12-30-2016 01:27 PM

Re: Vision co-processor Raspberry Pi (Raspbian Jessie/OpenCV)
 
Quote:

Originally Posted by Michael Hill (Post 1623988)
If anyone has figured out how to utilize the H.264 hardware decoder on the Pi with OpenCV without virtual hardware, that would be awesome. I have a C920 camera, which has H.264 compressed output (which is why you pay so much for it). Just changing the fourcc capture property doesn't seem to do the business. I have heard of setting up a gstreamer pipeline (which does use to hardware decoder) and setting the sink to /dev/video1 can work, but I'd like a cleaner solution.

Have you considered using libavcodec/libavformat?

Michael Hill 12-30-2016 03:21 PM

Re: Vision co-processor Raspberry Pi (Raspbian Jessie/OpenCV)
 
Quote:

Originally Posted by euhlmann (Post 1624010)
Have you considered using libavcodec/libavformat?

Hm, I hadn't heard of that. I'll see if I can get something to work with it. Thanks

BenBernard 12-30-2016 05:38 PM

Re: Vision co-processor Raspberry Pi (Raspbian Jessie/OpenCV)
 
@Skyehawk, does your image include the java artifacts for OpenCV?

Skyehawk 12-30-2016 05:56 PM

Re: Vision co-processor Raspberry Pi (Raspbian Jessie/OpenCV)
 
Quote:

Originally Posted by BenBernard (Post 1624026)
@Skyehawk, does your image include the java artifacts for OpenCV?

No, it is very barebones. However the build files for OpenCV have not been purged so it can be rebuilt and reinstalled. But if you are going to go through all that trouble you may as well work from scratch...

Sorry I couldn't be more help,
Skye Leake

BenBernard 12-30-2016 10:51 PM

Re: Vision co-processor Raspberry Pi (Raspbian Jessie/OpenCV)
 
No problem, and thanks. I have a build almost complete...and once I'm sure it's working properly I'll image it too--for the Java addicts among us.

BenBernard 01-03-2017 08:40 AM

Re: Vision co-processor Raspberry Pi (Raspbian Jessie/OpenCV)
 
FYI, I was finally able to get OpenCV fully built with Java 8 bindings and installed on a Pi 3 running Jessie.

I'll try to find a way to share an image (my card is 32GB, so a full image would be prohibitive) but in the meantime, here are the "Installing OpenCV 3.1.0 on Raspberry Pi Debian Jessy with Java Library" instructions I followed from Robin Henniges.

I also compared notes along the way with Adrian Rosebrock's excellent "Raspberry Pi 3 + Raspbian Jessie + OpenCV 3" instructions.

Following the two together should allow you to build an OpenCV build with Java and Python bindings, but my image will only have Java.

Full credit and thanks to both bloggers for their work and diligent documentation!


All times are GMT -5. The time now is 07:21 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi