Skip to content

Instantly share code, notes, and snippets.

View toshinoritakata's full-sized avatar

Toshinori Takata toshinoritakata

View GitHub Profile
@toshinoritakata
toshinoritakata / gist:6559815
Created September 14, 2013 08:03
Photoshopでレイヤーマスクを選択する。 レイヤーマスクを作業対象にするにはレイヤーを選択後、レイヤーマスクのチャンネルを表示して選択する必要がある
var Layer_Name = "レイヤー名";
// SELECT LAYER =======================================================
var idslct = charIDToTypeID( "slct" );
var desc227 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref170 = new ActionReference();
var idChnl = charIDToTypeID( "Chnl" );
var idChnl = charIDToTypeID( "Chnl" );
var idMsk = charIDToTypeID( "Msk " );
@toshinoritakata
toshinoritakata / gist:8800518
Last active August 29, 2015 13:56
pyaudioで取得した音量をOSCを使ってデータを送る。 2つのマイクをコールバック関数にIDを返すことで識別している。
#!python3
# -*- coding: utf-8 -*-
import math
import pyaudio
import time
import argparse
import struct
from pythonosc import osc_message_builder
@toshinoritakata
toshinoritakata / gist:8800627
Created February 4, 2014 09:34
Mentalrayのnormal画像(32bit float)を読み込む
def read_image(img_file):
with open(img_file, 'rb') as img:
(format, nll, xres, yres, verson) = unpack('>BBHHH', img.read(8))
pixels = np.zeros([yres, xres, 3]) # y,xでアクセスする
for iy in range(yres):
line = unpack('>{0}f'.format(xres*3), img.read(4*xres*3))
for lx, ix in enumerate(range(0, xres*3, 3)):
pixels[iy][lx] = line[ix:ix+3]
gPhoto2をcygwinでビルドする
cygwinにpopt-devlをインストールしておく
公式サイトからgphotoとlibgphotoをダウンロード
libgphotoをビルド
sh configure
make
make install
@toshinoritakata
toshinoritakata / gist:d39cde559180461624f9
Last active October 8, 2015 23:48
VODをiphoneで再生できるムービーに変換
ffmpeg -i VTS_01_1.VOB -b:v 1500k -r 30 -vcodec h264 -strict -2 -acodec aac -ar 44100 -f mp4 out.mp4
ffmpeg -i "concat:VTS_01_1.VOB|VTS_01_2.VOB" -b:v 1500k -r 30 -vcodec h264 -strict -2 -acodec aac -ar 44100 -f mp4 out.mp4
@toshinoritakata
toshinoritakata / taskctrl.cs
Last active October 10, 2015 13:37
時間が来たらプロセスを落としてスリープに入る
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TaskCtrl
{
class Program
@toshinoritakata
toshinoritakata / makeicon.bat
Last active August 24, 2016 01:06
DOSでallディレクトリ内のpngファイルを25%縮小してiconフォルダに同名で保存する
FOR %1 in (all\*.png) DO magick -verbose %1 -resize 50% icon\%~xn1
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
#if UNITY_5_3 || UNITY_5_3_OR_NEWER
using UnityEngine.SceneManagement;
#endif
using OpenCVForUnity;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
#if UNITY_5_3 || UNITY_5_3_OR_NEWER
using UnityEngine.SceneManagement;
#endif
using OpenCVForUnity;
@toshinoritakata
toshinoritakata / CGWORLD3_FaceDetectionWebCamTextureExampleTracked.cs
Last active December 17, 2018 15:25
連載3 顔検出 複数対応版
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
#if UNITY_5_3 || UNITY_5_3_OR_NEWER
using UnityEngine.SceneManagement;
#endif
using OpenCVForUnity;