1
0
Fork 0
mirror of https://github.com/ruby-opencv/ruby-opencv synced 2023-03-27 23:22:12 -04:00

added some tests for CvMat

This commit is contained in:
ser1zw 2010-12-31 21:34:36 +09:00
parent 8eef415d46
commit e3a6dc658a
3 changed files with 266 additions and 34 deletions

View file

@ -54,6 +54,13 @@ class TestOpenCV < Test::Unit::TestCase
# Compute a hash for an image, useful for image comparisons
Digest::MD5.hexdigest(img.data)
end
def is_same_float_array(a, b, delta = 0.01)
4.times { |i|
return false unless (a[i].to_f - b[i].to_f).abs <= delta.to_f
}
true
end
end