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

modified some tests

This commit is contained in:
ser1zw 2010-12-31 17:29:31 +09:00
parent 88aca8bc28
commit cec9674316
13 changed files with 4938 additions and 2 deletions

4908
test/log.txt Normal file

File diff suppressed because it is too large Load diff

BIN
test/samples/airplane.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

BIN
test/samples/baboon.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

BIN
test/samples/baboon200.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
test/samples/cat.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

BIN
test/samples/fruits.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
test/samples/lena.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
test/samples/stuff.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

29
test/test_cvmat.rb Executable file
View file

@ -0,0 +1,29 @@
#!/usr/bin/env ruby
# -*- mode: ruby; coding: utf-8-unix -*-
require 'test/unit'
require 'opencv'
require 'pp'
require File.expand_path(File.dirname(__FILE__)) + '/test_opencv'
include OpenCV
# Tests for specific OpenCV functions
class TestCvMat < TestOpenCV
def test_avg_sdv
m = CvMat.new(1, 8, CV_32F)
[2, 4, 4, 4, 5, 5, 7, 9].each_with_index { |v, i|
# m[i] = CvScalar.new(v, 0, 0, 0)
m[i][0] = v
}
avg = m.avg
assert_in_delta(avg[0], 5.0, 0.01)
avg, sdv = m.avg_sdv
assert_in_delta(avg[0], 5.0, 0.01)
assert_in_delta(sdv[0], 2.0, 0.01)
end
end

View file

@ -4,8 +4,7 @@
require 'test/unit'
require 'digest/md5'
require 'opencv'
require 'pp'
require_relative 'test_opencv'
require File.expand_path(File.dirname(__FILE__)) + '/test_opencv'
include OpenCV