Skip to content

Instantly share code, notes, and snippets.

View kashimAstro's full-sized avatar
🔒
busy

Dario Longobardi kashimAstro

🔒
busy
View GitHub Profile
@kashimAstro
kashimAstro / adaptive_histogram_equalization.cpp
Created February 15, 2018 18:32
Adaptive histogram equalization opencv
#include <opencv2/core.hpp>
#include <vector>
int main(int argc, char** argv)
{
cv::Mat bgr_image = cv::imread("image.png");
cv::Mat lab_image;
cv::cvtColor(bgr_image, lab_image, CV_BGR2Lab);
// Estrazione L channel
@kashimAstro
kashimAstro / https.conf
Created January 26, 2018 23:08
https apache
# mkdir /etc/apache2/ssl
# openssl req -x509 -nodes -days 1095 -newkey rsa:2048 -out /etc/apache2/ssl/server.crt -keyout /etc/apache2/ssl/server.key
# a2enmod ssl
# ln -s /etc/apache2/sites-available/default-ssl.conf /etc/apache2/sites-enabled/000-default-ssl.conf
# vi /etc/apache2/sites-enabled/000-default-ssl.conf
change:
## SSLCertificateFile /etc/apache2/ssl/server.crt
## SSLCertificateKeyFile /etc/apache2/ssl/server.key
# /etc/init.d/apache2 restart
@kashimAstro
kashimAstro / ofLogAudio.h
Last active January 23, 2018 21:07
simple script audio synth for openframeworks
class ofLogAudio : public ofThread{
public:
bool startSpeak = false;
string msg;
string speak;
void start(string _c="/usr/bin/espeak -v mb-it3")
{
speak = _c;
startThread(true);
@kashimAstro
kashimAstro / segment.cpp
Created January 2, 2018 19:55
ofxGPIO test 7 segment
#include <iostream>
#include "ofxGPIO.h"
#define CMD 0x80
#define ON 0x01
#define OFF 0
#define BRI 0xE0
#define ADD 0x70
I2c * i2c;
@kashimAstro
kashimAstro / ofxgpio-spi-speed.cpp
Created December 20, 2017 12:25
spi speed with ioctl ofxGPIO
#include "ofxGPIO.h"
/*
ofxGPIO
speed test SPI
*/
int main(int argc, char ** argv)
{
@kashimAstro
kashimAstro / sem_multithread.cpp
Created October 18, 2017 09:49
simple multithreading with semaphore posix c++
#include <iostream>
#include <unistd.h>
#include <thread>
#include <vector>
#include <signal.h>
#include <semaphore.h>
using namespace std;
vector<thread*> th;
@kashimAstro
kashimAstro / kalman_filter.h
Created March 1, 2016 20:46
kalman filter IMU / MPU6050
//https://en.wikipedia.org/wiki/Kalman_filter#Example_application.2C_technical
class Kalman {
public:
Kalman() {
Q_angle = 0.001;
Q_bias = 0.003;
R_measure = 0.03;
angle = 0;
bias = 0;
@kashimAstro
kashimAstro / tcp.ino
Created March 13, 2017 14:54
TCP server for ESP-07
#include <ESP8266WiFi.h>
const char* ssid = "************";
const char* password = "************";
WiFiServer server(5055);
int pinLeft = 13;
int pinRight = 12;
bool ValLeft = false;
@kashimAstro
kashimAstro / google_image.cpp
Created March 3, 2017 18:26
search image by google for popular trainer dlib
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <stdio.h>
#include <regex>
#include <fstream>
#include <curl/curl.h>
void write_file(std::string p, std::string d)
@kashimAstro
kashimAstro / imglab_commandline.cpp
Last active March 2, 2017 16:26
dlib imglab command line, tool for train machine learning with dlib
/*
http://dlib.net/train_object_detector.cpp.html
Usage:
first step create positive train:
./bin/imglab_commandline positive/ "30,20,520,520" "person"
second step create negative train in append positive train previously created: