$\DeclareMathOperator{\arccosh}{arccosh} \DeclareMathOperator*{\argmin}{arg\,min} \DeclareMathOperator{\Exp}{Exp} \newcommand{\geo}{\gamma_{\overset{\frown}{#1,#2}}} \newcommand{\geoS}{\gamma} \newcommand{\geoD}{\gamma_} \newcommand{\geoL}{\gamma(#2; #1)} \newcommand{\gradM}{\nabla_{\M}} \newcommand{\gradMComp}{\nabla_{\M,#1}} \newcommand{\Grid}{\mathcal G} \DeclareMathOperator{\Log}{Log} \newcommand{\M}{\mathcal M} \newcommand{\N}{\mathcal N} \newcommand{\mat}{\mathbf{#1}} \DeclareMathOperator{\prox}{prox} \newcommand{\PT}{\mathrm{PT}_{#1\to#2}#3} \newcommand{\R}{\mathbb R} \newcommand{\SPD}{\mathcal{P}(#1)} \DeclareMathOperator{\Tr}{Tr} \newcommand{\tT}{\mathrm{T}} \newcommand{\vect}{\mathbf{#1}}$

# Filter an image

This function performs a convolution or filtering of an image by reinterpreting the weightde sum in the convolution as a Karcher mean. For a given filter $w_{i,j}$, $i,j=-n,\ldots,n$ this function computes

where $k,l$ adress a pixel of the $\M^{N\times M}$ image $x$ and one can specify boundary conditions (nearest, symmetric or periodic). This algorithm was implemented for 

### Matlab Documentation

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
% filteredImage = filter(this,image,filter)
%    Convoles the this-valued image with the filter using
%    Karcher mean
%  INPUT
%    image   manifold Valued image
%    filter  filter matrix of size (2*n+1)x(2*n+1)
%
%  OPTIONAL
%    'BoundaryCondition' ['nearest'] specify boundary
%                        conditions:
%                        (nearest,symmetric,periodic)
%
%  OUTPUT
%    filteredImage   filtered image with Karcher mean
%
% ---
% Manifold-valued Image Restoration Toolbox 1.2
% J. Persch, R. Bergmann ~ 2017-04-06 | 2018-02-17