Skip to content

Instantly share code, notes, and snippets.

View RDCH106's full-sized avatar
Partially offline. No time...

Rubén de Celis Hernández RDCH106

Partially offline. No time...
View GitHub Profile
@RDCH106
RDCH106 / OpenCV_Mouse_Event_Handler.cpp
Last active June 19, 2020 12:16
OpenCV Mouse Event Handler
View OpenCV_Mouse_Event_Handler.cpp
#include "opencv2/opencv.hpp"
#include <iostream>
using namespace cv;
using namespace std;
Mat frame;
void mouseEventHandler(int event, int x, int y, int flags, void* param)
{
@RDCH106
RDCH106 / execution_time.cpp
Last active August 29, 2015 14:23
Execution Time
View execution_time.cpp
#include <iostream>
#include <ctime>
unsigned t0, t1;
t0=clock()
// Code to execute
t1 = clock();
double time = (double(t1-t0)/CLOCKS_PER_SEC);
@RDCH106
RDCH106 / OpenCV_Display_2_Images_in_1_Window.cpp
Last active January 20, 2016 13:12
Display 2 Images in 1 Window with OpenCV
View OpenCV_Display_2_Images_in_1_Window.cpp
#include "opencv2/opencv.hpp"
int display(){
//cv::VideoCapture cap1(0); // open the default camera
cv::VideoCapture cap1(0); // open the first camera
cv::VideoCapture cap2(1); // open the second camera
if(!cap1.isOpened()) // check if we succeeded
return -1;
@RDCH106
RDCH106 / OpenCV_loadImages.cpp
Last active January 20, 2016 13:10
Load numerated images from a folder using OpenCV
View OpenCV_loadImages.cpp
void OpenCV_loadImages( const std::string &folder, const std::string &tag, const std::string format, std::vector<cv::Mat> &images ){
images.clear();
std::string fileName;
int index = 1;
while( true ){
fileName = folder + "/" + tag + std::to_string( (long long) index) + "." + format;
cv::Mat newImage = cv::imread( fileName );
if( newImage.empty() ) break;
images.push_back( newImage );
@RDCH106
RDCH106 / calculateSimilarPolygon.cpp
Created November 18, 2015 09:37
Calculate the similar polygon that it is concentric to the original polygon, using a scaling factor
View calculateSimilarPolygon.cpp
#include "opencv2/opencv.hpp"
#include <vector>
using namespace cv;
using namespace std;
vector<Point> calculateSimilarPolygon(vector<Point>&pListPoints, Point center, float factor){
vector<Point> spolygon;
float v1, v2;
int x, y;
@RDCH106
RDCH106 / banner_code_snippet.html
Created February 3, 2016 22:56
Banner Code Snippet
View banner_code_snippet.html
<!-- Javascript Code -->
<script>
function copyToClipboard(object) {
object.focus();
object.select();
document.execCommand('copy');
alert("Copiado al Portapapeles");
}
</script>
@RDCH106
RDCH106 / test_call-VS-start.bat
Last active February 8, 2016 08:59
Windows .BAT script for testing differences between CALL and START
View test_call-VS-start.bat
@ECHO OFF
ECHO Execution using CALL
ECHO -------------------------------------------
ECHO Main execution running...
ECHO Calling to ping...
call ping google.es
ECHO.
ECHO Continue main execution
@RDCH106
RDCH106 / motd
Created April 20, 2016 09:36
MOTD example with ASCII Art
View motd
_ __________ _,
_.-(_)._ ." ". .--""--. _.-{__}-._
.'________'. | .--------. | .' '. .:-'`____`'-:.
[____________] /` |________| `\ / .'``'. \ /_.-"`_ _`"-._\
/ / .\/. \ \| / / .\/. \ \ || .'/.\/.\'. | /` / .\/. \ `\
| \__/\__/ |\_/ \__/\__/ \_/| : |_/\_| ; | | \__/\__/ |
\ / \ / \ '.\ /.' / .-\ /-.
/'._ -- _.'\ /'._ -- _.'\ /'. `'--'` .'\/ '._-.__--__.-_.' \
/_ `""""` _\/_ `""""` _\ /_ `-./\.-' _\'. `""""""""` .'`\
(__/ '| \ _)_| |_)_/ \__)| ' | |
@RDCH106
RDCH106 / OpenCV_Mouse_Event_Handler_2.cpp
Last active June 19, 2020 12:17
OpenCV Mouse Event Handler 2
View OpenCV_Mouse_Event_Handler_2.cpp
#include "opencv2/opencv.hpp"
#include <iostream>
using namespace cv;
using namespace std;
Mat frame;
void mouseEventHandler(int event, int x, int y, int flags, void* param)
{
@RDCH106
RDCH106 / win10colors.cmd
Created October 4, 2016 10:23 — forked from mlocati/win10colors.cmd
ANSI Colors in standard Windows 10 shell
View win10colors.cmd
@echo off
cls
echo  STYLES 
echo ^<ESC^>[0m Reset
echo ^<ESC^>[1m Bold
echo ^<ESC^>[4m Underline
echo ^<ESC^>[7m Inverse
echo.
echo  NORMAL FOREGROUND COLORS 
echo ^<ESC^>[30m Black (black)