Skip to content

Instantly share code, notes, and snippets.

Daisuke YAMAGUCHI dyama

Block or report user

Report or block dyama

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View depthmap_to_pcd.py
q = np.array([
[1, 0, 0, -width/2],
[0, 1, 0, -height/2],
[0, 0, 0, focal_length],
[0, 0, -1/tx, 0]
])
_points, _colors = calc_point_cloud(image, disp, q)
points = list(_points)
colors = list(_colors)
View stereo.py
#!/usr/bin/python
# coding: utf-8
import numpy as np
import cv2
from matplotlib import pyplot as plt
img_left = cv2.imread("l.jpg",0)
img_right = cv2.imread("r.jpg",0)
img_left = cv2.GaussianBlur(cv2.equalizeHist(img_left), (3,3), 0)
img_right = cv2.GaussianBlur(cv2.equalizeHist(img_right) ,(3,3), 0)
View markov.rb
#!/usr/bin/ruby
# coding: utf-8
ts = {}
as = []
(`chasen source.txt`).each_line do |line|
as.push line.split(/\t/)[0]
end
@dyama
dyama / sample.lisp
Created Jun 15, 2016
Indended lisp sample
View sample.lisp
; ookiihou wo kaesu max kansuu
(defun ooki (x y)
(if (> x y)
x
y))
; fibonacchi suu wo kaesu
(defun fib (n)
(if (< n 2)
n
View indended-lisp.lisp
; ookiihou wo kaesu max kansuu
defun ooki (x y)
if (> x y)
x
y
; fibonacchi suu wo kaesu
defun fib (n)
if (< n 2)
n
@dyama
dyama / supoo.rb
Created Jun 15, 2016
Indent nest syntax for Lisp
View supoo.rb
$indent = 2
class Array;
def nest; self[0] end
def nest=(val); self[0]=val end
def value; self[1] end
def value=(val); self[1]=val end
def comment; self[2] end
def comment=(val); self[2]=val end
end
View md5name.sh
#!/bin/sh
# coding: utf-8
if [ $# -gt 0 ]; then
for file in$@
do
if [ -f$file-a -s$file” ]; then
# Get file extention
ext=`basename “$file| sed ‘s/^.*\.\(.*\)$/\1/gi’`;
if [ “$file== $ext ] ; then
View lifegame-1.hsp
/*
HSPによるライフゲームサンプル
参考文献:
『C言語による最新アルゴリズム辞典』奥村晴彦著/技術評論社
『人工生命の世界』服部桂/オーム社
*/
#define ScreenX 160
#define ScreenY 120
@dyama
dyama / rational.c
Last active Dec 17, 2015
Ratinal Test
View rational.c
#include <stdio.h>
#include <math.h>
/* 有理数型 */
struct Rational
{
int numer; /* 分子 */
int denom; /* 分母 */
};
typedef struct Rational Rational;
@dyama
dyama / fractal-tree.rb
Created Oct 28, 2015
siren sample scripts
View fractal-tree.rb
#!/usr/bin/siren
# coding: utf-8
#
# fractal tree
#
$start_len = 100.0
def tree(cur_pt, dir, len)
nxt_pt = cur_pt + dir * len
You can’t perform that action at this time.