Skip to content

Instantly share code, notes, and snippets.

View AIOSYM's full-sized avatar

David Pich AIOSYM

  • Loglass Inc.
  • Tokyo, Japan
View GitHub Profile
disabled_rules:
- trailing_whitespace
opt_in_rules:
- empty_count
- empty_string
excluded:
- Carthage
- Pods
@AIOSYM
AIOSYM / UIImage+Resize.swift
Created January 12, 2021 14:51 — forked from bgreenlee/UIImage+Resize.swift
Swift port of UIImage+Resize, UIImage+Alpha, and UIImage+RoundedCorner, from http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage-the-right-way/
//
// UIImage+Resize.swift
// Port of UIImage+Resize.m
// from http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage-the-right-way/
//
import Foundation
import UIKit
extension UIImage {
@AIOSYM
AIOSYM / write-mp4.py
Created January 22, 2020 05:06
Write video as MP4 format in OpenCV
cap = cv2.VideoCapture(0)
width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
out = cv2.VideoWriter('out.mp4', cv2.VideoWriter_fourcc(*'mp4v'), 24, (width, height))
...
out.write(frame)
@AIOSYM
AIOSYM / webcam.py
Last active January 28, 2020 05:12
Capture and display frame with OpenCV
import sys
import cv2
import numpy as np
SKIP_FRAMES = 3
RESIZE_HEIGHT = 360
WIN_NAME = 'Webcam Display'
CAP = cv2.VideoCapture(0)