Skip to content

Instantly share code, notes, and snippets.

View YoshiRi's full-sized avatar

Yoshi Ri YoshiRi

  • Shinagawa, Tokyo, Japan
View GitHub Profile
@YoshiRi
YoshiRi / put_japanese_to_cvimg.py
Created January 2, 2021 15:58
日本語の文字をOpenCVの画像ファイルに書き込む関数(PIL経由)
import pyocr
import cv2
import numpy as np
import pyocr.builders
import matplotlib.pyplot as plt
from PIL import Image, ImageDraw, ImageFont
## 参考:https://qiita.com/mo256man/items/82da5138eeacc420499d
def cv2_putJPText(img, text, org, fontFace='C:\Windows\Fonts\HGRPP1.TTC', fontScale=10, color=(255,0,0), mode=0):
"""
@YoshiRi
YoshiRi / spl.traineddata
Last active January 2, 2021 13:46
Splatoon2のカタカナを学習したフォントファイル。(Tesseract用)spl.traineddataが数字専用,spl2.traineddataがカタカナ専用
@YoshiRi
YoshiRi / ModStudy.ipynb
Created September 22, 2020 17:03
Mod Study for atcoder Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@YoshiRi
YoshiRi / eul2quat_self.m
Created July 18, 2019 17:19
Quaternion Tools
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Euler angle to quaternion
% input : roll,pitch,yaw [rad]
% output quaternion:
% you need robotics toolbox
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function Q = eul2quat_self(rpy)
roll = rpy(1);
@YoshiRi
YoshiRi / PublishPose.ino
Created January 27, 2019 11:09
Publish Pose
///////////////////////////////////////////
// Yoshi Ri @ Univ Tokyo
// 8 April 2018
//////////////////////////////////////////
// for servo motor control
#include <Servo.h>
#include <Encoder.h>
// ROS communication
//#include <ArduinoHardware.h>
@YoshiRi
YoshiRi / Python based experiment settings.ipynb
Last active October 7, 2018 15:38
実験テキスト Python版
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@YoshiRi
YoshiRi / Homography Decomposition Test.ipynb
Last active June 2, 2018 17:57
Homography decomposition test
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@YoshiRi
YoshiRi / startup.m
Created April 19, 2018 11:19
MATLAB defalut settings
% figure のデフォルトフォント設定
set(0, 'defaultAxesFontSize', 12);
set(0, 'defaultTextFontSize', 12);
set(0, 'defaultAxesFontName','Times-Roman');
set(0,'defaultTextFontName','Times-Roman');
% ブロックのデフォルトフォントを変更
set_param(0,'DefaultBlockFontSize',11);
set_param(0,'DefaultBlockFontName','Times-Roman');
% ラインのデフォルトフォントサイズを変更
set_param(0,'DefaultLineFontSize',9);
@YoshiRi
YoshiRi / Particle_Filter_Test.m
Last active February 5, 2018 12:30
Particle Filter implementation in matlab
%% test for particle filter
% Problem Setting is here
% https://ja.wikipedia.org/wiki/%E3%82%AB%E3%83%AB%E3%83%9E%E3%83%B3%E3%83%95%E3%82%A3%E3%83%AB%E3%82%BF%E3%83%BC#%E5%BF%9C%E7%94%A8%E4%BE%8B
% settings
dt = 0.001; % time sample
s_sys = 10000; % system noise
s_out = 0.05; % measurement noise
s_rout = 0.1;
% system eq
@YoshiRi
YoshiRi / GPUvsCPU_SURFextraction.cpp
Last active October 12, 2017 07:01
compiling : g++ -ggdb matchingtest.cpp `pkg-config --cflags --libs opencv`
// for image processing
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/core/utility.hpp"
#include "opencv2/xfeatures2d.hpp"
#include "opencv2/flann.hpp"
#include "opencv2/cudaarithm.hpp"
#include "opencv2/cudafeatures2d.hpp"