Algorithm 1.
Our learning method for active patch dictionary
| Initialization: | |
| 1: | Get 𝒟o from clustering algorithm; |
| 2: | 𝒟f ← ∅; ∀Mbest(I, pos) ← 0; ∀pr ← void, pr ∈ ∀IR(I); |
| Process: | |
| 3: | Sort 𝔸(k) ∈ 𝒟o w.r.t. F(𝔸(k)) in descending order; |
| 4: | for each 𝔸(k) ∈ 𝒟o do |
| 5: | ∀I ∈ Ω, record current IR(I) and Mbest(I, pos); ΔE ← 0; |
| 6: | for each position pos of each image I ∈ Ω where 𝔸(k) is firing do |
| 7: | for each pixel do |
| 8: | Calculate ΔE according to Equ. 4; |
| 9: | if the corresponding pr = void or M(𝔸(k), I, pos) > Mbest(I, pos) then |
| 10: | pr ← pd; Mbest(I, pos) ← M(𝔸(k), I, pos); |
| 11: | end if |
| 12: | end for |
| 13: | end for |
| 14: | if ΔE < 0 then |
| 15: | Add 𝔸(k) to 𝒟f |
| 16: | else |
| 17: | ∀I ∈ Ω, restore IR(I) and Mbest(I, pos) to previous value; |
| 18: | end if |
| 19: | end for |