mpicbg.models
Class Tile<M extends Model<M>>

java.lang.Object
  extended by mpicbg.models.Tile<M>
Type Parameters:
M - the transformation model of the tile.
All Implemented Interfaces:
Serializable

public class Tile<M extends Model<M>>
extends Object
implements Serializable

Author:
Stephan Saalfeld
See Also:
Serialized Form

Field Summary
protected  Set<Tile<?>> connectedTiles
          A set of Tiles that share point correpondences with this Tile.
protected  double cost
          The transfer error of this Tile's AbstractModel as estimated from weighted square point correspondence displacement.
protected  Set<PointMatch> matches
          A set of point correspondences with p1 being a local point in this Tile and p2 being the corresponding local point in another Tile.
protected  M model
          The transformation AbstractModel of the Tile.
 
Constructor Summary
Tile(M model)
          Constructor
 
Method Summary
 boolean addConnectedTile(Tile<?> t)
          Add a Tile to the set of connected tiles.
 boolean addMatch(PointMatch match)
          Add one PointMatch.
 boolean addMatches(Collection<PointMatch> more)
          Add more PointMatches.
 void apply()
          Apply the current AbstractModel to all local point coordinates.
 void apply(double amount)
          Apply the current AbstractModel to all local point coordinates.
 void connect(Tile<?> o, Collection<PointMatch> m)
          Connect two tiles by a set of point correspondences
 Tile<?> findConnectedTile(PointMatch match)
          Try to find the tile which is connected by a particular PointMatch.
 void fitModel()
          Update the transformation AbstractModel.
 Set<Tile<?>> getConnectedTiles()
           
 double getCost()
           
 double getDistance()
           
 Set<PointMatch> getMatches()
           
 M getModel()
           
static ArrayList<Set<Tile<?>>> identifyConnectedGraphs(Collection<? extends Tile<?>> tiles)
          Identify the set of connected graphs that contains all given tiles.
 boolean removeConnectedTile(Tile<?> t)
          Remove a Tile from the set of connected Tiles.
 boolean removeMatch(PointMatch match)
          Remove a PointMatch.
protected  void traceConnectedGraph(Set<Tile<?>> graph)
          Find all Tiles that represent one connectivity graph by recursively tracing the connectedTiles.
 void update()
          Apply the current AbstractModel to all local point coordinates.
 void update(double amount)
          Apply the current AbstractModel to all local point coordinates by weight.
 void updateCost()
          Update cost and distance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

protected final M extends Model<M> model
The transformation AbstractModel of the Tile. All local Points in the Tile share (and thus determine) this common AbstractModel.


matches

protected final Set<PointMatch> matches
A set of point correspondences with p1 being a local point in this Tile and p2 being the corresponding local point in another Tile. Tiles are perfectly registered if both p1 and p1 have the same world coordinates for all PointMatches.


connectedTiles

protected final Set<Tile<?>> connectedTiles
A set of Tiles that share point correpondences with this Tile. Note that point correspondences do not know about the tiles they belong to.


cost

protected double cost
The transfer error of this Tile's AbstractModel as estimated from weighted square point correspondence displacement.

Constructor Detail

Tile

public Tile(M model)
Constructor

Parameters:
model - the transformation AbstractModel of the Tile.
Method Detail

getModel

public final M getModel()

getMatches

public final Set<PointMatch> getMatches()

addMatches

public final boolean addMatches(Collection<PointMatch> more)
Add more PointMatches.

Parameters:
more - the PointMatches to be added
Returns:
true if this set changed as a result of the call

addMatch

public final boolean addMatch(PointMatch match)
Add one PointMatch.

Parameters:
match - the PointMatch to be added
Returns:
true if this set did not already contain the specified element

removeMatch

public final boolean removeMatch(PointMatch match)
Remove a PointMatch.

Parameters:
match - the PointMatch to be removed
Returns:
true if this set contained the specified element

getConnectedTiles

public final Set<Tile<?>> getConnectedTiles()

addConnectedTile

public final boolean addConnectedTile(Tile<?> t)
Add a Tile to the set of connected tiles. Checks if this Tile is present already.

Parameters:
t - the new Tile.
Returns:
Success of the operation.

removeConnectedTile

public final boolean removeConnectedTile(Tile<?> t)
Remove a Tile from the set of connected Tiles.

Parameters:
t - the Tile to be removed.
Returns:
Success of the operation.

findConnectedTile

public Tile<?> findConnectedTile(PointMatch match)
Try to find the tile which is connected by a particular PointMatch. Note that this method searches only the known connected tiles to limit the cost of that anyway expensive search.

Parameters:
match -
Returns:
connectedTile or null

getCost

public final double getCost()

getDistance

public final double getDistance()

apply

public final void apply()
Apply the current AbstractModel to all local point coordinates. This method does not recalculate the cost of the tile.


apply

public final void apply(double amount)
Apply the current AbstractModel to all local point coordinates. This method does not recalculate the cost of the tile.


updateCost

public final void updateCost()
Update cost and distance.


update

public final void update()
Apply the current AbstractModel to all local point coordinates. Update cost and distance.


update

public final void update(double amount)
Apply the current AbstractModel to all local point coordinates by weight. Update cost and distance.


fitModel

public final void fitModel()
                    throws NotEnoughDataPointsException,
                           IllDefinedDataPointsException
Update the transformation AbstractModel. That is, fit it to the current set of PointMatches.

Throws:
NotEnoughDataPointsException
IllDefinedDataPointsException

traceConnectedGraph

protected final void traceConnectedGraph(Set<Tile<?>> graph)
Find all Tiles that represent one connectivity graph by recursively tracing the connectedTiles.

Parameters:
graph -

connect

public final void connect(Tile<?> o,
                          Collection<PointMatch> m)
Connect two tiles by a set of point correspondences

Parameters:
o -
m -

identifyConnectedGraphs

public static final ArrayList<Set<Tile<?>>> identifyConnectedGraphs(Collection<? extends Tile<?>> tiles)
Identify the set of connected graphs that contains all given tiles.

Parameters:
tiles -
Returns:


Copyright © 2007-2016 Fiji. All Rights Reserved.