mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-03 16:35:50 +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")
|
@Value("image")
|
||||||
private Image 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")
|
@Value("threshold")
|
||||||
@Default
|
@Default
|
||||||
private int threshold = 127;
|
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")
|
@Value("clamp-to-max-edge")
|
||||||
@Default
|
@Default
|
||||||
private boolean clampToEdge = false;
|
private boolean clampToEdge = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The target channel to run distance calculations on.
|
||||||
|
*/
|
||||||
@Value("channel")
|
@Value("channel")
|
||||||
@Default
|
@Default
|
||||||
private Channel channel = Channel.GRAYSCALE;
|
private Channel channel = Channel.GRAYSCALE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The method of image processing applied to the specified image prior to calculating
|
||||||
|
* distances.
|
||||||
|
*/
|
||||||
@Value("cost-function")
|
@Value("cost-function")
|
||||||
@Default
|
@Default
|
||||||
private CostFunction costFunction = CostFunction.Channel;
|
private CostFunction costFunction = CostFunction.Channel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inverts the resulting binary image that may be used as a cost function.
|
||||||
|
*/
|
||||||
@Value("invert-threshold")
|
@Value("invert-threshold")
|
||||||
@Default
|
@Default
|
||||||
private boolean invertThreshold = false;
|
private boolean invertThreshold = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* How the final distance calculation should be redistributed.
|
||||||
|
*/
|
||||||
@Value("normalization")
|
@Value("normalization")
|
||||||
@Default
|
@Default
|
||||||
private Normalization normalization = Normalization.None;
|
private Normalization normalization = Normalization.None;
|
||||||
|
@ -201,8 +201,21 @@ public class DistanceTransform {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public enum Normalization {
|
public enum Normalization {
|
||||||
|
/**
|
||||||
|
* Return the raw calculated distances.
|
||||||
|
*/
|
||||||
None,
|
None,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Redistribute the output values to fit in the range [-1, 1]
|
||||||
|
*/
|
||||||
Linear,
|
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,
|
SmoothPreserveZero,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user