Skip to content

Instantly share code, notes, and snippets.

View LaurentBerger's full-sized avatar

Laurent Berger LaurentBerger

View GitHub Profile
#!/bin/bash -e
myRepo=$(pwd)
CMAKE_CONFIG_GENERATOR="Visual Studio 15 2017 Win64"
RepoSource=Caffe
RepoBuild=CaffeBis
installDepen=G:/Lib/install
pushd Build/$RepoBuild
CMAKE_OPTIONS='-DINSTALL_PREREQUISITES:BOOL=OFF -DCOPY_PREREQUISITES:BOOL=OFF -DUSE_OPENCV:BOOL=ON -DUSE_LEVELDB:BOOL=OFF -DUSE_LMDB:BOOL=OFF -DUSE_OPENMP:BOOL=OFF -DUSE_NCCL:BOOL=OFF -DCPU_ONLY:BOOL=ON '
cmake -G"$CMAKE_CONFIG_GENERATOR" -DBUILD_SHARED_LIBS:BOOL=OFF \
-DBLAS:STRING=MKL \
name: "LeNetSimplifie2"
layer {
name: "data"
type: "MemoryData"
top: "data"
top: "label"
include {
phase: TRAIN
}
transform_param {
function MAJGitRepo
# $1=nom $2 $3=url
{
if [ ! -d "$myRepo/$1" ]; then
echo "clonning ${1}"
git clone $2
mkdir Build/$1
else
echo "update $1"
cd $1
$ ./buildocv.sh
/G/lib/Build/opencv /G/lib
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.18363.
-- Detected processor: AMD64
-- Found ZLIB: optimized;G:/lib/install/zlib/lib/zlibstatic.lib;debug;G:/lib/ins tall/zlib/lib/zlibstaticd.lib (found suitable version "1.2.11", minimum required is "1.2.3")
-- libjpeg-turbo: VERSION = 2.0.2, BUILD = opencv-4.2.0-dev-libjpeg-turbo
-- Found ZLIB: optimized;G:/lib/install/zlib/lib/zlibstatic.lib;debug;G:/lib/ins tall/zlib/lib/zlibstaticd.lib (found version "1.2.11")
-- found Intel IPP (ICV version): 2019.0.0 [2019.0.0 Gold]
-- at: G:/Lib/build/opencv/3rdparty/ippicv/ippicv_win/icv
-- found Intel IPP Integration Wrappers sources: 2019.0.0
Mat m = imread("g:/lib/opencv/samples/data/lena.jpg", IMREAD_GRAYSCALE);
Mat mask = Mat::zeros(m.size(), CV_8UC1), maskBlur, mc;
// mask is a contour
vector<vector<Point>> c = { {Point(200,100),Point(250,100),Point(350,250),Point(350,300),Point(150,350) } };
drawContours(mask, c, 0, Scalar(255), -1);
Mat negMask;
// neg mask
bitwise_not(mask, negMask);
Mat md, mdBlur, mdint;
> opencv_core400d.dll!cv::ocl::OpenCLBinaryCacheConfigurator::OpenCLBinaryCacheConfigurator() Line 329 C++
opencv_core400d.dll!cv::ocl::OpenCLBinaryCacheConfigurator::getSingletonInstance() Line 523 C++
opencv_core400d.dll!cv::ocl::Program::Impl::compileWithCache(const cv::ocl::Context & ctx, const cv::ocl::ProgramSource::Impl * src_, std::basic_string<char,std::char_traits<char>,std::allocator<char> > & errmsg) Line 3562 C++
opencv_core400d.dll!cv::ocl::Program::Impl::compile(const cv::ocl::Context & ctx, const cv::ocl::ProgramSource::Impl * src_, std::basic_string<char,std::char_traits<char>,std::allocator<char> > & errmsg) Line 3553 C++
opencv_core400d.dll!cv::ocl::Program::Impl::Impl(const cv::ocl::ProgramSource & src, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _buildflags, std::basic_string<char,std::char_traits<char>,std::allocator<char> > & errmsg) Line 3538 C++
opencv_core400d.dll!cv::ocl::Program::create(const cv::ocl::ProgramSource & src, const std::basic_
%YAML:1.0
---
camera_matrix: !!opencv-matrix
rows: 3
cols: 3
dt: d
data: [ 1.4158902516875357e+03, 0., 6.3884892450469977e+02, 0.,
1.4148769661542008e+03, 4.7637428042847074e+02, 0., 0., 1. ]
distortion_coefficients: !!opencv-matrix
rows: 1
'python.exe' (Win32): Loaded 'F:\Program Files\Python\python.exe'. Symbols loaded.
'python.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Cannot find or open the PDB file.
'python.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Cannot find or open the PDB file.
'python.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. Cannot find or open the PDB file.
'python.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'. Cannot find or open the PDB file.
'python.exe' (Win32): Loaded 'F:\Program Files\Python\python36.dll'. Symbols loaded.
'python.exe' (Win32): Loaded 'F:\Program Files\Python\vcruntime140.dll'. Cannot find or open the PDB file.
'python.exe' (Win32): Loaded 'C:\Windows\System32\shlwapi.dll'. Cannot find or open the PDB file.
'python.exe' (Win32): Loaded 'C:\Windows\System32\version.dll'. Cannot find or open the PDB file.
'python.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. Cannot find or open the PDB file.
my code :
{
string filename("g:/lib/opencv/samples/data/lena.jpg");
Mat _I = imread(filename.c_str(), IMREAD_COLOR);
cv::Mat I = _I;
if (I.depth())
cv::normalize(I, I, 0., 255., cv::NORM_MINMAX, CV_8U);
@LaurentBerger
LaurentBerger / gist:497391fc36dd453b7aeea9a172673b46
Last active January 23, 2021 12:22
build opencv for android
myRepo=$(pwd)
RepoSource=opencv
CMAKE_CONFIG_GENERATOR="Ninja"
CMAKE_CONFIG_GENERATOR="MinGW Makefiles"
ANDROID_NDK=/F/Android_ndk/android-ndk-r18b
ANDROID_HOME=/F/Data_SDK_Android
cd Build/opencvandroidv7a
CMAKE_OPTIONS='-DBUILD_opencv_world:BOOL=OFF -DBUILD_PERF_TESTS:BOOL=OFF -DBUILD_TESTS:BOOL=OFF -DBUILD_DOCS:BOOL=OFF -DWITH_CUDA:BOOL=OFF -DBUILD_EXAMPLES:BOOL=ON -DENABLE_PRECOMPILED_HEADERS=OFF -DWITH_IPP=OFF -DWITH_MSMF=OFF -DCPU_DISPATCH='
cmake -DCMAKE_MAKE_PROGRAM=${ANDROID_NDK}/prebuilt/windows-x86_64/bin/make.exe \
-DANDROID_ABI=armeabi-v7a \