mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-03 08:25:31 +00:00
Distance transform documentation
This commit is contained in:
parent
9fa5307a60
commit
58b743e6e8
@ -17,26 +17,52 @@ public class DistanceTransformNoiseSamplerTemplate implements ObjectTemplate<Noi
|
||||
@Value("image")
|
||||
private Image image;
|
||||
|
||||
/**
|
||||
* The threshold value applied to the channel specified in the 'channel' parameter that splits
|
||||
* the image into a binary image. This parameter is only used for cost functions that utilize
|
||||
* a binary image.
|
||||
*/
|
||||
@Value("threshold")
|
||||
@Default
|
||||
private int threshold = 127;
|
||||
|
||||
/**
|
||||
* If set to true, distances calculated will be clamped to stay above the largest
|
||||
* distance calculated on the edges of the image. This ensures output values do not
|
||||
* appear to be cut off at the image boundaries. It is recommended to leave padding
|
||||
* around the image if this is in use, such that larger evaluated distances do not
|
||||
* get cut out by smaller evaluated distances close to borders. Doing so will yield
|
||||
* better results.
|
||||
*/
|
||||
@Value("clamp-to-max-edge")
|
||||
@Default
|
||||
private boolean clampToEdge = false;
|
||||
|
||||
/**
|
||||
* The target channel to run distance calculations on.
|
||||
*/
|
||||
@Value("channel")
|
||||
@Default
|
||||
private Channel channel = Channel.GRAYSCALE;
|
||||
|
||||
/**
|
||||
* The method of image processing applied to the specified image prior to calculating
|
||||
* distances.
|
||||
*/
|
||||
@Value("cost-function")
|
||||
@Default
|
||||
private CostFunction costFunction = CostFunction.Channel;
|
||||
|
||||
/**
|
||||
* Inverts the resulting binary image that may be used as a cost function.
|
||||
*/
|
||||
@Value("invert-threshold")
|
||||
@Default
|
||||
private boolean invertThreshold = false;
|
||||
|
||||
/**
|
||||
* How the final distance calculation should be redistributed.
|
||||
*/
|
||||
@Value("normalization")
|
||||
@Default
|
||||
private Normalization normalization = Normalization.None;
|
||||
|
@ -201,8 +201,21 @@ public class DistanceTransform {
|
||||
}
|
||||
|
||||
public enum Normalization {
|
||||
/**
|
||||
* Return the raw calculated distances.
|
||||
*/
|
||||
None,
|
||||
|
||||
/**
|
||||
* Redistribute the output values to fit in the range [-1, 1]
|
||||
*/
|
||||
Linear,
|
||||
|
||||
/**
|
||||
* Redistributes smoothly to the range [-1, 1], such that areas where distance = 0 stay 0.
|
||||
* This is only really applicable to signed distance calculations, and will fall back to linear
|
||||
* redistribution if the input range does not contain both positive and negative values.
|
||||
*/
|
||||
SmoothPreserveZero,
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user