#NEWLINE# def get_error( self , data , F ) : #NEWLINE# #INDENT# ' Compute x^T F x for all correspondences, \n            return error for each transformed point. ' #NEWLINE# data = data . T #NEWLINE# x1 = data [ : 3 ] #NEWLINE# x2 = data [ 3 : ] #NEWLINE# Fx1 = dot ( F , x1 ) #NEWLINE# Fx2 = dot ( F , x2 ) #NEWLINE# denom = ( ( ( ( Fx1 [ 0 ] ** 2 ) + ( Fx1 [ 1 ] ** 2 ) ) + ( Fx2 [ 0 ] ** 2 ) ) + ( denom [ 1 ] ** 2 ) ) #NEWLINE# err = ( ( diag ( dot ( x1 . T , dot ( F , x2 ) ) ) ** 2 ) / denom ) #NEWLINE# return err