-
Notifications
You must be signed in to change notification settings - Fork 1
/
ocvdemos.py
44 lines (33 loc) · 854 Bytes
/
ocvdemos.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python
'''
OpenCV demos.
'''
from itertools import count
import glob
import os
import sys
# Python 2/3 compatibility
PY3 = sys.version_info[0] == 3
if PY3:
xrange = range
import numpy as np
from matplotlib import pyplot as plt
import cv2
import pdb
import time
sys.path.append(os.path.expanduser('~/pd/opencv/opencv-3.1.0/samples/python/'))
from video import create_capture, Album
from common import clock
# Record the results of processing the video using vwriter
from vwriter import VideoWriter
from piwall import ImageViewer
from frame import Frame
class Image:
def __init__(self, path):
self.img = cv2.imread(path)
h,w,c = self.img.shape
print('%s : h %d w %d c %d' % (path, h, w, c))
def main():
bigRodent = Image('data/poster_rodents_big.jpg')
if __name__ == '__main__':
main()