Skip to content

Instantly share code, notes, and snippets.

@chris118
chris118 / 01-README.md
Created March 9, 2020 02:51 — forked from TheJLifeX/00-hand-gesture-recognition.gif
Simple Hand Gesture Recognition Code - Hand tracking - Mediapipe

Simple Hand Gesture Recognition Code - Hand tracking - Mediapipe

Goal of this gist is to recognize ONE, TWO, TREE, FOUR, FIVE, SIX, YEAH, ROCK, SPIDERMAN and OK. We use the LANDMARKS output of the LandmarkLetterboxRemovalCalculator. This output is a landmark list that contains 21 landmark. In the 02-landmarks.jpg picture below you can see the index of each landmark. Each landmark have x, y and z values. But only x, y values are sufficient for our Goal. If you dont want to copy/paste each the code on this gist, you can clone my forked version of mediapipe here: https://github.com/TheJLifeX/mediapipe. I have already commited all code in that repository.

We have five finger states.

  1. thumbIsOpen
@chris118
chris118 / gist:d243c188f2b442c87fd69262a28d8d26
Created February 26, 2020 11:00 — forked from Gibgezr/gist:0f403ee93a661bb01bbd
C++ file operation snippets
//C++ copy files
#include <fstream>
std::ifstream src("from.ogv", std::ios::binary);
std::ofstream dst("to.ogv", std::ios::binary | std::ios::trunc);
dst << src.rdbuf();
/*
the one-liner:
std::ofstream(dest) << std::ifstream(src).rdbuf();
0 = Success
1 = Operation not permitted
2 = No such file or directory
3 = No such process
4 = Interrupted system call
5 = Input/output error
6 = No such device or address
7 = Argument list too long
8 = Exec format error