Table 1 The process of multi-feature fusion
From: Virtual restoration method of Kizil Grotto murals based on multimodal controlled diffusion models
Algorithm: multi-feature fusion for Kizil caves murals |
|---|
Require: |
Input image tensor\(X\), low threshold \({\tau }_{low}\), high_threshold \({\tau }_{{\rm{high}}}\), Kernel size \(k\), Gaussian Sigma\(\sigma\), hysteresis flag \(h\), small constant ὸ. |
Ensure: |
Fused feature map \(F\); detected edges \(E\). |
1: Convert to grayscale |
\({X}_{{\rm{gray}}}={\rm{rgb}}\_{\rm{to}}\_{\rm{grayscale}}({\rm{X}})\) |
2: Apply Gaussian Blur |
3: Compute spatial gradients |
4: Calculate gradient magnitude and angle |
\(\begin{array}{c}M=\sqrt{{G}_{x}^{2}+{G}_{y}^{2}+\epsilon }\\ A=\text{atan}2({G}_{y},{G}_{x})\times \frac{180}{\pi }\\ A={\rm{round}}(A/45)\times 45\end{array}\) |
5: Non-maximum suppression (NMS) |
6: Extract Gabor features |
\({F}_{{\rm{gabor}}}=\exp \left(-\frac{{x}^{{\prime} 2}+{\gamma }^{2}{y}^{{\prime} 2}}{2{\sigma }^{2}}\right)\cos (2\pi \frac{x{\prime} }{\lambda }+\psi )\) |
7: Extract HOG features |
\({F}_{{\rm{hog}}}=\nabla I=\left[\frac{\partial I}{\partial x},\frac{\partial I}{\partial y}\right]\) |
8: Extract LBP features |
\({F}_{{\rm{lbp}}}=\mathop{\sum }\limits_{p=0}^{P-1}s({i}_{p}-{i}_{c})\cdot {2}^{p}\,{\rm{where}}\,s(x)=\left\{\begin{array}{c}1\,x\ge 0\\ 0\,x < 0\end{array}\right.\) |
9: Fuse features with weighted sum |
\(F=0.1\times {F}_{{\rm{gabor}}}+0.1\times {F}_{{\rm{hog}}}+0.25\times {F}_{{\rm{lbp}}}+0.55\times {M}_{{\rm{nms}}}\) |
10: Detect edges with thresholding |
11: Return \(F\), \(E\). |