Skip to content

Instantly share code, notes, and snippets.

View LaurentBerger's full-sized avatar

Laurent Berger LaurentBerger

View GitHub Profile
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.19041.
-- The CXX compiler identification is MSVC 19.16.27041.0
-- The C compiler identification is MSVC 19.16.27041.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
Microsoft Windows [version 10.0.19041.804]
(c) 2020 Microsoft Corporation. Tous droits réservés.
C:\Users\Laurent>G:\Lib\depthai\run_tests.py
No calibration file. Using Calibration Defaults.
No calibration file. Using Calibration Defaults.
Using depthai module from: C:\Users\Laurent\AppData\Roaming\Python\Python38\site-packages\depthai.cp38-win_amd64.pyd
Depthai version installed: 0.4.1.1
←[92mCompiled mode found: compiled for 14 shaves, 14 cmx_slices and 1 NN_engines ←[0m
XLink initialized.
@LaurentBerger
LaurentBerger / gist:c71105eeaa28452d0ac8eb43b49e726c
Created January 27, 2021 10:07
read obj and mtl file using vtk
#include <vtkNamedColors.h>
#include <vtkOBJImporter.h>
#include <vtkX3DExporter.h>
#include <vtkPolyData.h>
#include <vtkPolyDataMapper.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkRenderer.h>
#include <vtkSmartPointer.h>
#include <vtkTexture.h>
@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 \
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);
'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.
%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
> 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_
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;
$ ./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