From bb13a0e7ef8b3b656e6522dfc75a72490e92d5df Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Tue, 19 Dec 2017 14:25:42 +0100 Subject: [PATCH] Add new figure for Wasserstein tolerance example (+ minor fixes in user manual) --- ...ptimal_transportation_reconstruction_2.txt | 38 +++++++++++++----- .../fig/tolerances.png | Bin 0 -> 9173 bytes 2 files changed, 28 insertions(+), 10 deletions(-) create mode 100644 Optimal_transportation_reconstruction_2/doc/Optimal_transportation_reconstruction_2/fig/tolerances.png diff --git a/Optimal_transportation_reconstruction_2/doc/Optimal_transportation_reconstruction_2/Optimal_transportation_reconstruction_2.txt b/Optimal_transportation_reconstruction_2/doc/Optimal_transportation_reconstruction_2/Optimal_transportation_reconstruction_2.txt index e6fd1102c3a..f2c140be609 100644 --- a/Optimal_transportation_reconstruction_2/doc/Optimal_transportation_reconstruction_2/Optimal_transportation_reconstruction_2.txt +++ b/Optimal_transportation_reconstruction_2/doc/Optimal_transportation_reconstruction_2/Optimal_transportation_reconstruction_2.txt @@ -26,12 +26,25 @@ The output of the reconstruction algorithm is a subset of edges and vertices of \subsection Optimal_transportation_reconstruction_2Simplest_example Simplest Examples -The following example first generates a set of input points on a square. The points, with no mass attribute, are then passed to the Optimal_transportation_reconstruction_2 object. After initialization, 100 iterations of the reconstruction process are performed. +The following example first generates a set of input points on a +square. The points, with no mass attribute, are then passed to the +Optimal_transportation_reconstruction_2 object. After initialization, +100 iterations of the reconstruction process are performed. \cgalExample{Optimal_transportation_reconstruction_2/otr2_simplest_example.cpp} -Usually, the number of edges in the output reconstruction (and hence the number of iterations to perform) is not known by the user: in that case, the algorithm can be run with a Wasserstein distance tolerance used as a stop criterion (instead of a number of iterations). +There is no direct relationship between the target number of edges for +the output reconstruction and a notion of approximation error. The +simplification algorithm can thus be stopped via a maximum tolerance +error homogeneous to a distance. More specifically, the tolerance +error is specified as the maximum square root of transport cost per +unit of mass, which is homogeneous to a distance. -Note that the tolerance is given in the sense of the Wasserstein distance (see \ref Optimal_transportation_reconstruction_2Wasserstein). It is _not_ a Hausdorff tolerance: it does not mean that the distance between the input samples and the output polyline is guaranteed to be less than `tolerance`. It means that the square root of transport cost per mass (homogeneous to a distance) is at most `tolerance`. +Note that the tolerance is given in the sense of the Wasserstein +distance (see \ref Optimal_transportation_reconstruction_2Wasserstein). It is _not_ a +Hausdorff tolerance: it does not mean that the distance between the +input samples and the output polyline is guaranteed to be less than +`tolerance`. It means that the square root of transport cost per mass +(homogeneous to a distance) is at most `tolerance`. \cgalExample{Optimal_transportation_reconstruction_2/otr2_simplest_example_with_tolerance.cpp} \subsection Optimal_transportation_reconstruction_2Output_example Output Examples @@ -85,19 +98,24 @@ and specify the number of output vertices one wants to keep as illustrated in otr2.run_until(20); // perform edge collapse operators until 20 vertices remain. \endcode -Finally, calling \link Optimal_transportation_reconstruction_2::run_under_wasserstein_tolerance `run_under_wasserstein_tolerance()` \endlink -allows the user to run the algorithm based on a distance criterion -when the number of output edges is not known. -\code{.cpp} -otr2.run_under_wasserstein_tolerance(0.1); // perform collapses until no more can be done within tolerance -\endcode - \cgalFigureBegin{Optimal_Transportation_Curve_Reconstruction_twenty_vertices,twenty_vertices.png} Examples of 20-vertex reconstructions from datasets consisting of 2000, 400 and 200 input points respectively. These examples illustrate the behavior of the algorithm when the input point density decreases. \cgalFigureEnd +Finally, calling \link Optimal_transportation_reconstruction_2::run_under_wasserstein_tolerance `run_under_wasserstein_tolerance()` \endlink +allows the user to run the algorithm based on a distance criterion +when the number of output edges is not known as illustrated in + \cgalFigureRef{Optimal_Transportation_Curve_Reconstruction_tolerance}. +\code{.cpp} +otr2.run_under_wasserstein_tolerance(0.1); // perform collapses until no more can be done within tolerance +\endcode + +\cgalFigureBegin{Optimal_Transportation_Curve_Reconstruction_tolerance,tolerances.png} +Examples of reconstructions with different Wasserstein tolerance threshold. Top: input point set and reconstruction with a tolerance of 0.005. Bottom: reconstructions with a tolerance of 0.05 and with a tolerance of 0.1. +\cgalFigureEnd + \subsection Optimal_transportation_reconstruction_2Global_relocation Global Point Relocation diff --git a/Optimal_transportation_reconstruction_2/doc/Optimal_transportation_reconstruction_2/fig/tolerances.png b/Optimal_transportation_reconstruction_2/doc/Optimal_transportation_reconstruction_2/fig/tolerances.png new file mode 100644 index 0000000000000000000000000000000000000000..b9123f15b05a819f8129d51409d7d3c9e360a62d GIT binary patch literal 9173 zcmbVyWmHse^e!k$cjq7>-65%TN=OWcmZ3pHI;C-Fq=#;V8DdD05*$EEx=T>HBnG4} zzyH1W^Ihxiwa$6he)jY1_k7yx?7eo3uC^*69vvPA1_q(Jnvxy{#v=d&19J`M@dFZ- zF8K4|$klyqpnQLSKRi7A;9=Ndh`>Z(!>|Xlv$GQs5y60oJfOq(!*;_DF$}v0c=!Q& zh!11H9>^HO53&E`56%M>Cf4}|;wx%|Hr|4Ex&!S)Xyh6&MBRln+O9~ExYBQ_r{y!}mf8MnP`Y6`>@<%wFM@5^9Tt+Q04IvTw{Hxh*r*5abL}kJ^J}-q_|bifA~#r{`eva1kzKg{Itr3xO|Lob#C~<5ZwkQaj`Nr<}#suo6f4I?y?@QCm`&a z)$Cn*QBwRG7Ica~p&@;sqQL9};j;{(yLyb()FwEq$l?RBUDaar;Qj>kk)RISCu>1Y zaR4kT+?)vfXD7OTKP3Tb))vQqWQhvGqdf?x6eyVimd~0Dgifni!SAmR8K=G5KMLx^ zxw_?(*`!O>7JJkCwQlcjsqRC(!80si{V(cmklqzYuf~~L11fgfbpBEmfH5PJfs1AM zNT4qQ7=Ev9Z=t*+?mifpEHuHJu}g`s3hU+m6>{a!N=6?)Y~4d6B0@j2*Y6My40KM9 z|07x>KSRa#I^ZggzF-7_mt!S9nfBZrNqqH?g;~j9p)=bNGfPh%$O+GQ+b?7`?R4`z1hs}@rppd&jpco$m_#xxrAvBBT%)RlB=Tj z#}TpwM1DyfzZ2&>Asn7g6`T?4o~)(luufltCILwUY1PtY%cmx{pLZo6Pv!{0#@BWN(-n8z$*k15m@4VjY z6YzE*+V}?qw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