def updateAlignment(self): toPts, fromPts = transform.splitPoints(self.extras.points) tform = transform.getTransform(toPts, fromPts) self.extras.transform = tform.getJsonDict()
], [ -13045724.330780469, 3825669.8715011734, 68.50000000000003, 289.4999999999986 ], [ -10824770.036926387, 2994035.003758455, 335.50000000000034, 424.50000000000097 ] ] TO_PTS, FROM_PTS = transform.splitPoints(POINTS) N = len(POINTS) def testTransformClass(cls): tform = cls.fit(TO_PTS, FROM_PTS) toPtsApprox = transform.forwardPts(tform, FROM_PTS) #print toPtsApprox print ('%s: %e' % (cls.__name__, numpy.linalg.norm(toPtsApprox - TO_PTS) / N)) testTransformClass(transform.TranslateTransform) testTransformClass(transform.RotateScaleTranslateTransform) testTransformClass(transform.AffineTransform) testTransformClass(transform.ProjectiveTransform)
41.500000000005336 ], [ -11372670.65567453, 4852983.53165394, 281.49999999999955, 196.49999999999196 ], [ -13045724.330780469, 3825669.8715011734, 68.50000000000003, 289.4999999999986 ], [ -10824770.036926387, 2994035.003758455, 335.50000000000034, 424.50000000000097 ]] TO_PTS, FROM_PTS = transform.splitPoints(POINTS) N = len(POINTS) def testTransformClass(cls): tform = cls.fit(TO_PTS, FROM_PTS) toPtsApprox = transform.forwardPts(tform, FROM_PTS) #print toPtsApprox print('%s: %e' % (cls.__name__, numpy.linalg.norm(toPtsApprox - TO_PTS) / N)) testTransformClass(transform.TranslateTransform) testTransformClass(transform.RotateScaleTranslateTransform) testTransformClass(transform.AffineTransform) testTransformClass(transform.ProjectiveTransform)