motris.model
Class Camera

java.lang.Object
  extended bymotris.model.Camera

public class Camera
extends java.lang.Object

Encapsulates all camera-related functions

Author:
preuter, dahlkamp

Field Summary
private  double azimuth
           
private  double cosAzimuth
           
private  DerivableMatrix external
           
private  JSci.maths.DoubleSquareMatrix externalinverse
           
private  JSci.maths.DoubleSquareMatrix externalTexternal
           
private  DoubleVector externalTranslationInGlobalCoordinates
           
private  DerivableMatrix internal
           
private  JSci.maths.DoubleSquareMatrix internalExternal
           
private  JSci.maths.DoubleSquareMatrix internalExternalInverse
           
private  JSci.maths.DoubleSquareMatrix internalExternalNoPrincipalPt
           
private  double polar
           
private  double principalPointY
           
private  double shadowIntensity
           
private  double sinAzimuth
           
private  double tanPolar
           
 
Constructor Summary
Camera()
           
 
Method Summary
 Double2Vector applyProjection(DoubleVector ScenePoint)
           
 void applyProjectionInto(DoubleVector ScenePoint, Double2Vector target, DoubleVector tmp)
           
 Double4Vector backProjectToStreetSurface(Double2Vector _imagePoint)
          Which point on the Street Plane is projected onto the specified MotrisImage Point
 Double2Vector cameraToPixelTransform(DoubleVector v)
           
 Double2Vector computeImageVelocity(DoubleVector scenePoint, DoubleVector scenePointVelocity)
          Compute the movement rate (velocity) of the projection of a moving Scene Point.
 DoubleMatrix getCameraDerivativeMatrix(DoubleVector positionInGlobalCoordinate, DoubleVector tmp)
          Computes the derivative of the camera (projection, internal and external matrix) for a point in scene coordinates
 DoubleVector getCameraOrigin()
           
 DoubleVector globalToCameraTransform(DoubleVector v)
           
 void globalToCameraTransform(DoubleVector v, DoubleVector target)
           
 Double4Vector pixelToDirectionTransform(Double2Vector pixel)
           
 void projectShadow(DoubleVector scenePoint, double toHeight)
          Where does the shadow of a specified scenePoint lie?
 void readFromFile(java.lang.String fileName, boolean adjustForHalfFrames)
           
 double scalarProductInCamcoordinates(DoubleVector first, DoubleVector second, DoubleVector tmp)
          Computes the scalar product of two vectors after multiplication with the external matrix (ie after transforming them from global to camera coordinates).
 void setInterlacedPrincipalPoint(boolean usingEvenLines)
           
private  void setValues()
           
private  void updateMatrices()
          Regenerates internalExternalNoPrincipalPt and internalExternal from internal and external
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

external

private DerivableMatrix external

externalTexternal

private JSci.maths.DoubleSquareMatrix externalTexternal

externalinverse

private JSci.maths.DoubleSquareMatrix externalinverse

internal

private DerivableMatrix internal

principalPointY

private double principalPointY

shadowIntensity

private double shadowIntensity

azimuth

private double azimuth

polar

private double polar

internalExternalNoPrincipalPt

private JSci.maths.DoubleSquareMatrix internalExternalNoPrincipalPt

internalExternal

private JSci.maths.DoubleSquareMatrix internalExternal

internalExternalInverse

private JSci.maths.DoubleSquareMatrix internalExternalInverse

sinAzimuth

private double sinAzimuth

cosAzimuth

private double cosAzimuth

tanPolar

private double tanPolar

externalTranslationInGlobalCoordinates

private DoubleVector externalTranslationInGlobalCoordinates
Constructor Detail

Camera

public Camera()
Method Detail

updateMatrices

private void updateMatrices()
Regenerates internalExternalNoPrincipalPt and internalExternal from internal and external


setValues

private void setValues()

getCameraOrigin

public DoubleVector getCameraOrigin()

applyProjection

public Double2Vector applyProjection(DoubleVector ScenePoint)

applyProjectionInto

public void applyProjectionInto(DoubleVector ScenePoint,
                                Double2Vector target,
                                DoubleVector tmp)

globalToCameraTransform

public void globalToCameraTransform(DoubleVector v,
                                    DoubleVector target)

globalToCameraTransform

public DoubleVector globalToCameraTransform(DoubleVector v)

scalarProductInCamcoordinates

public final double scalarProductInCamcoordinates(DoubleVector first,
                                                  DoubleVector second,
                                                  DoubleVector tmp)
Computes the scalar product of two vectors after multiplication with the external matrix (ie after transforming them from global to camera coordinates).

Parameters:
first - Vector in global coordinates
second - Vector in global coordinates
tmp - is a 4-dim temporary DoubleVector to be overwritten
Returns:
scalar product in camera coordinates

cameraToPixelTransform

public Double2Vector cameraToPixelTransform(DoubleVector v)

pixelToDirectionTransform

public Double4Vector pixelToDirectionTransform(Double2Vector pixel)

computeImageVelocity

public Double2Vector computeImageVelocity(DoubleVector scenePoint,
                                          DoubleVector scenePointVelocity)
Compute the movement rate (velocity) of the projection of a moving Scene Point.

Parameters:
scenePoint - Scene Point
scenePointVelocity - Movement rate (velocity) of Scene Point
Returns:
Velocity of the Image of the Scene Point

readFromFile

public void readFromFile(java.lang.String fileName,
                         boolean adjustForHalfFrames)

projectShadow

public void projectShadow(DoubleVector scenePoint,
                          double toHeight)
Where does the shadow of a specified scenePoint lie?

Parameters:
scenePoint -
Returns:
scenePoint projected to the street surface

backProjectToStreetSurface

public Double4Vector backProjectToStreetSurface(Double2Vector _imagePoint)
Which point on the Street Plane is projected onto the specified MotrisImage Point

Parameters:
_imagePoint - 2-dimensional image plane point
Returns:
3-dimensional scene point on the street surface

getCameraDerivativeMatrix

public DoubleMatrix getCameraDerivativeMatrix(DoubleVector positionInGlobalCoordinate,
                                              DoubleVector tmp)
Computes the derivative of the camera (projection, internal and external matrix) for a point in scene coordinates

Parameters:
positionInGlobalCoordinate -
tmp - a 4-dimensional temporary vector to be overwritten

setInterlacedPrincipalPoint

public void setInterlacedPrincipalPoint(boolean usingEvenLines)