This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python | |
''' | |
setup instruction | |
for Install pythonosc | |
pip install python-osc | |
''' | |
from pythonosc import dispatcher |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#tsv, csvファイルからデータの読み込み | |
def readFile(filePath): | |
#TSVの場合#delimiter="\t" | |
#CSVの場合"," | |
_d= "\t"#"," | |
#skiprows=1 : 最初の行を無視する | |
_data = np.loadtxt(filePath,delimiter = _d,skiprows=1) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scipy.stats import shapiro | |
#https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.shapiro.html | |
def doShapirotest(data): | |
stat, p = shapiro(data) | |
print("Shapirotest Wstat , p-value", stat, p) | |
if(p < 0.05): | |
print("USE NON-PARAMETRIC TEST :(p < 0.05)") | |
else: | |
print("USE PARAMETRIC TEST : (p > 0.05)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# me - this DAT | |
# scriptOp - the OP which is cooking | |
import numpy as np | |
import cv2 | |
import io | |
import numpy as np | |
import matplotlib | |
import matplotlib.pyplot as plt | |
matplotlib.use('Agg') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import os | |
def save_all_frames(video_path, dir_path, basename, ext='jpg'): | |
cap = cv2.VideoCapture(video_path) | |
if not cap.isOpened(): | |
return | |
os.makedirs(dir_path, exist_ok=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
_list = glob.glob("*.mov", recursive=True) | |
for fname in _list: | |
sampleName = os.path.basename(fname).split('.', 1)[0] | |
print(sampleName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import cv2 | |
import glob | |
_list = glob.glob("./some/*", recursive=True) | |
_list.sort() | |
fourcc = cv2.VideoWriter_fourcc('m', 'p', '4', 'v') | |
video = cv2.VideoWriter('./some/video.mp4',fourcc, 60.0, (1024, 1024)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
arr = op('td_top').numpyArray('delayed=True') | |
gray = arr[:, :, 0] | |
gray = gray * 255.0 | |
gray = gray.astype(np.uint8) | |
#flip | |
gray = cv2.flip(gray, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from cv2 import aruco | |
import cv2 | |
aruco_dict = aruco.Dictionary_get(aruco.DICT_6X6_250) | |
board = aruco.CharucoBoard_create(28, 16, 200, 140, aruco_dict) | |
imboard = board.draw((1920,1080)) | |
cv2.imwrite('CharucoBoard.png', imboard) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -load camera instrinsic matrix | |
cameraMatrix = np.loadtxt("calib/cameraMatrix.csv",delimiter=",") | |
distCoeffs = np.loadtxt("calib/distCoeffs.csv",delimiter=",") | |
# prepare the 'same' aruco board | |
aruco = cv2.aruco | |
dictionary = aruco.getPredefinedDictionary(aruco.DICT_4X4_50) | |
board = cv2.aruco.GridBoard_create(5, 5, 0.2,0.1,dictionary) | |
# retval = cv.aruco.GridBoard_create( markersX, markersY, markerLength, markerSeparation, dictionary[ |
OlderNewer