Interface ILcdRasterReferencer

All Known Implementing Classes:
TLcdAxisAlignedRasterReferencer, TLcdCompositeRasterReferencer, TLcdOrthographicRasterReferencer, TLcdPolynomialRasterReferencer, TLcdProjectiveRasterReferencer, TLcdRationalRasterReferencer, TLcdResidualErrorCheckingRasterReferencer, TLcdRotatedRasterReferencer, TLcdTiePointCheckingRasterReferencer, TLcdTranslatedRasterReferencer, TLcdWrapAroundRasterReferencer

public interface ILcdRasterReferencer

This interface defines a method to reference rasters based on tie points. A pair of tie points consists of a point in image coordinates (pixels) and a point in model coordinates (in the given model reference) onto which it should be mapped. Implementations of this interface try to satisfy the given mapping in different ways, by returning a new model reference and raster bounds.

Example usage

The following example rectifies an image with the help of a raster referencer:
    int imageWidth = 1000;
    int imageHeight = 1000;

    ILcdPoint[] imagePoints = new ILcdPoint[]{
        new TLcdXYPoint(0, 0),
        new TLcdXYPoint(1000, 0),
        new TLcdXYPoint(0, 1000),
        new TLcdXYPoint(1000, 1000),
        new TLcdXYPoint(126, 274),
        new TLcdXYPoint(983, 829)
    };

    ILcdModelReference modelPointsReference = new TLcdGeodeticReference();

    ILcdPoint[] modelPoints = new ILcdPoint[]{
        new TLcdLonLatPoint(20.4, 30.8),
        new TLcdLonLatPoint(25.1, 30.6),
        new TLcdLonLatPoint(20.9, 35.7),
        new TLcdLonLatPoint(25.2, 35.3),
        new TLcdLonLatPoint(21.0, 31.9),
        new TLcdLonLatPoint(24.9, 35.0),
        };

    int degree = 2;

    ILcdRasterReferencer rasterReferencer =
        new TLcdPolynomialRasterReferencer(degree);

    ILcdRasterReference rasterReference =
        rasterReferencer.createRasterReference(imageWidth,
                                               imageHeight,
                                               imagePoints,
                                               modelPointsReference,
                                               modelPoints,
                                               null);

    ILcdModelReference modelReference = rasterReference.getModelReference();
    ILcdBounds bounds = rasterReference.getBounds();
Since:
8.1
  • Method Details

    • createRasterReference

      ILcdRasterReference createRasterReference(int aImageWidth, int aImageHeight, ILcdPoint[] aImageTiePoints, ILcdModelReference aModelReference, ILcdPoint[] aModelTiePoints, ILcdPoint[] aMappedModelTiePointsSFCT)
      Creates a raster reference for an image of a given size, based on pairs of tie points.

      An optional array can be provided for obtaining the model tie points transformed to image coordinates on return. These reflect the effects of the referencing. The differences between the transformed model tie points (expressed in pixels) and the original image tie points (also expressed in pixels) provide a measure for the success of the referencing. With a perfect raster reference, the resulting model tie points correspond to the original image tie points.

      Parameters:
      aImageWidth - the image width of the raster, expressed in pixels.
      aImageHeight - the image height of the raster, expressed in pixels.
      aImageTiePoints - the image tie points, expressed in pixels.
      aModelReference - the reference of the model tie points.
      aModelTiePoints - the model tie points corresponding to the image tie points, expressed in model coordinates.
      aMappedModelTiePointsSFCT - an optional array for obtaining the the model tie points mapped to image coordinates upon return. This parameter may be null, if the mapped points are not required.
      Returns:
      a raster reference containing a new model reference and raster bounds that try to satisfy the given tie points.
      Throws:
      IllegalArgumentException - if the bounds can't be created because the input can't be handled successfully by the given implementation.