Algorithm 1.
GetBBM_twosamples.
INPUT: LBPCode1 of Img1, LBPCode2 of Img2, (moving) step, (moving) times. |
OUTPUT: BBM of two samples Img1 and Img2. |
Algorithm: |
Direct matching, compute the similarity using LBPCode1and LBPCode2, denoted as S0. |
//taking Img1as base, align through moving Img2 toward up direction. |
for n=1 to times do |
move Img2 up n*step pixels. |
extract the subsets of LBPCode1 and LBPCode2 according overlapped region. |
Compute the similarity using these two subsets, denoted as Sup(n). |
endfor |
//taking Img1as base, align through moving Img2 toward down direction. |
for n=1 to times do |
move Img2 down n*step pixels. |
extract the subsets of LBPCode1 and LBPCode2 according overlapped region. |
Compute the similarity using these two subsets, denoted as Sdown(n). |
endfor |
//taking Img1as base, align through moving Img2 toward left direction. |
for n=1 to times do |
move Img2 left n*step pixels. |
extract the subsets of LBPCode1 and LBPCode2 according overlapped region. |
Compute the similarity using these two subsets, denoted as Sleft(n). |
endfor |
//taking Img1as base, align through moving Img2 toward right direction. |
for n=1 to times do |
move Img2 right n*step pixels. |
extract the subsets of LBPCode1 and LBPCode2 according overlapped region. |
Compute the similarity using these two subsets, denoted as Sright(n). |
endfor |
S=Max(S0,Sup(1)…Sup(times), Sdown(1)…Sdown(times), Sleft(1)…Sleft(times), Sright(1)…Sright(times)) |
Get the subsets of LBPCode1and LBPCode2 corresponding to S. |
Take the subsets as the new LBPCodes. |
generate the BBM of new LBPCodes using definition 1 and 2. |