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

tested and fixed CvContourTree

This commit is contained in:
ser1zw 2011-07-31 00:37:45 +09:00
parent 56e0564ae3
commit 67845bc4cc
4 changed files with 68 additions and 13 deletions

View file

@ -58,7 +58,16 @@ class TestCvContour < OpenCVTestCase
end
def test_create_tree
flunk('FIXME: CvContour#create_tree is not tested yet.')
mat0 = create_cvmat(128, 128, :cv8u, 1) { |j, i|
(j - 64) ** 2 + (i - 64) ** 2 <= (32 ** 2) ? CvColor::White : CvColor::Black
}
contour = mat0.find_contours
tree = contour.create_tree
assert_equal(CvContourTree, tree.class)
assert_equal(34, tree.p1.x)
assert_equal(53, tree.p1.y)
assert_equal(0, tree.p2.x)
assert_equal(0, tree.p2.y)
end
def test_in