Skip to content

Instantly share code, notes, and snippets.

@enpe
enpe / CMakeLists.txt
Last active November 25, 2022 04:15
OpenCV chroma key
cmake_minimum_required( VERSION 3.0 )
project( so-opencv-calibration )
find_package( OpenCV 3.0.0 EXACT REQUIRED )
set( INPUT_FILENAME "${CMAKE_CURRENT_LIST_DIR}/input_00.png" ) # Input file, e.g. http://i.stack.imgur.com/WjER0.png
add_executable( mwe mwe.cpp )
target_compile_definitions( mwe PRIVATE -DINPUT_FILENAME="${INPUT_FILENAME}" )
target_include_directories( mwe PRIVATE ${OpenCV_INCLUDE_DIRS} )
target_link_libraries( mwe ${OpenCV_LIBS} )
@enpe
enpe / opencv-bug-4448.cpp
Created July 12, 2015 19:29
OpenCV bug 4448: minimal example
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <iostream>
#include <vector>
int main()
{
using namespace std;
@enpe
enpe / main.cpp
Last active October 9, 2020 11:42
Deleting rows (or columns) from cv::Mat.
// For more details see: http://stackoverflow.com/questions/29696805/what-is-the-best-way-to-remove-a-row-or-col-from-a-cv-mat
#include "Timer.h" // http://www.songho.ca/misc/timer/timer.html
#include <opencv2/core/core.hpp>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <cstring>