Skip to content

Instantly share code, notes, and snippets.

@mmitou
mmitou / memo.md
Last active December 4, 2015 10:23

fedora22にOpenCV3.0をインストールした際のメモ

基本的にここを読めばよい。 https://github.com/davidcarne/pcbre/wiki/install_fedora

このメモでは $HOME/local 以下にOpenCVをインストールする。

OpenCV3.0のソースをzipでまとめたものは、ホームディレクトリに保存してあると仮定する。

#!/usr/bin/env python
# -*- coding:utf-8 -*-
import cv2
cap = cv2.VideoCapture(0)
substractor = cv2.createBackgroundSubtractorMOG2()
while(True):
succeeded, frame = cap.read()

AWS LambdaのPythonから利用出来るOpenCV3.0のライブラリを作成する手順

AWS Lambdaの実行環境の確認

AWSのLambda 実行環境と利用できるライブラリで確認する。

2015年12月現在では、 AMI ID: アジアパシフィック(東京) リージョンの ami-cbf90ecb を使っている。

OpenCVのビルド環境を作る

@mmitou
mmitou / User.csv
Last active December 16, 2015 17:26
物体検出
id (S) bucket_name (S) has_sent (BOOL) num_of_history (N) num_of_wait (N) prefix (S) ratio_threshold (N) topic_arn (S)
test mmitou false 250 3 data4/ 10 arn:aws:sns:ap-northeast-1:770170371212:test
#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>
static const size_t num_of_chunk_bits = 6;
static const char base64_conversion_table[64] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'
};
@mmitou
mmitou / obj_detect.py
Created February 12, 2016 09:01
物体検出
# -*- coding:utf-8 -*-
from __future__ import print_function, division, unicode_literals
import cv2
def mask_ratio(mask):
w, h = mask.shape
p = cv2.countNonZero(mask) / (w * h)
# -*- coding:utf-8 -*-
from __future__ import print_function, division, unicode_literals
import cv2
import urllib
import urllib2
from apiclient import discovery
from apiclient import http
from oauth2client.client import GoogleCredentials
# -*- coding:utf-8 -*-
from __future__ import print_function, division, unicode_literals
import threading
import Queue
import time
class Worker(threading.Thread):
def __init__(self, queue):
# -*- coding:utf-8 -*-
from __future__ import print_function, division, unicode_literals
import cv2
import time
def mask_ratio(mask):
w, h = mask.shape
@mmitou
mmitou / letsnoteCFS8.txt
Last active June 26, 2020 06:59
Unix Bench on Raspberry Pi Series.
BYTE UNIX Benchmarks (Version 5.1.3)
System: localhost.localdomain: GNU/Linux
OS: GNU/Linux -- 4.4.5-200.fc22.x86_64 -- #1 SMP Thu Mar 10 17:54:17 UTC 2016
Machine: x86_64 (x86_64)
Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
CPU 0: Intel(R) Core(TM)2 Duo CPU P8700 @ 2.53GHz (5054.1 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
CPU 1: Intel(R) Core(TM)2 Duo CPU P8700 @ 2.53GHz (5054.1 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization