modified some tests
4908
test/log.txt
Normal file
BIN
test/samples/airplane.jpg
Normal file
After Width: | Height: | Size: 83 KiB |
BIN
test/samples/baboon.jpg
Normal file
After Width: | Height: | Size: 176 KiB |
BIN
test/samples/baboon200.jpg
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
test/samples/baboon200_rotated.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
test/samples/cat.jpg
Normal file
After Width: | Height: | Size: 64 KiB |
BIN
test/samples/fruits.jpg
Normal file
After Width: | Height: | Size: 80 KiB |
BIN
test/samples/lena.jpg
Normal file
After Width: | Height: | Size: 90 KiB |
BIN
test/samples/one_way_train_0000.jpg
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
test/samples/one_way_train_0001.jpg
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
test/samples/stuff.jpg
Normal file
After Width: | Height: | Size: 29 KiB |
29
test/test_cvmat.rb
Executable 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
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,7 @@
|
||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
require 'digest/md5'
|
require 'digest/md5'
|
||||||
require 'opencv'
|
require 'opencv'
|
||||||
require 'pp'
|
require File.expand_path(File.dirname(__FILE__)) + '/test_opencv'
|
||||||
require_relative 'test_opencv'
|
|
||||||
|
|
||||||
include OpenCV
|
include OpenCV
|
||||||
|
|
||||||
|
|