Skip to main content
. 2020 Jan 10;20(2):392. doi: 10.3390/s20020392
Algorithm 1 Magnetic Ring Location Algorithm
1: Given a grayscale torus image HRM×N.
2:  Use sub-region gray threshold segmentation to obtain a binary image Gh.
3:  for I = 0, …, M do
4:     Scan Gh from top to bottom.
5:     Count the number δ of black dots.
6:     if δ>Tl
7:         Get the up position up=i.
8:     end
9:  end
10: for I = 0, …, M do
11:   Scan Gh from bottom to top.
12:   Count the number δ of black dots.
13:   if δ>Tl
14:     Get the down position down=i.
15:   end
16:  end
17: Output the location result up and down.