infineon4engineers Facebook

infineon@google+ Google+

infineon@linkedin linkedin

infineon4engi@twitter twitter

infineon@youtube youtube

View Poll Results: How many of you develop Software for RPi2/3 on Windows or Unix?

Voters
1. You may not vote on this poll
  • Unix (Raspbian, Fedora, Ubuntu)

    0 0%
  • Windows(7, 8, 8.1, 10)

    1 100.00%
Multiple Choice Poll.
+ Reply to Thread
Results 1 to 2 of 2

Thread: OpenCV

  1. #1
    Beginner Beginner DanyDJ is on a distinguished road DanyDJ's Avatar
    Join Date
    Apr 2016
    Location
    Vienna
    Posts
    7
    Points
    85

    OpenCV

    Hello everybody


    This is going to be a collective Thread. Im going to present to you different [HowTos] in order to work with your Raspberry Pi 2 and OpenCV.
    For this reason, Id kindly ask you to be patient, Ill be publishing all information in different Posts.

    If you have any questions, please use the PM-System. Ill try to answer all your questions as soon as possible.

    [HowTo] Install OpenCV on the Raspberry Pi 2 B Model


    I know there are a lot of HowTos on this topic on the web. However, most of them require compiling the source-files on your own. A task, that takes a lot of time, effort and patience.
    As some teams will use a Raspberry Pi 2 / Pi 3 in combination with the XMC4500 for the object-detection, Ive decided to show how it is done the "lacy"-way:

    Requirments:
    - Raspberry Pi 2 running Raspbian
    - connection to the internet on the Raspberry Pi
    - some experience using the terminal and the 'nano'-Editor


    Pre-Installation Duties
    Befor installing opencv and its dependencies, make shure your entire system is up-to-date.
    Code:
    sudo apt-get update
    Code:
    sudo apt-get ugrade
    Code:
    sudo rpi-upgrade


    Installation
    The easiest way is to go with the apt-get-thing
    Code:
    sudo apt-get install libopencv-dev python-opencv
    This installs all dependencies required to work with OpenCV in C/C++ or PYTHON.
    That was all the magic .

    EDIT: This is taken from http://milq.github.io/install-opencv-ubuntu-debian/
    Last edited by DanyDJ; Jul 6th, 2016 at 06:43 AM. Reason: adding information, changing to collective thread, added information
    There are 10 types of people in this world. Those that understand binary and those that don't
    strtok() - You come in peace, but you go back in pieces.

  2. #2
    Beginner Beginner DanyDJ is on a distinguished road DanyDJ's Avatar
    Join Date
    Apr 2016
    Location
    Vienna
    Posts
    7
    Points
    85
    [HowTo] Use OpenCV with a PiCam NoIR

    I know there are again hundrets of tutorials around this topic. As I mentioned befor, Ill show you the "lacy"-way without compiling anything ect.

    Requirments:
    - Raspberry Pi 2 running Raspbian
    - a Keyboard, Mouse and Screen connected to the Raspberry Pi 2 (in the further course RPi2)


    Pre-Installation Duties:
    As in the Post above please enshure that your system is up-to date. For this, please refer to the previous post (section is named the same).

    Configuration:
    Once the system is up and running, open a terminal (shell). Run the following command:
    Code:
    sudo raspi-config


    The following Screen should come up:
    Click image for larger version

Name:	raspi-config-configuration-rasbian.png
Views:	1
Size:	13.9 KB
ID:	2454
    Select Option "5 Enable Camera"
    You should now be asked if you want to enable the PiCam on the RPi2:
    Click image for larger version

Name:	enable_camera_support_raspberry.jpg
Views:	1
Size:	11.4 KB
ID:	2455
    Once enable leave the raspi-config. When leaving you might be asked to reboot.

    After Reboot run the following command in the terminal:
    Code:
    sudo modprobe bcm2835-v4l2
    A classy note of mine:
    Insert this line into a shell-script and make it executable. Its not realy a driver that you start, Ill just call it that way. The correct description would be kernel-module.
    Code:
    nano InitPiCamDriver.sh
    Insert the line and with STRG+X save changes and close.
    Make it executable:
    Code:
    sudo chmod +x InitPiCamDriver.sh
    OpenCV offers the isOpened()-method. With the help of this method it should be easy to detect wether the driver is running or not.

    Last Step is to include the PiCam into your OpenCV Code:
    Code:
    int main()
    {
        VideoCapture cap;
        Mat frame;
    
        cap.open(0);
    
        while(1)
        {
            cap>>frame;
            imshow("Original-Image", frame);
    
            waitKey(30);    // this is extremly important, otherwise there is now time to grab the next frame and display it to the screen.
        }
    }
    Have fun!
    Last edited by DanyDJ; Jul 6th, 2016 at 11:16 PM. Reason: added OpenCV Code
    There are 10 types of people in this world. Those that understand binary and those that don't
    strtok() - You come in peace, but you go back in pieces.

+ Reply to Thread

Tags for this Thread

Disclaimer

All content and materials on this site are provided as is. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.