java.lang.Object
imagingbook.common.geometry.fitting.line.utils.LineSampler
Instances of this class are used to randomly sample points along a given straight line segment, x/y coordinates being perturbed with Gaussian noise. Mainly used for testing line fitters.
- Version:
- 2022/09/29
-
Constructor Summary
ConstructorsConstructorDescriptionLineSampler
(Pnt2d p1, Pnt2d p2) Constructor (with no specific seed).LineSampler
(Pnt2d p1, Pnt2d p2, long seed) Constructor (with specific random seed). -
Method Summary
-
Constructor Details
-
LineSampler
Constructor (with no specific seed).- Parameters:
p1
- first point of the line segmentp2
- second point of the line segment
-
LineSampler
Constructor (with specific random seed).- Parameters:
p1
- first point of the line segmentp2
- second point of the line segmentseed
- random seed (pass 0 for complete randomness)
-
-
Method Details
-
getPoints
Returns an array of randomly sampled points.- Parameters:
n
- the number of pointssigma
- standard deviation of Gaussian position noise- Returns:
- an array of random points
-