Class Mesh_Warp_Interactive

java.lang.Object
Ch21_Geometric_Operations.Mesh_Warp_Interactive
All Implemented Interfaces:
PlugInFilter, JavaDocHelp

public class Mesh_Warp_Interactive extends Object implements PlugInFilter, JavaDocHelp

ImageJ plugin, performs piecewise affine transformation by triangulation of the input image, as described in Sec. 21.1.8 (see Fig. 21.13) of [1].

The plugin projects a triangular grid onto the image which is mouse-editable, i.e., grid points can be selected and dragged. Note that the outer grid points (along the image border) cannot be moved. The grid is drawn as a graphic overlay. In each repaint iteration, pixel values are re-calculated by

  1. finding the containing (distorted) triangle of the pixel,
  2. calculating the affine mapping w.r.t. the original (undistorted) triangle,
  3. apply target-to-source mapping of pixel coordinates to the original (source) image and
  4. retrieving the interpolated pixel values from the original image.

The following mouse and keypoint events are observed:

  • left mouse botton: select and drag grid points,
  • right mouse botton: reset the grid,
  • ctrl/+ key: zoom in,
  • ctrl/- key; zoom out,
  • enter or escape key: finish editing.

Note that this is a simplistic implementation which leaves much room for improvements and increased efficiency.

[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).

Version:
2022/11/25