Code Monkey home page Code Monkey logo

opencv-complete-build-cuda's Introduction

Latest OpenCV Installer From Source.

PRs Welcome Code Climate Issue Count

Full build script for Open CV with/without cuda and bumblebee support.

Need

After playing around with so many parameters and building OpenCV from source, I realized how painful this was. I ended up creating an installer script for my convienience and since now I feel pretty confident that I have perfected this, I am relasing this to everyone so your life can be simpler too.

Short Link

The install script is located at: http://bit.ly/OpenCV-Latest

Installation

One Line Install:

$ curl -fsSL http://bit.ly/OpenCV-Latest | bash -s /path/to/download/folder

One Line Install With Bumblebee:

$ curl -fsSL http://bit.ly/OpenCV-Latest | optirun bash -s /path/to/download/folder

Fetching Updates

One Line Install:

$ curl -fsSL http://bit.ly/OpenCV-Latest | bash -s /existing/download/path

One Line Install With Bumblebee:

$ curl -fsSL http://bit.ly/OpenCV-Latest | optirun bash -s /existing/download/path

Pre Install

You need to have the curl package to issue the online install.

$ sudo apt install curl

Post Install

Make sure to setup relevant paths for python so that OpenCV packages can be accessed. Generally the the path will be:

$HOME/.opencv/lib/pythonX.X/dist-package

Where X.X = {2.7, 3.2}. If your system does not have $PYTHONPATH variable, set this in your profile.

Features

This script will download and install everything required by OpenCV and build everything fresh. In case you already have the repos downloaded and just want to refresh the latest build. Simply provide the same download path and everything latest will be pulled in.

License

GPLv3

opencv-complete-build-cuda's People

Contributors

whizzzkid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

opencv-complete-build-cuda's Issues

HELPPPP!!! - python, c++ issue

Hi Whizzkid!

First of all thanks a lot for this repo. I have been trying to build opencv from source for two days and using your scripts is the first time I could build it successfully.

I'm relatively new to openCV, so pardon my potentially dumb question.

  1. In this guide you mention: $HOME/.opencv/lib/pythonX.X/dist-package
    but I can't seem to find .opencv file in my directory. So not sure which python version I should put it in.

  2. does it mean that the library compiled only work for python project? (using import in python script)? How about for C++ projects? Does it need to be added into environment or sth? I was trying to call open cv through "#include <opencv2/core/version.hpp>" but couldn't make it work. or do I need to put the folder somewhere inside the project?

I'm trying to do a python opencv with cuda accel, using https://github.com/alexanderkoumis/opencv-gpu-py . but I couldn't build the opencv through his guide.

