Skip to content

Instantly share code, notes, and snippets.

View denkiwakame's full-sized avatar
:octocat:
Working from home

Mai Nishimura denkiwakame

:octocat:
Working from home
View GitHub Profile
@denkiwakame
denkiwakame / gist:10576358
Created April 13, 2014 09:29
GCJ2014 problemD
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <utility>
#!/usr/bin/ruby
def toGrayCode(binary)
return binary ^ (binary >> 1)
end
def binaryStr(num)
binaryStr = ""
while num > 0
binaryStr = String(num & 1) + binaryStr
// filio::output
system("mkdir data");
cv::FileStorage cvfs("./data/camera.xml", CV_STORAGE_WRITE);
cv::write(cvfs,"intrinsicMat", intrinsic_param_matrix);
cv::write(cvfs,"distCoeffs", distortion_coeffs);
// fileio::input
cv::FileStorage cvfs("./data/camera.xml", CV_STORAGE_READ);
cv::FileNode node(cvfs.fs, NULL);
cv::Mat in_mat, dist_coeff;
@denkiwakame
denkiwakame / index.html
Created May 22, 2014 15:49
わかめカメラ
<!DOCTYPE html>
<html lang="en">
<head>
<title>active background</title>
<style>
<!--
html body{
background-color: #cccccc;
height:100%;
}
@denkiwakame
denkiwakame / incalib.cpp
Created May 22, 2014 16:42
ざっくりincalibしとく
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <sstream>
std::string gen_fpath(int i, std::string ext)
{
CCACHE = #ccache
CC = $(CCACHE) g++ -pipe -Wall -fopenmp -g #-pg -g
CXX = $(CCACHE) g++ -pipe -Wall -fopenmp -g #-pg -g
FC = $(CCACHE) gfortran -pipe -Wall #-pg -g
ifndef DEBUG
CFLAGS = -g -O3 -mtune=native -msse3 -unroll-all-loops -fstrict-aliasing -ftree-vectorize
else
CFLAGS = -pg -O0
endif
@denkiwakame
denkiwakame / gist:149bdd84b47d70151bbf
Created May 31, 2014 12:58
boost::program_options
#include <boost/program_options.hpp>
#include <iostream>
int main(int argc, char const* argv[])
{
// add options
boost::program_options::options_description cmdline("Command line options");
cmdline.add_options()
("help,h", "show help message")
("list", "list available cameras")
" URL: http://vim.wikia.com/wiki/Example_vimrc
" Authors: http://vim.wikia.com/wiki/Vim_on_Freenode
" Description: A minimal, but feature rich, example .vimrc. If you are a
" newbie, basing your first .vimrc on this file is a good choice.
" If you're a more advanced user, building your own .vimrc based
" on this file is still a good idea.
"------------------------------------------------------------
" Features {{{1
"
@denkiwakame
denkiwakame / gist:ddfc8bbc8a6d99ef3a87
Last active August 29, 2015 14:03
雑カメ制御
#include "FlyCapture2.h"
#include <math.h>
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <string>
#include <cassert>
#include <vector>
\documentclass[twocolumn,oneside,a4paper]{jarticle}
% ERROR
% \usepackage[dvipdfm]{graphicx}
\usepackage[dvipdfm]{graphicx}
\usepackage{amsmath,amssymb}
\title{ほげほげを用いたふがふが推定}
\author{へのへのもへじ}
\date{\today}