Skip to content

Instantly share code, notes, and snippets.

View cashiwamochi's full-sized avatar
🐢
Debug -Stay Night-

cashiwamochi cashiwamochi

🐢
Debug -Stay Night-
View GitHub Profile
#!/bin/sh
# fileId name title size updated_at
# -------- --------------------- ------------ ---------- -------------------
# 757 sat_image_2018.zip 衛星画像2018年 1196800853 2019-09-09 17:36:11
signate download --competition-id=169 --file-id=757
unzip sat_image_2018.zip &
# 755 sat_image_2017_01.zip 衛星画像2017年前半 1100993010 2019-09-09 17:36:11
signate download --competition-id=169 --file-id=755
@cashiwamochi
cashiwamochi / sfm_from_videos.sh
Created April 28, 2019 10:53
An easy script for sfm using colmap
#!/bin/bash
# Extract frames from video
mkdir images
ffmpeg -i $1 -r 24 -q:v 1 images/%06d.jpg
# ffmpeg -i $1 -ss start[sec] -t end[sec] [framerate] -q:v 1 %06d.jpg
# start to colmap process
DATASET_PATH=$(pwd)
@cashiwamochi
cashiwamochi / generate_dataset_RE.py
Created November 14, 2018 16:20
RealEstate10kのデータセットを生成するスクリプト.pytubeのバグでいくつかはDLできず,失敗した情報はテキストに吐き出される.
import os
import sys
import glob
import subprocess
from pytube import YouTube
if __name__=="__main__":
if len(sys.argv) != 2:
@cashiwamochi
cashiwamochi / cifar10ConvertToPng.nim
Last active September 23, 2018 15:27
This nim source converts binary of cifar10 to PNG. Some packages are needed, if you use this, please install them for yourself.
import os
import streams
import sequtils
import nimPNG, math, tables, base64
import private.buffer
import progress
const
height: int = 32
width: int = 32
@cashiwamochi
cashiwamochi / simple_kalman_filter.cc
Last active June 11, 2018 09:00
一次元の値を予測する( ? )カルマンフィルタの実装.http://www.cs.unc.edu/~welch/media/pdf/kalman_intro.pdf をコードに落としたら上手く動いた.http://scipy.github.io/old-wiki/pages/Cookbook/KalmanFiltering のC++版に相当するはず.
#include <iostream>
#include <vector>
#include <random>
#include <cmath>
#include <string>
#include <fstream>
int main(int argc, char* argv[]) {
if(argc != 2) {
#include <dirent.h>
vector<string> readFileInDir(char* path_to_image) {
vector<string> paths;
DIR* dp=opendir(path_to_image);
string s_path_to_image = path_to_image;
if (dp!=NULL)
{
struct dirent* d;
@cashiwamochi
cashiwamochi / g2o_homography.cc
Created November 27, 2017 05:04
g2oでH行列
#include <Eigen/Core>
#include <iostream>
#include <opencv2/opencv.hpp>
#include "g2o/stuff/sampler.h"
#include "g2o/stuff/command_args.h"
#include "g2o/core/sparse_optimizer.h"
#include "g2o/core/block_solver.h"
#include "g2o/core/solver.h"