Adds a test case for bug in creating video depending on frame size

This commit is contained in:
2012-07-11 21:52:38 +02:00
parent d2ede79502
commit 1249a00411
2 changed files with 32 additions and 1 deletions

View File

@@ -292,7 +292,7 @@ class FaceMovie(object):
frameSize = (self.dims[0], self.dims[1])
#frameSize = (652, 498)
print frameSize
pace = ["slow", "normal", "fast"]
print "Speed is set to %s" %(pace[speedrate])
my_video = cv.CreateVideoWriter(self.get_out_file(),

31
test/fix_crop.py Normal file
View File

@@ -0,0 +1,31 @@
import os
import cv
in_dir = "../data/inputs/sample-test"
out = "output.avi"
# loading images, create Guys and store it into guys
frameSize = (652, 498)
#frameSize = (453, 325)
fourcc = cv.CV_FOURCC('F', 'M', 'P', '4')
my_video = cv.CreateVideoWriter(out,
fourcc,
15,
frameSize,
1)
for root, _, files in os.walk(in_dir):
for a_file in files:
guy_source = os.path.join(in_dir, a_file)
print guy_source
image = cv.LoadImage(guy_source)
small_im = cv.CreateImage(frameSize,
image.depth ,
image.nChannels)
cv.Resize(image, small_im, cv.CV_INTER_LINEAR)
cv.WriteFrame(my_video, small_im)
print "Finished !"