Sunday, February 1, 2015

Direct Visibility of Point Sets

\(\newcommand{\norm}[1] {\lVert #1 \rVert}
\)
Given a set of points \(P=\{p_i | 1\lt i \lt N\} \in \mathbb{R^{D}}\), and a viewpoint \(C\), the goal is to determine the visible points \(\forall p_i \in P\) with respect to \(C\). The method is based on Sphreical Flipping), where each \(p_i \in P\) is reflected about a sphere, centered at \(C\) and constrained to include all points in \(P\). The flip operator is defined as follows:

\begin{equation}
\hat{p_i} = p_i + 2(R-\norm{p_i})\frac{p_i}{\norm{p_i}}
\end{equation}

Generously, Katz et. al. provide a theoretical proof as well as MATLAB implementation within the paper. We further improve this implementation by applying simplifying \(\hat{p_i}\):

\begin{equation} \label{eq1}
\begin{split}
\hat{p_i} & = p_i + 2(R-\norm{p_i})\frac{p_i}{\norm{p_i}}\\
 & = p_i + \frac{2R}{\norm{p_i}}p_i - 2p_i \\
 & = p_i (\frac{2R}{\norm{p_i}}-1)
\end{split}
\end{equation}
Using this reduction and cpu-friendly optimizations, we could provide a shorter, simpler and more efficient algorithm for the visibility problem. In comparison to the original, our MATLAB implementation runs twice as fast, while significantly reducing the memory usage. Our C implementation is more than \(5\) orders of magnitude faster, easily achieving realtime capability even for very large point clouds.

Monday, September 30, 2013

Shock Filtering


Shock Filtering

As a first post to this blog, I will be referring to my Shock Filter implementation, which I believe is a great image processing tool to both get idea on PDEs and to come up with a practically working algorithm.

Quoting J. Weickert,
Shock filters are based in the idea to apply locally either dilation or erosion process, depending on whether the pixel belongs to the influence zone of a maximum or a minimum. They create a sharp shock between two influence zones and produce piece-wise constant segmentation.


Principle of shock filtering is applying dilation and erosion operations in order to satisfy the differential equation: on the function defined by the gray values in the image. The decision between dilation and erosion is made using the signum function based on Laplace operator. Applying such a procedure produces a sharp discontinuity called shock at the borderline between two influence zones. The resulting equation reads Because Laplacian is a second derivative operator, using it alone will not be noise prone. For this reason, in order to make the edge detector more robust, is smoothed at each iteration by a Gaussian kernel. The rest is simply solving the mentioned PDE in an iterative fashion. The resulting effect is basically enhancement/sharpening of the input image. Below is a sample from Shock Filtering:


Entire source code can be found here

References

F. Guichard, J. Morel; “A Note on Two Classical Shock Filters and Their Asymptotics”; Michael Kerckhove (Ed.): Scale-Space 
and Morphology in Computer Vision, LNCS 2106, pp. 75-84; Springer, New York; 2001. 
G. Aubert, P. Kornprobst; “Mathematical Problems inImage Processing”; Applied Mathematical Sciences 147; Springer, New 
York; 2002. 
J. Weickert Coherence-enhancing shock filters; In B. Michaelis, G. Krell (Eds.): Pattern Recognition. Lecture Notes in Computer 
Science, Vol. 2781, Springer, Berlin, 1-8, 2003.