mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
add alias of CvMat#save_image
This commit is contained in:
parent
cfd0d2c7ca
commit
ba4790b13b
2 changed files with 17 additions and 0 deletions
|
@ -380,6 +380,7 @@ void define_ruby_class()
|
|||
rb_define_method(rb_klass, "extract_surf", RUBY_METHOD_FUNC(rb_extract_surf), -1);
|
||||
|
||||
rb_define_method(rb_klass, "save_image", RUBY_METHOD_FUNC(rb_save_image), 1);
|
||||
rb_define_alias(rb_klass, "save", "save_image");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -87,6 +87,22 @@ class TestCvMat < OpenCVTestCase
|
|||
}
|
||||
end
|
||||
|
||||
def test_save_image
|
||||
filename = 'save_image_test.jpg'
|
||||
m = CvMat.new(20, 20, :cv8u, 1)
|
||||
|
||||
File.delete filename if File.exists? filename
|
||||
m.save_image filename
|
||||
assert(File.exists? filename)
|
||||
|
||||
# Alias
|
||||
File.delete filename if File.exists? filename
|
||||
m.save filename
|
||||
assert(File.exists? filename)
|
||||
|
||||
File.delete filename
|
||||
end
|
||||
|
||||
def test_GOOD_FEATURES_TO_TRACK_OPTION
|
||||
assert_equal(0xff, CvMat::GOOD_FEATURES_TO_TRACK_OPTION[:max])
|
||||
assert_nil(CvMat::GOOD_FEATURES_TO_TRACK_OPTION[:mask])
|
||||
|
|
Loading…
Reference in a new issue