sugr.test
Class EstimationTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended bysugr.test.EstimationTest
All Implemented Interfaces:
junit.framework.Test

public class EstimationTest
extends junit.framework.TestCase

Test of estimation functionality of sugr.

Author:
Achim Königs

Constructor Summary
EstimationTest()
           
 
Method Summary
static boolean compareEntities(Element e1, Element e2, double percentage)
          Help function to test two entities.
static void conditioningTest()
          Test conditioning Problem: The estimation needs the Center of Gravity near the Origin.
static double getNextGaussDist(double mean, double stddev, boolean newstart)
          Help function, to generat gaussdistributed random values
static void testAllConstructorsAsEstimation()
          Doing for every possible construction an estimation and compare the results.
static void testConditioningEntity()
          Test the conditioning methods for entitis.
static void testConditioningTransformation()
          Test the conditioning of transformations.
static void testConstraintFulfill()
          Test entity.ensureConstrains()
static boolean testCov(Matrix testValues, Matrix expectedValues, double percentage, double zeroThreshold)
          Help function to test two Cov Matrices in testSimulation.
static void testEstimation1()
          Do a very simple estimation with point2d out of points2d.
static void testEstimation2()
          Estimate point3d from line3d.
static void testEstimation3()
          Estimate a plane from points3d.
static void testEstimation4()
          Estimate a point3d from points3d.
static void testEstimation5()
          Estimate a line2d from points2d.
static void testEstimation6()
          Estimate a point3d from point3d.
static void testEstimationOfSameType()
          Test estimation of points from points, lines from lines, and so on.
static void testEstimationOP()
          Test estimation with orthogonal and parallel conditions.
static void testEstimationPlaneOP()
          Test estimation of planes with parallel or orthogonal lines.
static void testHomography2D()
          Estimate a homography 2D, from points and lines.
static void testHomography3D()
          Estimate a homography 3D using points, lines and planes
static void testMotion_3DEstimation()
          Test Motion_3D estimation
static void testMotion_3DFewPoints()
          Test estimation of a Motion_3D using 6 points
static void testProjectiveCamera()
          Test Estimation of projective camera.
static void testProjectiveCameraReal()
          Tests Estimation of a ProjectiveCamera with a fixed Situation, that can realy exist.
static void testScaledMotion_3DEstimation()
          Test ScaledMotion_3D estimation
static void testScaledMotion_3DFewPoints()
          Test estimation of a ScaledMotion_3D using 9 points.
static void testSimulationOfTest()
          Simulates an easy test to check cov-matrix
static void testSimulationOfTest2D()
          Simulates an easy test to check cov-matrix
 
Methods inherited from class junit.framework.TestCase
countTestCases, getName, run, run, runBare, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EstimationTest

public EstimationTest()
Method Detail

testEstimationOfSameType

public static void testEstimationOfSameType()
Test estimation of points from points, lines from lines, and so on.


testAllConstructorsAsEstimation

public static void testAllConstructorsAsEstimation()
Doing for every possible construction an estimation and compare the results.


testEstimation1

public static void testEstimation1()
Do a very simple estimation with point2d out of points2d.


testEstimation2

public static void testEstimation2()
Estimate point3d from line3d.


testEstimation3

public static void testEstimation3()
Estimate a plane from points3d.


testEstimation4

public static void testEstimation4()
Estimate a point3d from points3d.


testEstimation5

public static void testEstimation5()
Estimate a line2d from points2d.


testEstimation6

public static void testEstimation6()
Estimate a point3d from point3d.


testEstimationOP

public static void testEstimationOP()
Test estimation with orthogonal and parallel conditions.


testEstimationPlaneOP

public static void testEstimationPlaneOP()
Test estimation of planes with parallel or orthogonal lines.


testHomography2D

public static void testHomography2D()
Estimate a homography 2D, from points and lines.


testHomography3D

public static void testHomography3D()
Estimate a homography 3D using points, lines and planes


testProjectiveCamera

public static void testProjectiveCamera()
Test Estimation of projective camera. Uses random values for camera and observations.


testProjectiveCameraReal

public static void testProjectiveCameraReal()
Tests Estimation of a ProjectiveCamera with a fixed Situation, that can realy exist.


testConstraintFulfill

public static void testConstraintFulfill()
Test entity.ensureConstrains()


testConditioningEntity

public static void testConditioningEntity()
Test the conditioning methods for entitis.


testMotion_3DEstimation

public static void testMotion_3DEstimation()
Test Motion_3D estimation


testMotion_3DFewPoints

public static void testMotion_3DFewPoints()
Test estimation of a Motion_3D using 6 points


testScaledMotion_3DEstimation

public static void testScaledMotion_3DEstimation()
Test ScaledMotion_3D estimation


testScaledMotion_3DFewPoints

public static void testScaledMotion_3DFewPoints()
Test estimation of a ScaledMotion_3D using 9 points.


testSimulationOfTest

public static void testSimulationOfTest()
Simulates an easy test to check cov-matrix


testSimulationOfTest2D

public static void testSimulationOfTest2D()
Simulates an easy test to check cov-matrix


conditioningTest

public static void conditioningTest()
Test conditioning Problem: The estimation needs the Center of Gravity near the Origin. If not we need conditioning. Scenario: given are some points near the origin, within [-0.1,0.1] on all three axis. If we scale the points equally in all directions we need to switch conditioning on when we use a scale factor arround 10. That means, values arround 1 allready need to be conditioned! If we move the points all together into one direction conditioning is needed when moved ca 0.8. so, again, condidioning is needed with values arround 1. If we now move the center of gravity FAR away from the origin, conditioning just scales them down to the origin. So the points will be close to each other. We get problems when the values are arround 10*10^14. Then you can't use conditioning anymore, but have to move the center of gravity closer to the origin.


testConditioningTransformation

public static void testConditioningTransformation()
Test the conditioning of transformations.


compareEntities

public static boolean compareEntities(Element e1,
                                      Element e2,
                                      double percentage)
Help function to test two entities. The Vector is testet with the help of some factor, that tells how much percentage tolerance is accepted. The cov matrix is not tested.

Parameters:
e1 - - entity
e2 - - entity to becompared to e1
percentage - - percentage of tolerance accpeted in vector
Returns:
- e1 == e2

testCov

public static boolean testCov(Matrix testValues,
                              Matrix expectedValues,
                              double percentage,
                              double zeroThreshold)
Help function to test two Cov Matrices in testSimulation.


getNextGaussDist

public static double getNextGaussDist(double mean,
                                      double stddev,
                                      boolean newstart)
Help function, to generat gaussdistributed random values

Parameters:
mean - - meanvalue
stddev - - standard derivation
newstart - - should a new random object be created? otherwise the one from the previous call is reused.
Returns:
an random value