GithubHelp home page GithubHelp logo

ksvbka / buildopencv Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jetsonhacksnano/buildopencv

0.0 1.0 0.0 48 KB

Scripts for build OpenCV on the NVIDIA Jetson Nano Developer Kit

License: MIT License

Shell 100.00%

buildopencv's Introduction

buildOpenCV

Script for building OpenCV 4 on the NVIDIA Jetson Nano Developer Kit

Building for:

  • Jetson Nano
  • L4T 32.2.1/JetPack 4.2.2
  • OpenCV 4.1.1
  • Packaging Option ( Builds package by default; --no_package does not build package)

Note: The script does not check to see which version of L4T is running before building, understand the script may only work with the stated versions.

Building

This is a long build, you may want to write to a log file, for example:

$ ./buildOpenCV.sh |& tee openCV_build.log

While the build will still be written to the console, the build log will be written to openCV_build.log for later review.

On the Jetson Nano, this is a challenging build. There is not enough memory on the Nano to make with multiple jobs (i.e)

$ make -j4

without using a significant amount of swap file space. With L4T 32.2.1, there is a default swap space. However, if you are using a SD card, this can result in long compile times as both physcial memory and the swap file memory exhaust. Recommend using a USB drive for building. If you use a SD card, consider setting the environment variable NUM_JOBS in the buildOpenCV.sh script to 1. The build time may be longer, but you will not have the same amount of memory/SD card thrashing. If you are using a USB drive, you may want to add a swapfile: https://github.com/JetsonHacksNano/installSwapfile.

Note that if you are building for Python, you most definitely will benefit from building with a swap file and running on a USB drive. See: https://github.com/JetsonHacksNano/installSwapfile

Usage

usage: ./buildOpenCV.sh [[-s sourcedir ] | [-h]]
     -s | --sourcedir Directory in which to place the opencv sources (default $HOME ; this is usually ~/)
     -i | --installdir Directory in which to install opencv libraries (default /usr/local)
     --no_package Do not package OpenCV as .deb file (default is true)
     -h | --help Print help

Build Parameters

OpenCV is a very rich environment, with many different options available. Check the script to make sure that the options you need are included/excluded. By default, the buildOpenCV.sh script selects these major options:

  • CUDA on
  • GStreamer
  • V4L - (Video for Linux)
  • QT - (No gtk support built in)
  • Python 2 bindings
  • Python 3 bindings

Packaging

By default, the build will create a OpenCV package. The package file will be found in:

opencv/build/_CPACK_Packages/Linux/STGZ/OpenCV-4.1.1-<commit>-aarch64.sh

The advantage of packaging is that you can use the resulting package file to install this OpenCV build on other machines without having to rebuild. Whether the OpenCV package is built or not is controlled by the CMake directive CPACK_BINARY_DEB in the script.

Notes

November 2019, Initial Release

  • Jetson Nano
  • L4T 32.2.1/JetPack 4.2.2
  • OpenCV 4.1.1
  • Packaging Option ( Builds package by default; --no_package does not build package)

buildopencv's People

Contributors

jetsonhacks avatar jetsonhacksnano avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.