Visual StudioでOpenCV2.4.9のプロジェクトを簡単に作るためのプロジェクトテンプレートを作成したので公開してみました。
以下のURLからプロジェクトテンプレート(opencv249_project_template.zip)を取得してください。
| Visual Studioバージョン | プロジェクトテンプレート |
#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; |
#!/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 |
PCL 1.7.2のVS2013ビルドを行った時にハマったポイントを備忘録としてまとめました。
#include <opencv2/core/core.hpp> | |
#include <iostream> | |
int main(int argc, const char* argv[]) | |
{ | |
cv::Mat img1(cv::Size(32 * 1024, 32 * 1024), CV_8UC3, cv::Scalar(0, 0, 255)); | |
if(img1.empty()) std::cout << "NG" << std::endl; | |
else std::cout << "OK" << std::endl; | |
cv::Mat img2(cv::Size(32 * 1024, 32 * 1024), CV_8UC3, cv::Scalar(255, 0, 0)); |
過去に公開した「OpenCVビルド用スクリプト」をプラットフォーム,OpenCVバージョン毎にまとめました.
→今後このコンテンツの更新はWikiで行います.
OpenCVバージョン | ビルド用スクリプト |
---|---|
2.4.9 | opencv2.4.9_build_vs2012_x64.bat |
過去に公開した「OpenCVを使ったプログラムのCMakeサンプル」をまとめました.
概要 | CMakeLists.txtサンプル |
---|---|
WITH_CUDAなし版 | OpenCVを使ったプログラムのCMakeサンプル |
WITH_CUDAあり版 | OpenCVを使ったプログラムのCMakeサンプル(WITH_CUDA版) |
:: 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% |
#include <opencv2/core/core.hpp> | |
#include <opencv2/highgui/highgui.hpp> | |
#include <iostream> | |
int main(int argc, const char* argv[]) | |
{ | |
// 画像を読み込む | |
cv::Mat src1 = cv::imread("lena.jpg", cv::IMREAD_COLOR); | |
// MatのデータをYAML形式のファイルに書き出す |
#include <opencv2/core/core.hpp> | |
#include <opencv2/imgcodecs.hpp> | |
#include <opencv2/imgproc/imgproc.hpp> | |
#include <iostream> | |
#define ENABLE_MEASURE_MEMORY | |
#ifndef ENABLE_MEASURE_MEMORY | |
#define MEASURE_MEMORY(x) {x;} | |
#else |