Hans Brouwer & Aggariyo Wanagiri
Install dependencies
pip install -r requirements.txt
To fuse images using a CLI:
python guided_filter_fuse.py -h
python wavelet_fuse.py -h
The main results from the report can be recreated by running the evaluation code.
python evaluation.py
- Guided filter
- Filter output = linear transformation of guidance image in local window
O = a * I[w] + b for w in windows(I)
- Linear coefficients estimated by minimizing squared difference b/w output and input image
- Can solve directly with linear regression
a = sum(I[w] * P[w] - mean(I[w]) * mean(P[w])) / (len(w) * (var(I[w]) + eps))
b = mean(P[w]) - a * mean(I[w])
- Naively, this causes value of output pixel values (O_i) to change in different windows
- => Pre-calculate all a & b and then average for each window
a_bar = sum(a_k for k in w) / len(w)
,b_bar = sum(b_k for k in w) / len(w)
- Filter output = linear transformation of guidance image in local window
- Image fusion
- Compute two-scale representations of images by average filtering
- B_n = conv(I_n, Z) with Z = 31x31 average filter
- D_n = I_n - B_n
- Construct weight map
- H_n = conv(I_n, L) with L = 3x3 Laplacian filter
- S_n = conv(abs(H_N), g) with g = (2r_g+1)x(2r_g+1) Gaussian low-pass with std. dev. = sig_g
P_n[k] = 1 if S_n[k] == max(S_i[k] for i in n) else 0
- Realign weight maps using spatial consistency
- Guided filter on weight map with source image as guide
- W_n = GuidedFilter(P_n, I_n) for B and D
- Normalize weight maps to sum to 1
- Weighted average of base and detail images with respective weight maps, sum base and detail to final output
- Compute two-scale representations of images by average filtering
- Evaluation metrics
- Normalized mutual information
- Structural similarity (SSIM)
- Cveijic's Metric / UIQI
- Gradient based index
- Phase congruency
- Image fusion
- Calculate wavelet transform
- At each resolution and point in the image take the max of coefficients of the two images
- Windowed maximum over local area of coefficients
- Majority filter on binary weighting
- Majority filter, negate, majority filter, negate
- Apply binary map to wavelets and transform back to image