Skip to content

Instantly share code, notes, and snippets.

import cv2
import numpy as np
if __name__ == '__main__':
stylo = cv2.imread("stylo.png")
hsv = cv2.cvtColor(stylo, cv2.COLOR_BGR2HSV)
maxs = np.max(np.max(hsv, axis=0), axis=0)
mins = np.min(np.min(hsv, axis=0), axis=0)
# on accede au device
capture = cv2.VideoCapture(0)
import cv2
if __name__ == '__main__':
# on accede au device
capture = cv2.VideoCapture(0)
while True:
# on capture une image
_, frame = capture.read()
# on l'affiche :
@bechu
bechu / ros_topic_list.cpp
Last active November 24, 2022 03:31
Get all topic and type from ROS in c++ !
#include <ros/ros.h>
int main(int argc, char** argv)
{
ros::init(argc, argv, "ros_something");
ros::start();
XmlRpc::XmlRpcValue params("ros_topic_list");
XmlRpc::XmlRpcValue results;
XmlRpc::XmlRpcValue r;
// to compile : g++ norm.cpp -lIrrlicht -o norm
#include <irrlicht/irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
@bechu
bechu / json_check.sh
Created June 3, 2013 11:30
how to check the validy of json file
cat file.json | python -mjson.tool
@bechu
bechu / debug_variadic_template.cpp
Created May 15, 2013 13:22
use variadic template to fill string with parameters
#include <string>
#include <iostream>
#include <sstream>
std::wstring Anchor( int i )
{
std::wstringstream stream;
stream << i;
std::wstring str = L"{";
@bechu
bechu / python_plot_ping.py
Last active December 17, 2015 01:59
python matplotlib graph
import sys, os, random
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import matplotlib
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationToolbar
from matplotlib.figure import Figure
import subprocess
@bechu
bechu / boost_tcp_client.cpp
Created April 19, 2012 19:18
simple boost tcp client example
/*
g++ main.cpp -lboost_system -lboost_thread -lpthread -o main
*/
#include <boost/asio.hpp>
#include <boost/array.hpp>
#include <iostream>
void send_something(std::string host, int port, std::string message)