Skip to content

Instantly share code, notes, and snippets.

@yoggy
yoggy / test-class.cpp
Created February 21, 2014 07:03
sample class definition for c++ ...
//
// test-class.cpp - sample class definition for c++ ...
//
// $ g++ test-class.cpp -o test-class && ./test-class
// c={a:1, b:2]
// d={a:4, b:7]
//
#include <iostream>
#include <sstream>
//
// invert mask sample for OpenCV (C++)
//
#include "stdafx.h"
int main(int argc, char* argv[])
{
cv::Mat src;
src.create(cv::Size(640, 480), CV_8UC1);
src.setTo(0);
//
// RGB to HSV convert sample
//
// see also : http://ja.wikipedia.org/wiki/HSV%E8%89%B2%E7%A9%BA%E9%96%93
//
#include <stdio.h>
#include <math.h>
#define min_f(a, b, c) (fminf(a, fminf(b, c)))
#include <stdio.h>
#include <stdlib.h>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#if _DEBUG
#pragma comment(lib, "opencv_core248d.lib")
#pragma comment(lib, "opencv_imgproc248d.lib")
#pragma comment(lib, "opencv_highgui248d.lib")
#include <stdio.h>
#include <stddef.h>
typedef struct _hoge {
int a;
char c;
float f;
} Hoge;
int main(int argc, char* argv[])
@yoggy
yoggy / gphoto2_theta_memo.txt
Last active January 2, 2016 13:48
gphoto2でthetaを見てみたテスト(USB接続)
$ LANG=C gphoto2 --summary
Camera summary:
Manufacturer: Ricoh Company, Ltd.
Model: RICOH THETA
Version: 01.10
Serial Number: xxxxxxxx
Vendor Extension ID: 0x6 (1.10)
Capture Formats:
Display Formats: Association/Directory, JPEG, Firmware
@yoggy
yoggy / robot_sample.pde
Created January 6, 2014 09:35
how to use java.awt.Robot class in processing ...
//
// how to use java.awt.Robot class in processing ...
//
import java.awt.*;
import java.awt.event.*;
Robot robot;
PFont pfont;
Point save_p;
@yoggy
yoggy / opencv_test.pde
Last active January 1, 2016 21:29
sample sketch for "OpenCV for Processing" library...
//
// sample sketch for "OpenCV for Processing" library...
//
String image_url = "nike.jpg";
Mat test_img;
void setup() {
size(640, 480);
initOpenCV();
}
String url = "http://example.com/path/to/camera_image.jpg";
void setup() {
size(640, 480);
}
void draw() {
PImage img = loadImage(url);
tint(#aaeeff, 40);
//
// sample sketch for "OpenCV for Processing" library...
//
import gab.opencv.*;
import org.opencv.core.*;
import org.opencv.imgproc.*;
String image_url = "http://example.com/path/to/movie.jpg";
OpenCV opencv;
Mat test_img;