Class Tile

java.lang.Object
stitching.model.Tile
Direct Known Subclasses:
ImageInformation

public class Tile extends Object
TODO
Author:
Stephan Saalfeld
  • Constructor Details

    • Tile

      public Tile(float width, float height, Model model)
      Constructor
      Parameters:
      width - width of the Tile in world unit dimension (e.g. pixels).
      height - height of the Tile in world unit dimension (e.g. pixels).
      model - the transformation Model of the Tile.
    • Tile

      public Tile(double width, double height, Model model)
      Constructor
      Parameters:
      width - width of the Tile in world unit dimension (e.g. pixels).
      height - height of the Tile in world unit dimension (e.g. pixels).
      model - the transformation Model of the Tile.
  • Method Details

    • getWidth

      public final float getWidth()
    • getHeight

      public final float getHeight()
    • getWC

      public float[] getWC()
    • getModel

      public final Model getModel()
    • getMatches

      public final ArrayList<PointMatch> getMatches()
    • resetMatches

      public final void resetMatches()
    • getConnectedTiles

      public final ArrayList<Tile> getConnectedTiles()
    • resetConnectedTiles

      public final void resetConnectedTiles()
    • resetTile

      public final void resetTile()
    • 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.
    • getError

      public final double getError()
    • getDistance

      public final double getDistance()
    • addMatches

      public final boolean addMatches(Collection<PointMatch> more)
      Add more PointMatches.
      Parameters:
      more - the PointMatches to be added.
      Returns:
      True if the list changed as a result of the call.
    • addMatch

      public final boolean addMatch(PointMatch match)
      Add one match.
      Parameters:
      match - the PointMatch to be added.
      Returns:
      True if the list changed as a result of the call.
    • update

      public final void update()
      Apply the current Model to all local point coordinates. Update average transfer error.
    • updateByStrength

      public final void updateByStrength(float amount)
      Apply the current Model to all local point coordinates by weight. Update average transfer error.
    • diceBetterModel

      public final boolean diceBetterModel(int max_num_tries, float scale)
      randomly dice new model until the error is smaller than the old one
      Parameters:
      max_num_tries - maximal number of tries before returning false (which means "no better model found")
      scale - strength of shaking
      Returns:
      true if a better model was found
    • fitModel

      public final void fitModel() throws NotEnoughDataPointsException
      Update the transformation Model. That is, fit it to the current set of PointMatches.
      Throws:
      NotEnoughDataPointsException
    • connect

      public final void connect(Tile o, Collection<PointMatch> matches)
      connect two tiles by a set of point correspondences re-weighs the point correpondences We set a weigh of 1.0 / num_matches to each correspondence to equalize the connections between tiles during minimization. TODO Check if this is a good idea... TODO What about the size of a detection, shouldn't it be used as a weight factor as well? Change 2007-10-27 Do not normalize by changing the weight, correpondences are weighted by feature scale.
      Parameters:
      o -
      matches -
    • identifyConnectedGraphs

      public static final ArrayList<ArrayList<Tile>> identifyConnectedGraphs(Collection<Tile> tiles)
      Identify the set of connected graphs that contains all given tiles.
      Parameters:
      tiles -
      Returns:
    • isInside

      public final boolean isInside(float[] point) throws Exception
      Check if a point that is given in world coordinates is inside the tile. TODO: This implies, that the transformation is linear and invertable.
      Parameters:
      point -
      Returns:
      True is the point is inside the
      Throws:
      Exception
    • intersects

      public final boolean intersects(Tile t) throws Exception
      Check if the Tile intersects another. TODO: The intersection test checks for the eight corners of both tiles only. This implies, that the transformation is linear and invertable. !!!!This is wrong: +-+ +-----+ | | | | +-+-+-+ | +-+ | | | | | | | | | +-+-+-+ | +-+ | | | | | +-+ +-----+ Test for edge intersections and points: If only one single edge of this intersects with one of t both tiles intersect.
      Parameters:
      t - the other Tile
      Throws:
      Exception