- githubからmasterブランチのコードを取得する。
- ターミナルで以下のコマンドを実行する。
cd ~/<my_working_directory>
python opencv-master/platforms/osx/build_framework.py osx
※ビルドが完了するとosxディレクトリにopencv2.frameworkが生成される。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <opencv2/core/core.hpp> | |
#include <opencv2/imgproc/imgproc.hpp> | |
#include <opencv2/highgui/highgui.hpp> | |
#ifndef _DEBUG | |
#pragma comment(lib,"opencv_core300.lib") | |
#pragma comment(lib,"opencv_imgproc300.lib") | |
#pragma comment(lib,"opencv_highgui300.lib") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CMakeの最低バージョンを記述 | |
cmake_minimum_required(VERSION 2.8) | |
# ソリューション名を指定 | |
project(SampleSolution) | |
# OpenCVのパッケージを探す | |
find_package(OpenCV REQUIRED) | |
# OpenCVが見つかった場合のみ設定を行う |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CMakeの最低バージョンを記述 | |
cmake_minimum_required(VERSION 2.8) | |
# ソリューション名を指定 | |
project(SampleSolution) | |
# CUDAのライブラリパスを設定 | |
if(CUDA_TOOLKIT_ROOT_DIR) | |
if(CMAKE_SYSTEM_PROCESSOR MATCHES AMD64*|x86_64* OR MSVC64) | |
link_directories("${CUDA_TOOLKIT_ROOT_DIR}/lib/x64") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <opencv2/core.hpp> | |
#include <opencv2/core/ocl.hpp> | |
#include <opencv2/core/cuda.hpp> | |
#include <opencv2/highgui.hpp> | |
#include <opencv2/contrib.hpp> | |
#include <iostream> | |
#define USE_OPENCL | |
int main(int argc, const char* argv[]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <opencv2/core.hpp> | |
#include <opencv2/core/cuda.hpp> | |
#include <opencv2/core/utility.hpp> | |
#include <iostream> | |
int main(int argc, const char* argv[]) | |
{ | |
//(1) Build Information | |
std::cout << cv::getBuildInformation() << std::endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SOURCE_DIR="echo $(cd $(dirname $0);pwd)" | |
BUILD_DIR=${SOURCE_DIR}/build | |
GENERATOR_NAME="Unix Makefiles" | |
mkdir build | |
cd build | |
cmake \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get -yV install autoconf | |
sudo apt-get -yV install pkg-config | |
sudo apt-get -yV install cmake-gui | |
sudo apt-get -yV install libboost1.55-all-dev | |
sudo apt-get -yV install python | |
sudo apt-get -yV install python-numpy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: setting of the environment variables | |
set SOURCE_DIR=%~dp0 | |
set BUILD_DIR=%SOURCE_DIR%\build | |
set INSTALL_DIR=%BUILD_DIR%\install | |
set VC_VERSION_NUM=11 | |
set VCVARSALL_BAT="C:\Program Files (x86)\Microsoft Visual Studio %VC_VERSION_NUM%.0\VC\vcvarsall.bat" | |
set ARCH=amd64 | |
set GENERATOR_NAME=Visual Studio %VC_VERSION_NUM% Win64 | |
call %VCVARSALL_BAT% %ARCH% |
今後このコンテンツの更新はWikiで行います.
Visual Studioバージョン | WITH_CUDA | プロパティシート |
---|---|---|
VS2010/VS2012/VS2013共通 | 無効 | opencv249.props |
VS2010/VS2012/VS2013共通 | 有効 | opencv249_with_cuda.props |
OlderNewer