Maven module :un.api : api-image :
Class : un.impl.image.process.detection.MarchingSquares
Extends/Implements : -
Subclasses : -

A simple implementation of the marching squares algorithm that can identify
perimeters in an supplied byte array. The array of data over which this
instances of this class operate is not cloned by this class's constructor
(for obvious efficiency reasons) and should therefore not be modified while
the object is in use. It is expected that the data elements supplied to the
algorithm have already been thresholded. The algorithm only distinguishes
between zero and non-zero values.

Origin :
http://www.tomgibara.com/computer-vision/MarchingSquares.java

@author Tom Gibara (Original author)
@author Johann Sorel (Adapted to Unlicense-Lib)


Variables : -
Functions : MarchingSquares, getWidth, getHeight, getData, identifyPerimeter, identifyPerimeter




Creates a new object that can locate perimeter paths in the supplied
data. The length of the supplied data array must exceed width * height,
with the data elements in row major order and the top-left-hand data
element at index zero.
param  width the width of the data matrix
param  height the width of the data matrix
param  data the data elements
public void MarchingSquares (int width, int height, byte[] data)


return  the width of the data matrix over which this object is operating
public int getWidth ()


return  the width of the data matrix over which this object is operating
public int getHeight ()


return  the data matrix over which this object is operating
public byte[] getData ()



public Path identifyPerimeter (int initialX, int initialY)


A convenience method that locates at least one perimeter in the data with
which this object was constructed. If there is no perimeter (ie. if all
elements of the supplied array are identically zero) then null is
returned.
return  a perimeter path obtained from the data, or null
public Path identifyPerimeter ()