Esempio n. 1
0
    def test_project_easy_3(self):
        cam = RectifiedCamera(DefaultParams())
        P_list = [ 1, 0, 0, 0, \
                   0, 1, 0, 0, \
                   0, 0, 1, 0 ]

        cam.inflate(matrix([-1]))

        pts = matrix([[0, 1, 0, 2], [0, 1, 1, 0], [1, 1, 2, 2], [1, 1, 1, 1]],
                     float)

        expected = matrix([[-1, 0, -.5, .5], [0, 1, .5, 0]])

        result = cam.project(P_list, pts)

        print ""
        print result

        self.assertAlmostEqual(numpy.linalg.norm(result - expected), 0.0, 6)
Esempio n. 2
0
    def test_project_easy_3(self):
        cam = RectifiedCamera(DefaultParams())
        P_list = [ 1, 0, 0, 0, \
                   0, 1, 0, 0, \
                   0, 0, 1, 0 ]

        cam.inflate(matrix([-1]))

        pts = matrix( [ [ 0, 1, 0, 2 ],
                        [ 0, 1, 1, 0 ],
                        [ 1, 1, 2, 2 ],
                        [ 1, 1, 1, 1 ]], float )

        expected = matrix( [ [-1, 0,-.5,.5],
                             [ 0, 1, .5, 0] ] )

        result = cam.project(P_list, pts)

        print ""
        print result

        self.assertAlmostEqual(numpy.linalg.norm(result-expected), 0.0, 6)