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:
parent
8eef415d46
commit
e3a6dc658a
3 changed files with 266 additions and 34 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue