private void computeResultFromBest ( Se3_F64 solutionModel ) { double bestScore = Double . MAX_VALUE ; int bestSolution = - 1 ; for ( int i = 0 ; i < numControl ; i ++ ) { double score = score ( solutions . get ( i ) ) ; if ( score < bestScore ) { bestScore = score ; bestSolution = i ; } // System.out.println(i+" score "+score); } double [ ] solution = solutions . get ( bestSolution ) ; if ( numIterations > 0 ) { gaussNewton ( solution ) ; } UtilLepetitEPnP . computeCameraControl ( solution , nullPts , solutionPts , numControl ) ; motionFit . process ( controlWorldPts . toList ( ) , solutionPts . toList ( ) ) ; solutionModel . set ( motionFit . getTransformSrcToDst ( ) ) ; }
Selects the best motion hypothesis based on the actual observations and optionally optimizes the solution .