initial commit

This commit is contained in:
Dmitriy Anisimov
2014-09-13 18:28:41 +04:00
parent cff5e3ee88
commit 1007c06d44
159 changed files with 118 additions and 5119 deletions

View File

@@ -113,8 +113,8 @@ if __name__ == '__main__':
try:
fn1, fn2 = args
except:
fn1 = 'data/aero1.jpg'
fn2 = 'data/aero3.jpg'
fn1 = '../data/aero1.jpg'
fn2 = '../data/aero3.jpg'
img1 = cv2.imread(fn1, 0)
img2 = cv2.imread(fn2, 0)

View File

@@ -43,7 +43,7 @@ if __name__ == '__main__':
try:
fn = sys.argv[1]
except:
fn = '../cpp/baboon.jpg'
fn = '../data/baboon.jpg'
src = cv2.imread(fn)

View File

@@ -31,7 +31,7 @@ if __name__ == '__main__':
fn = sys.argv[1]
except:
fn = 0
cam = video.create_capture(fn, fallback='synth:bg=../cpp/baboon.jpg:class=chess:noise=0.05')
cam = video.create_capture(fn, fallback='synth:bg=../data/baboon.jpg:class=chess:noise=0.05')
while True:
flag, frame = cam.read()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 704 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -19,11 +19,11 @@ Usage:
ESC - exit
Examples:
deconvolution.py --angle 135 --d 22 data/licenseplate_motion.jpg
deconvolution.py --angle 135 --d 22 ../data/licenseplate_motion.jpg
(image source: http://www.topazlabs.com/infocus/_images/licenseplate_compare.jpg)
deconvolution.py --angle 86 --d 31 data/text_motion.jpg
deconvolution.py --circle --d 19 data/text_defocus.jpg
deconvolution.py --angle 86 --d 31 ../data/text_motion.jpg
deconvolution.py --circle --d 19 ../data/text_defocus.jpg
(image source: compact digital photo camera, no artificial distortion)
@@ -70,7 +70,7 @@ if __name__ == '__main__':
try:
fn = args[0]
except:
fn = 'data/licenseplate_motion.jpg'
fn = '../data/licenseplate_motion.jpg'
win = 'deconvolution'

View File

@@ -56,7 +56,7 @@ if __name__ == "__main__":
if len(sys.argv)>1:
im = cv2.imread(sys.argv[1])
else :
im = cv2.imread('../c/baboon.jpg')
im = cv2.imread('../data/baboon.jpg')
print "usage : python dft.py <image_file>"
# convert to grayscale

View File

@@ -3,7 +3,7 @@
'''
SVM and KNearest digit recognition.
Sample loads a dataset of handwritten digits from 'digits.png'.
Sample loads a dataset of handwritten digits from '../data/digits.png'.
Then it trains a SVM and KNearest classifiers on it and evaluates
their accuracy.
@@ -38,7 +38,7 @@ from common import clock, mosaic
SZ = 20 # size of each digit is SZ x SZ
CLASS_N = 10
DIGITS_FN = 'data/digits.png'
DIGITS_FN = '../data/digits.png'
def split2d(img, cell_size, flatten=True):
h, w = img.shape[:2]

View File

@@ -22,7 +22,7 @@ if __name__ == '__main__':
try:
fn = sys.argv[1]
except:
fn = '../cpp/fruits.jpg'
fn = '../data/fruits.jpg'
print __doc__
img = cv2.imread(fn, 0)

View File

@@ -38,7 +38,7 @@ if __name__ == '__main__':
cascade = cv2.CascadeClassifier(cascade_fn)
nested = cv2.CascadeClassifier(nested_fn)
cam = create_capture(video_src, fallback='synth:bg=../cpp/lena.jpg:noise=0.05')
cam = create_capture(video_src, fallback='synth:bg=../data/lena.jpg:noise=0.05')
while True:
ret, img = cam.read()

View File

@@ -139,8 +139,8 @@ if __name__ == '__main__':
try:
fn1, fn2 = args
except:
fn1 = '../cpp/box.png'
fn2 = '../cpp/box_in_scene.png'
fn1 = '../data/box.png'
fn2 = '../data/box_in_scene.png'
img1 = cv2.imread(fn1, 0)
img2 = cv2.imread(fn2, 0)

View File

@@ -22,7 +22,7 @@ if __name__ == '__main__':
try:
fn = sys.argv[1]
except:
fn = '../cpp/fruits.jpg'
fn = '../data/fruits.jpg'
print __doc__
img = cv2.imread(fn, True)

View File

@@ -52,7 +52,7 @@ if __name__ == '__main__':
try:
img_fn = sys.argv[1]
except:
img_fn = '../cpp/baboon.jpg'
img_fn = '../data/baboon.jpg'
img = cv2.imread(img_fn)
if img is None:

View File

@@ -102,9 +102,9 @@ print __doc__
if len(sys.argv) == 2:
filename = sys.argv[1] # for drawing purposes
else:
print "No input image given, so loading default image, lena.jpg \n"
print "No input image given, so loading default image, ../data/lena.jpg \n"
print "Correct Usage: python grabcut.py <filename> \n"
filename = '../cpp/lena.jpg'
filename = '../data/lena.jpg'
img = cv2.imread(filename)
img2 = img.copy() # a copy of original image

View File

@@ -57,7 +57,7 @@ if __name__ == '__main__':
if len(sys.argv)>1:
fname = sys.argv[1]
else :
fname = '../cpp/lena.jpg'
fname = '../data/lena.jpg'
print "usage : python hist.py <image_file>"
im = cv2.imread(fname)

View File

@@ -3,7 +3,7 @@
'''
This example illustrates how to use cv2.HoughCircles() function.
Usage: ./houghcircles.py [<image_name>]
image argument defaults to ../cpp/board.jpg
image argument defaults to ../data/board.jpg
'''
import cv2
@@ -15,7 +15,7 @@ print __doc__
try:
fn = sys.argv[1]
except:
fn = "../cpp/board.jpg"
fn = "../data/board.jpg"
src = cv2.imread(fn, 1)
img = cv2.cvtColor(src, cv2.COLOR_BGR2GRAY)

View File

@@ -2,7 +2,7 @@
'''
This example illustrates how to use Hough Transform to find lines
Usage: ./houghlines.py [<image_name>]
image argument defaults to ../cpp/pic1.png
image argument defaults to ../data/pic1.png
'''
import cv2
import numpy as np
@@ -12,7 +12,7 @@ import math
try:
fn = sys.argv[1]
except:
fn = "../cpp/pic1.png"
fn = "../data/pic1.png"
print __doc__
src = cv2.imread(fn)
dst = cv2.Canny(src, 50, 200)

View File

@@ -24,7 +24,7 @@ if __name__ == '__main__':
try:
fn = sys.argv[1]
except:
fn = '../cpp/fruits.jpg'
fn = '../data/fruits.jpg'
print __doc__

View File

@@ -153,7 +153,7 @@ if __name__ == '__main__':
args, dummy = getopt.getopt(sys.argv[1:], '', ['model=', 'data=', 'load=', 'save='])
args = dict(args)
args.setdefault('--model', 'rtrees')
args.setdefault('--data', '../cpp/letter-recognition.data')
args.setdefault('--data', '../data/letter-recognition.data')
print 'loading data %s ...' % args['--data']
samples, responses = load_base(args['--data'])

View File

@@ -6,7 +6,7 @@ if __name__ == '__main__':
try:
fn = sys.argv[1]
except:
fn = '../cpp/fruits.jpg'
fn = '../data/fruits.jpg'
img = cv2.imread(fn)
if img is None:

View File

@@ -26,7 +26,7 @@ if __name__ == '__main__':
try:
fn = sys.argv[1]
except:
fn = '../cpp/baboon.jpg'
fn = '../data/baboon.jpg'
img = cv2.imread(fn)

View File

@@ -32,8 +32,8 @@ def write_ply(fn, verts, colors):
if __name__ == '__main__':
print 'loading images...'
imgL = cv2.pyrDown( cv2.imread('../gpu/aloeL.jpg') ) # downscale images for faster processing
imgR = cv2.pyrDown( cv2.imread('../gpu/aloeR.jpg') )
imgL = cv2.pyrDown( cv2.imread('../data/aloeL.jpg') ) # downscale images for faster processing
imgR = cv2.pyrDown( cv2.imread('../data/aloeR.jpg') )
# disparity range is tuned for 'aloe' image pair
window_size = 3

View File

@@ -18,7 +18,7 @@ if __name__ == '__main__':
try:
fn = sys.argv[1]
except:
fn = 'data/starry_night.jpg'
fn = '../data/starry_night.jpg'
img = cv2.imread(fn)
if img is None:

View File

@@ -20,8 +20,8 @@ Usage:
- synth:<params> for procedural video
Synth examples:
synth:bg=../cpp/lena.jpg:noise=0.1
synth:class=chess:bg=../cpp/lena.jpg:noise=0.1:size=640x480
synth:bg=../data/lena.jpg:noise=0.1
synth:class=chess:bg=../data/lena.jpg:noise=0.1:size=640x480
Keys:
ESC - exit
@@ -130,8 +130,8 @@ classes = dict(chess=Chess)
presets = dict(
empty = 'synth:',
lena = 'synth:bg=../cpp/lena.jpg:noise=0.1',
chess = 'synth:class=chess:bg=../cpp/lena.jpg:noise=0.1:size=640x480'
lena = 'synth:bg=../data/lena.jpg:noise=0.1',
chess = 'synth:class=chess:bg=../data/lena.jpg:noise=0.1:size=640x480'
)

View File

@@ -79,6 +79,6 @@ if __name__ == '__main__':
try:
fn = sys.argv[1]
except:
fn = '../cpp/fruits.jpg'
fn = '../data/fruits.jpg'
print __doc__
App(fn).run()