mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
fixed an installation problem when using bundler
When installing Ruby/OpenCV using bundler as follow: $ echo -e "\n"'gem "opencv", :git => "https://github.com/ser1zw/ruby-opencv"' >> Gemfile $ bundle install an error occured because "test/samples/movie_sample.avi" was not managed by git. So, changed .gitignore and some files to fix this problem.
This commit is contained in:
parent
b3016fc68c
commit
eaa8ff8a7e
3 changed files with 11 additions and 9 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -15,5 +15,5 @@ ruby-*
|
||||||
ext/opencv/test.txt
|
ext/opencv/test.txt
|
||||||
pkg/
|
pkg/
|
||||||
log.txt
|
log.txt
|
||||||
*.avi
|
videowriter_result.avi
|
||||||
examples/contours/rotated-boxes-with-detected-bounding-rectangles.jpg
|
examples/contours/rotated-boxes-with-detected-bounding-rectangles.jpg
|
||||||
|
|
BIN
test/samples/movie_sample.avi
Normal file
BIN
test/samples/movie_sample.avi
Normal file
Binary file not shown.
|
@ -8,21 +8,23 @@ include OpenCV
|
||||||
|
|
||||||
# Tests for OpenCV::CvVideoWriter
|
# Tests for OpenCV::CvVideoWriter
|
||||||
class TestCvVideoWriter < OpenCVTestCase
|
class TestCvVideoWriter < OpenCVTestCase
|
||||||
|
OUTPUT_FILENAME = 'videowriter_result.avi'
|
||||||
|
|
||||||
def test_initialize
|
def test_initialize
|
||||||
vw = CvVideoWriter.new('foo.avi', 'MJPG', 15, CvSize.new(320, 240))
|
vw = CvVideoWriter.new(OUTPUT_FILENAME, 'MJPG', 15, CvSize.new(320, 240))
|
||||||
assert_equal(CvVideoWriter, vw.class)
|
assert_equal(CvVideoWriter, vw.class)
|
||||||
vw.close
|
vw.close
|
||||||
|
|
||||||
vw = CvVideoWriter.new('foo.avi', 'MJPG', 15, CvSize.new(320, 240), false)
|
vw = CvVideoWriter.new(OUTPUT_FILENAME, 'MJPG', 15, CvSize.new(320, 240), false)
|
||||||
assert_equal(CvVideoWriter, vw.class)
|
assert_equal(CvVideoWriter, vw.class)
|
||||||
vw.close
|
vw.close
|
||||||
|
|
||||||
## Supported only Windows(?)
|
## Supported only Windows(?)
|
||||||
# vw = CvVideoWriter.new('foo.avi', nil, 15, CvSize.new(320, 240), false)
|
# vw = CvVideoWriter.new(OUTPUT_FILENAME, nil, 15, CvSize.new(320, 240), false)
|
||||||
# assert_equal(CvVideoWriter, vw.class)
|
# assert_equal(CvVideoWriter, vw.class)
|
||||||
# vw.close
|
# vw.close
|
||||||
|
|
||||||
CvVideoWriter.new('foo.avi', 'MJPG', 15, CvSize.new(320, 240)) { |vw|
|
CvVideoWriter.new(OUTPUT_FILENAME, 'MJPG', 15, CvSize.new(320, 240)) { |vw|
|
||||||
assert_equal(CvVideoWriter, vw.class)
|
assert_equal(CvVideoWriter, vw.class)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,23 +35,23 @@ class TestCvVideoWriter < OpenCVTestCase
|
||||||
|
|
||||||
def test_write
|
def test_write
|
||||||
img = IplImage.load(FILENAME_LENA256x256)
|
img = IplImage.load(FILENAME_LENA256x256)
|
||||||
vw = CvVideoWriter.new('foo.avi', 'MJPG', 15, CvSize.new(256, 256))
|
vw = CvVideoWriter.new(OUTPUT_FILENAME, 'MJPG', 15, CvSize.new(256, 256))
|
||||||
vw.write img
|
vw.write img
|
||||||
vw.close
|
vw.close
|
||||||
|
|
||||||
CvVideoWriter.new('foo.avi', 'MJPG', 15, CvSize.new(256, 256)) { |vw|
|
CvVideoWriter.new(OUTPUT_FILENAME, 'MJPG', 15, CvSize.new(256, 256)) { |vw|
|
||||||
vw.write img
|
vw.write img
|
||||||
}
|
}
|
||||||
|
|
||||||
assert_raise(TypeError) {
|
assert_raise(TypeError) {
|
||||||
CvVideoWriter.new('foo.avi', 'MJPG', 15, CvSize.new(256, 256)) { |vw|
|
CvVideoWriter.new(OUTPUT_FILENAME, 'MJPG', 15, CvSize.new(256, 256)) { |vw|
|
||||||
vw.write DUMMY_OBJ
|
vw.write DUMMY_OBJ
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_close
|
def test_close
|
||||||
vw = CvVideoWriter.new('foo.avi', 'MJPG', 15, CvSize.new(320, 240))
|
vw = CvVideoWriter.new(OUTPUT_FILENAME, 'MJPG', 15, CvSize.new(320, 240))
|
||||||
vw.close
|
vw.close
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue