|
Algorithm 1 Magnetic Ring Location Algorithm |
| 1: Given a grayscale torus image . |
| 2: Use sub-region gray threshold segmentation to obtain a binary image . |
| 3: for I = 0, …, M do
|
| 4: Scan from top to bottom. |
| 5: Count the number of black dots. |
| 6: if
|
| 7: Get the up position . |
| 8: end
|
| 9: end
|
| 10: for I = 0, …, M do
|
| 11: Scan from bottom to top. |
| 12: Count the number of black dots. |
| 13: if
|
| 14: Get the down position . |
| 15: end
|
| 16: end
|
| 17: Output the location result and . |