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

added a test for CvMat#put_text

This commit is contained in:
ser1zw 2011-01-11 03:18:25 +09:00
parent 908d208ea9
commit cad80ebf59

View file

@ -138,15 +138,17 @@ class TestCvMat_drawing < OpenCVTestCase
end
def test_put_text
flunk('CvMat#put_text is not tested yet.')
m0 = create_cvmat(240, 320, :cv8u, 3) { CvColor::White }
m1 = m0.clone
m2 = m0.put_text('test', CvPoint.new(30, 40), CvColor::Red)
m1.put_text!('test 1', CvPoint.new(60, 90), CvFont.new(:simplex), CvColor::Blue)
font = CvFont.new(:plain, :hscale => 5.0, :vscale => 4.5,
:shear => 1.0, :thickness => 3, :line_type => 5, :italic => true)
m2 = m0.put_text('test 2', CvPoint.new(30, 80), font, CvColor::Red)
# Uncomment the following lines to view the image
GUI::Window.new('Put text: Blue, thickness = 1').show(m1)
GUI::Window.new('Put text: Red, thickness = 3').show(m2)
GUI::wait_key
# GUI::Window.new('Put text: Blue, thickness = 1').show(m1)
# GUI::Window.new('Put text: Red, thickness = 3').show(m2)
# GUI::wait_key
end
end