Skip to content

Instantly share code, notes, and snippets.

@atinfinity
atinfinity / yaml_sample.cpp
Last active August 29, 2015 14:11
YAML入出力サンプル
#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形式のファイルに書き出す
@atinfinity
atinfinity / build_framework.py
Last active November 4, 2015 10:05
OpenCV 3.0-beta Mac OS X向けframeworkビルド用スクリプト(Mac OS X/Xcode/x86_64)
#!/usr/bin/env python
"""
The script builds OpenCV.framework for iOS.
The built framework is universal, it can be used to build app and run it on either iOS simulator or real device.
Usage:
./build_framework.py <outputdir>
By cmake conventions (and especially if you work with OpenCV repository),
the output dir should not be a subdirectory of OpenCV source tree.
@atinfinity
atinfinity / oclMat_custom_kernel.cpp
Last active September 14, 2023 07:26
sample code to execute custom OpenCL kernel on OpenCV 2.4.9
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/ocl/ocl.hpp>
// cl_mem構造体を参照するためにインクルード
#if defined __APPLE__
#include <OpenCL/cl.h>
#else
#include <CL/cl.h>
#endif
@atinfinity
atinfinity / measure_memory.cpp
Last active August 29, 2015 14:14
OpenCVメモリ使用量計測サンプル
#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
@atinfinity
atinfinity / labeling_sample.cpp
Last active August 29, 2015 14:14
ラベリングのサンプルプログラム
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
#include <vector>
int main( int argc, const char** argv )
{
// source image
@atinfinity
atinfinity / oclMat_custom_kernel2.cpp
Created February 18, 2015 13:48
sample code to execute custom OpenCL kernel on OpenCV 2.4.9
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/ocl/ocl.hpp>
// cl_mem構造体を参照するためにインクルード
#if defined __APPLE__
#include <OpenCL/cl.h>
#else
#include <CL/cl.h>
#endif
@atinfinity
atinfinity / opencv2410_2411_diff.md
Last active June 3, 2017 00:41
OpenCV 2.4.10.1 vs 2.4.11差分まとめ

OpenCV 2.4.10.1 vs 2.4.11差分まとめ

OpenCV 2.4.10.1OpenCV 2.4.11の差分をディレクトリ別で簡易的にまとめました.

3rdparty

  • 自動DLされるTBBが4.1から4.3にUpdate

apps

  • annotation用アプリ(ソース)追加
@atinfinity
atinfinity / opencv2.4.9_build-ubuntu14.10.sh
Last active May 7, 2020 15:22
OpenCV 2.4.9 Makefile生成用スクリプトファイル(Ubuntu14.10)
#!/bin/bash
SOURCE_DIR="echo $(cd $(dirname $0);pwd)"
BUILD_DIR=${SOURCE_DIR}/build
GENERATOR_NAME="Unix Makefiles"
mkdir build
cd build
cmake \
@atinfinity
atinfinity / opencv3.0-rc1_build_vs2012_x64.bat
Last active November 9, 2015 06:05
OpenCV 3.0-rc1ビルド用バッチファイル(VS2012/64bit/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%
@atinfinity
atinfinity / opencv3.0-rc1_build-ubuntu14.10.sh
Last active May 7, 2020 15:22
OpenCV 3.0-rc1 Makefile生成用スクリプトファイル(Ubuntu14.10)
#!/bin/bash
SOURCE_DIR="echo $(cd $(dirname $0);pwd)"
BUILD_DIR=${SOURCE_DIR}/build
GENERATOR_NAME="Unix Makefiles"
mkdir build
cd build
cmake \