Please helpppppp :( THANKS A LOTT!!

Build failing during build of Ceres Solver.

First of all,I want to say I love the script put forth in here. Simply amazing, detailed and easy to interpret.
Every package installation and download worked A-Ok but during build I came across this issue after 9% of build.

In file included from /home/imr555/Desktop/opencv/ceres-solver/include/ceres/internal/numeric_diff.h:43:0, from /home/imr555/Desktop/opencv/ceres-solver/include/ceres/dynamic_numeric_diff_cost_function.h:44, from /home/imr555/Desktop/opencv/ceres-solver/include/ceres/gradient_checker.h:42, from /home/imr555/Desktop/opencv/ceres-solver/internal/ceres/gradient_checker.cc:33: /home/imr555/Desktop/opencv/ceres-solver/include/ceres/internal/fixed_array.h: In static member function ‘static constexpr bool ceres::internal::FixedArray<T, N, A>::DefaultConstructorIsNonTrivial()’: /home/imr555/Desktop/opencv/ceres-solver/include/ceres/internal/fixed_array.h:103:13: error: ‘is_trivially_default_constructible’ is not a member of ‘std’ return !std::is_trivially_default_constructible<StorageElement>::value; ^ /home/imr555/Desktop/opencv/ceres-solver/include/ceres/internal/fixed_array.h:103:67: error: expected primary-expression before ‘>’ token return !std::is_trivially_default_constructible<StorageElement>::value; ^ /home/imr555/Desktop/opencv/ceres-solver/include/ceres/internal/fixed_array.h:103:68: error: ‘::value’ has not been declared return !std::is_trivially_default_constructible<StorageElement>::value; ^ In file included from /home/imr555/Desktop/opencv/ceres-solver/include/ceres/internal/numeric_diff.h:43:0, from /home/imr555/Desktop/opencv/ceres-solver/include/ceres/dynamic_numeric_diff_cost_function.h:44, from /home/imr555/Desktop/opencv/ceres-solver/include/ceres/gradient_checker.h:42, from /home/imr555/Desktop/opencv/ceres-solver/internal/ceres/gradient_checking_cost_function.cc:41: /home/imr555/Desktop/opencv/ceres-solver/include/ceres/internal/fixed_array.h: In static member function ‘static constexpr bool ceres::internal::FixedArray<T, N, A>::DefaultConstructorIsNonTrivial()’: /home/imr555/Desktop/opencv/ceres-solver/include/ceres/internal/fixed_array.h:103:13: error: ‘is_trivially_default_constructible’ is not a member of ‘std’ return !std::is_trivially_default_constructible<StorageElement>::value; ^ /home/imr555/Desktop/opencv/ceres-solver/include/ceres/internal/fixed_array.h:103:67: error: expected primary-expression before ‘>’ token return !std::is_trivially_default_constructible<StorageElement>::value; ^ /home/imr555/Desktop/opencv/ceres-solver/include/ceres/internal/fixed_array.h:103:68: error: ‘::value’ has not been declared return !std::is_trivially_default_constructible<StorageElement>::value; ^ /home/imr555/Desktop/opencv/ceres-solver/include/ceres/internal/fixed_array.h: In instantiation of ‘static constexpr bool ceres::internal::FixedArray<T, N, A>::DefaultConstructorIsNonTrivial() [with T = double; long unsigned int N = 18446744073709551615ul; A = std::allocator<double>]’: /home/imr555/Desktop/opencv/ceres-solver/include/ceres/internal/fixed_array.h:137:40: required from ‘ceres::internal::FixedArray<T, N, A>::FixedArray(ceres::internal::FixedArray<T, N, A>::size_type, const allocator_type&) [with T = double; long unsigned int N = 18446744073709551615ul; A = std::allocator<double>; ceres::internal::FixedArray<T, N, A>::size_type = long unsigned int; ceres::internal::FixedArray<T, N, A>::allocator_type = std::allocator<double>]’ /home/imr555/Desktop/opencv/ceres-solver/include/ceres/internal/numeric_diff.h:126:66: required from ‘static bool ceres::internal::NumericDiff<CostFunctor, kMethod, kNumResiduals, ParameterDims, kParameterBlock, kParameterBlockSize>::EvaluateJacobianForParameterBlock(const CostFunctor*, const double*, const ceres::NumericDiffOptions&, int, int, int, double**, double*) [with CostFunctor = ceres::CostFunction; ceres::NumericDiffMethodType kMethod = (ceres::NumericDiffMethodType)0u; int kNumResiduals = -1; ParameterDims = ceres::internal::ParameterDims<true>; int kParameterBlock = -1; int kParameterBlockSize = -1]’ /home/imr555/Desktop/opencv/ceres-solver/include/ceres/dynamic_numeric_diff_cost_function.h:146:35: required from ‘bool ceres::DynamicNumericDiffCostFunction<CostFunctor, method>::Evaluate(const double* const*, double*, double**) const [with CostFunctor = ceres::CostFunction; ceres::NumericDiffMethodType method = (ceres::NumericDiffMethodType)0u]’ /home/imr555/Desktop/opencv/ceres-solver/internal/ceres/gradient_checker.cc:277:1: required from here /home/imr555/Desktop/opencv/ceres-solver/include/ceres/internal/fixed_array.h:104:3: error: body of constexpr function ‘static constexpr bool ceres::internal::FixedArray<T, N, A>::DefaultConstructorIsNonTrivial() [with T = double; long unsigned int N = 18446744073709551615ul; A = std::allocator<double>]’ not a return-statement } ^ internal/ceres/CMakeFiles/ceres.dir/build.make:1142: recipe for target 'internal/ceres/CMakeFiles/ceres.dir/gradient_checking_cost_function.cc.o' failed make[2]: *** [internal/ceres/CMakeFiles/ceres.dir/gradient_checking_cost_function.cc.o] Error 1 make[2]: *** Waiting for unfinished jobs.... internal/ceres/CMakeFiles/ceres.dir/build.make:1118: recipe for target 'internal/ceres/CMakeFiles/ceres.dir/gradient_checker.cc.o' failed make[2]: *** [internal/ceres/CMakeFiles/ceres.dir/gradient_checker.cc.o] Error 1 CMakeFiles/Makefile2:1861: recipe for target 'internal/ceres/CMakeFiles/ceres.dir/all' failed make[1]: *** [internal/ceres/CMakeFiles/ceres.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make: *** [all] Error 2

Might be some sort of issue in the latest ceres package. I did a bit of googling. But haven't been able to build it successfully yet. I am fairly new to this. So, suggestions on running this script locally would also be helpful :) . Any suggestions would be helpful. Thanks in advance

Script modifications suggestion.

Hello!

Thank you for such a helpful script.

I suggest you to configure following cmake options (as shown in opencv/opencv#9549):

-DBUILD_PROTOBUF=OFF
-DPROTOBUF_UPDATE_FILES=ON

Without these options compilation fails with different protobuf errors. I've checked this on protobuf versions 3.4.x and 3.5.x - in both cases these options let me avoid error messages.

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.