Introduction
We propose a frameworg to extract geometric structures from images using Delaunay Point Process (DPP).
This framework is based on the paper "Extraction Geometric Structures in Images with Delaunay Point Processes" (TPAMI 2019)
Dependencies
Qt5, Glm, Glew, Eigen3, OpenCV, CGAL and SuiteSparse
Configuration files
General parameters
You can modify the parameters of DPP modifying the file (data/)config/DPP_parameters.conf. The default content of this file is the following:
sampling_mode GUIDED
: set the sampling mode to UNIFORM of GUIDED. For GUIDED sampling, the algorithm use the image Datacost::img_grad
which has to be initialized inside the method DataCost::ini_from_file
.
active_kernel BD_M_L
: specify which kernel the algorithm will use. Possible values are BD_M_L, BD_M, BD_L, BD, B_L, D_L, M_L, B, D, M, L. B = birth kernel, D = death kernel, M = point relocation kernel (ie move), L = mark alteration kernel (ie change label)
sampling_domain 0.0 0.0 1.0 1.0
: the domain for sampling points when sampling_mode is set to UNIFORM. The two first parameters should be 0.
expected_number_of_point 1000
: it it the the parameter lambda of equation 5 of our paper which represents the parameter of the discrete Poisson distribution.
T_0 0.01
: it is the initial temperature of the RJMCMC defined in Algorithm 1 and used in equation 6
alpha 0.99998000
: it is the parameter of the geometric decrease of the temperature which is used in equation 6
number_of_maximum_iteration 2000000
we stop the algorithm when the maximum number of iteration is reached.
Application specific parameters
You can modify application specific parameters modifying the file (data/)config/app_blablabla_parameters.conf.
This file is loaded by the function
DataCost::load_app_specific_parameters
called by the system at the beginning.
Main structure
Main structures for DPP are defined in main.h. There is one to create console application and another one to create application with an user interface:
struct delaunay_point_process
struct delaunay_point_process_gui
The first templates of these structures are:
CostVertex
CostEdge
CostFace
DataCost
Then the structure
delaunay_point_process_gui
is templated by
GuiRendering
and then the two structures are templated by
Label
Label
This object correspond to the type of the label. The default type is
int
. If you want to store in the primitive of the Delaunay triangulation some temporary value, you can store them here.
DataCost
DataCost contains all parameters used inside Cost* classes. You can add new parameters if you want.
DataCost contains several methods:
ini_from_file
is called at the begining of the algorithm to initialise the algorithm
and mainly the distribution used by the kernel Birth to draw a new point on the Image domain.
load_app_specific_parameters
: is called at the begining of the algorithm to initialise application specific parameters.
save_output
is called at the end of the algorithm to save results.
operator_label
is called by the system when the kernel mark alteration is invoked. This method redirects the program to the right mark alteration kernel which differ from an application to another one
process_user_classes_input
is called by the system when the user click on recompute proba.
is_in_img
and is_not_valid
are called by the system to check if an integer pixel is on the image or if a floating point pixel is one of the four exterior point which support the all Delaunay triangulation.
Cost*
p_label(Triangulation& t, Primitive& p, DataLabel& dataLabel)
compute the probability that the primitive p
is labelled by dataLabel.label
and put this probability inside dataLabel.p_label
. This function is called when the primitive or an adjacent primitive is modified. You can update specific extra temporary variable of DataLabel
you used in the cost function.
recompute_label
. This method return a label. This method is called to initialize new primitives.
cost
. This method return the energy associated to the current primitive.
GuiRendering
This class contains a method
ini_vbo_get_alpha
which transfert the meshe and the labels to the gpu.
Attributs of this class are used by the class MainWindows to add on the interface some control on specific-application parameters.