## 3 Materials and Methods
### Metric  
Let us consider the reference color image as a function from the \(\Omega\) domain to the color space, i.e., \(I:\Omega\subset\mathbb{R}^{2}\to\mathbb{R}^{3}\), and the metric \(d_{\mathbf{xy}}:\Omega\subset\mathbb{R}^{2}\to\mathbb{R}\), conforming to the manifold \(\mathcal{M}=(\Omega,d_{\mathbf{xy}})\). Considering \(\mathcal{M}\), we solve Equation (4). We explored different metrics to estimate the shape of the manifold in order to better approximate the geodesic distance. In a preliminary work [19], we tested the following metric:  
\[d_{\mathbf{x},\mathbf{y}}=\kappa_{x}\|\mathbf{x}-\mathbf{y}\|^{2}+\kappa_{c} \sum_{i\in L,\mu,b}|I(\mathbf{x})-I(\mathbf{y})|^{2}.\]  
where the constants \(\kappa_{x}\) and \(\kappa_{c}\in\mathbb{R}\) are estimated in the training stage. This metric comprises two terms: a spatial distance term \(\|\mathbf{x}-\mathbf{y}\|^{2}\) and a photo-chromatic distance term \(\|I(\mathbf{x})-I(\mathbf{y})\|^{2}\). The first term is the spatial distance of pixels \(\mathbf{x}\) and \(\mathbf{y}\) in the image domain \(\Omega\)The second term is the photo-chromatic distance in the CIE-Lab color space between \(I(\mathbf{x})\) and \(I(\mathbf{y})\). To give more flexibility to this metric, we relaxed the exponents as follows:  
\[d_{\mathbf{x},\mathbf{y}}=\left[\kappa_{X}\|\mathbf{x}-\mathbf{y}\|^{s}+\kappa_ {c}\sum_{i\in L,a,b}|I(\mathbf{x})-I(\mathbf{y})|^{p}\right]^{q}\]  
where \(p\), \(q,s\in\mathbb{R}^{+}\). We also estimated the exponent values in the training stage. We stated (in our work presented in [1]) the following metric:  
\[d_{\mathbf{x},\mathbf{y}}=\Big{(}\kappa_{X}[(\mathbf{x}-\mathbf{y})^{T}A( \mathbf{x}-\mathbf{y})]^{s}+\kappa_{c}\Big{[}(I(\mathbf{x})-I(\mathbf{y}))^{T} \mathrm{C}(I(\mathbf{x})-I(\mathbf{y}))\Big{]}^{p}\Big{)}^{q}, \tag{15}\]  
where \(A\) and \(C\) are positive definite matrices, and \(d_{\mathbf{x},\mathbf{y}}\) is called the positive definite metric. In this work, we propose an anisotropic metric, which considers a balance term \(\theta(\mathbf{x})\) between spatial distance and photo-chromatic distance,  
\[d_{\mathbf{x},\mathbf{y}}=\Big{[}\kappa_{X}\theta(\mathbf{x})[(\mathbf{x}- \mathbf{y})^{T}A(\mathbf{x}-\mathbf{y})]^{s}+\kappa_{c}(1-\theta(\mathbf{x}) )\Big{[}(I(\mathbf{x})-I(\mathbf{y}))^{T}\mathrm{C}(I(\mathbf{x})-I(\mathbf{y }))\Big{]}^{p}\Big{]}^{q}, \tag{16}\]  
where \(\theta(\mathbf{x})\) is defined by  
\[\theta(\mathbf{x})=\frac{1}{1+e^{\theta_{\theta}(D_{\sigma}(\mathbf{x})-\tau_ {\theta}D_{\theta}(\mathbf{x}))}},\]  
where \(D_{\sigma}(\mathbf{x})=\|\mathbf{x}-\mathbf{y}\|^{s}\) is the spatial distance, \(D_{\phi}(\mathbf{x})=\log\Bigg{(}1+\sum_{i\in L,a,b}|I(\mathbf{x})-I(\mathbf{ y})|^{p}\Bigg{)}\) is the photo-chromatic distance, and \(\beta_{\theta},\tau_{\theta}\in\mathbb{R}^{+}\). On the one hand, if \(D_{\sigma}(\mathbf{x})\gg D_{\phi}(\mathbf{x})\), the difference between \(D_{\sigma}(\mathbf{x})-\tau_{\theta}D_{\phi}(\mathbf{x})\) should be large, and positive. It means that \(e^{\beta_{\theta}(D_{\sigma}(\mathbf{x})-\tau_{\theta}D_{\theta}(\mathbf{x}))}\) should be also large, and finally \(\theta(\mathbf{x})\) should be small, i.e., \(\theta(\mathbf{x})\approx 0\). The metric is more confident in the photo-chromatic term. On the other hand, if \(D_{\sigma}(\mathbf{x})\ll D_{\phi}(\mathbf{x})\), the difference between \(D_{\sigma}(\mathbf{x})-\tau_{\theta}D_{\phi}(\mathbf{x})\) should be negative. It means that \(e^{\theta_{\theta}(D_{\sigma}(\mathbf{x})-\tau_{\theta}D_{\theta}(\mathbf{x}))}\) should be small, \(\approx 0\), that is to say, that \(\frac{1}{1+e^{\beta_{\theta}(D_{\sigma}(\mathbf{x})-\tau_{\theta}D_{\theta}( \mathbf{x}))}}\approx 1\), meaning that the metric is more confident in the spatial term. As a proof of concept of \(\theta(\mathbf{x})\), we show estimation examples of the balance term considering a color reference image in Figure 7.  
Figure 7 shows color-coded values of the \(\theta(\mathbf{x})\) map.