Sampler Single Peak [HSD13]
Description
The sampler from [HSD13] with a step profile.
For a more precise description of this sampler and its performances in terms of aliasing and discrepancy, please refer to the following web bundle https://liris.cnrs.fr/ldbn/HTML_bundle/index.html.
Files
src/samplers/Step.cpp
include/utk/samplers/SamplerStep.hpp
externals/Step/*
Usage
Step sampler
Usage: ./Step [OPTIONS]
Options:
-h,--help Print this help message and exit
-n UINT REQUIRED Number of points
-d UINT UNUSED ! Here for compatibility with others.
-s,--seed UINT Seed (unspecified means 'random')
-m UINT [1] Number of pointsets
-o,--out TEXT [out.dat] Output file (format). {i} splits outputs in multiple files and token is replaced by index.
--criticalFreq FLOAT [0.606]
Critical frequency
--smoothing FLOAT [8] Smoothing
--silent Silence UTK logs
#include <utk/utils/PointsetIO.hpp>
#include <utk/utils/Pointset.hpp>
#include <utk/samplers/SamplerStep.hpp>
int main()
{
utk::Pointset<double> pts;
utk::SamplerStep step(
0.606, /* critical frequency */
8, /* smoothing */
);
step.setRandomSeed(args->seed);
// Check for no errors
if (step.generateSamples(pts, 1024 /* Number of points */))
{
write_text_pointset("step.dat", pts);
}
}
import pyutk
sp = pyutk.Step(
0.606, # Critical frequency
8 # Smoothing
)
samples = sp.sample(1024) # This is a numpy array !
Results
License
See Licence.md file. Author code from has no licence but is provided with following header.
//
// Source code for the paper, edited to fit the utk framework
//
// D. Heck and T. Schloemer and O. Deussen, "Blue Noise Sampling with
// Controlled Aliasing", ACM Trans. Graph., 2013, in press
//
// Copyright (C) 2012,2013 Daniel Heck and Thomas Schloemer
//