基本的にここを読めばよい。 https://github.com/davidcarne/pcbre/wiki/install_fedora
このメモでは $HOME/local 以下にOpenCVをインストールする。
OpenCV3.0のソースをzipでまとめたものは、ホームディレクトリに保存してあると仮定する。
基本的にここを読めばよい。 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 実行環境と利用できるライブラリで確認する。
2015年12月現在では、 AMI ID: アジアパシフィック(東京) リージョンの ami-cbf90ecb を使っている。
| 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', '+', '/' | |
| }; |
| # -*- 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 |
| 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 |