Skip to main content
. 2012 Nov 12;12(11):15638–15670. doi: 10.3390/s121115638

Algorithm 2 Deterministic PBOD

Require: patch matching
(a) For each patch, obtain Inline graphicInline graphic3 based on RGB space
(b) If β1,R,G,Bmax>𝒯3
  εd = 1
Else
  εd = 0
End If
(c) If εd = 0, start 2nd level test
(d) For 2nd level test, obtain Inline graphicInline graphic1 for each patch
(e) Select β2,Hmax as the candidate patch
Ensure: position smoothing
(a) Select colour space based on εd, either RGB or HSV
(b) Determine the step size, δ
(c) Construct the translated patch, β7a,β7b,β7c,β7d
(d) Find maximum Inline graphicInline graphic
(e) While β8 = β6 Do
If Inline graphicInline graphicmax > Inline graphicInline graphicori
  β8 = β6
Else
   β8=β7max
End If
End While
Ensure: size smoothing
(a) Determine α as the size factor
(b) Obtain size pattern based on β9 histograms either to use shrinkage or expansion pattern
(c) Normalize histograms size for fairer histogram matching
(d) If 𝒟c^>𝒟cβ8
  Utilize shrinkage patch patterns
Else
  Utilize expansion patch patterns
End If
(e) Switch
  Case (shrink)
   If Inline graphicInline graphici < ( Inline graphicInline graphicmaxα), L13 = 0 Else L13 = 1
  Case (expand)
   If Inline graphicInline graphicj < ( Inline graphicInline graphicmax + α), L14 = 0 Else L14 = 1
End Switch
(f) Reiterate the process until the patch has converged to a certain size or number of iteration has exceeded p cycles.