Skip to content

Instantly share code, notes, and snippets.

View tatsy's full-sized avatar
:octocat:
Render the possibility!

Tatsuya Yatagawa tatsy

:octocat:
Render the possibility!
View GitHub Profile
@tatsy
tatsy / mp4_compress.py
Created January 5, 2020 04:44
Compress image sequence into MP4 video
#!/usr/bin/python
import os
import argparse
import cv2
def is_image_file(filename):
""" Check whether the file name sounds like an image """
image_extensions = ['.jpg', '.jpeg', '.png', '.bmp', '.tiff', '.tif']
_, ext = os.path.splitext(filename)
@tatsy
tatsy / ..Orinent2D..
Last active September 9, 2019 07:18
Orientation detection filter
Calculate edge orientation for digital images.
BasedOnStyle: Google
IndentWidth: 4
AccessModifierOffset: -4
IndentCaseLabels: false
AlignConsecutiveAssignments: false
AlignTrailingComments: true
BinPackArguments: true
DerivePointerAlignment: false
@tatsy
tatsy / scholar.py
Last active February 2, 2018 07:20
Download open access paper from Google Scholar
import os
import sys
import re
import argparse
import urllib.parse
import urllib.request
import requests
from bs4 import BeautifulSoup
@tatsy
tatsy / diffusion.py
Last active August 12, 2016 22:23
Diffusion approximation
import math
import numpy as np
import matplotlib.pyplot as plt
class Color(object):
def __init__(self, r = 0.0, g = 0.0, b = 0.0):
if not isinstance(r, float) or \
not isinstance(g, float) or \
not isinstance(b, float):
raise Exception('Bad arguments!!')
@tatsy
tatsy / vec3.py
Last active July 29, 2016 08:58
Python Vec3
import math
class Vec(object):
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
@staticmethod
def dot(v1, v2):