|
Algorithm 2 Image Edge Removal Algorithm |
| Part I |
1: Given a grayscale image . |
| 2: Process and get gray binary image . |
| 3: for I = 0, …, M do
|
| 4: Set the array of IEC to , set the array of OEC to . |
| 5: for j = 0, …, N − 2 do
|
| 6: if
|
| 7: Get . |
| 8: end
|
| 9: end
|
| 10: for j = , …, N − 4 do
|
| 11: if
|
| 12: Get . |
| 13: end
|
| 14: end
|
| 15: for j = 0, …, N do
|
| 16: if
|
| 17: Set
|
| 18: end
|
| 19: end
|
| 20: end
|
| 21: Output the edge-removed gray binary image . |
| Part II |
1: |
Given a grayscale image . |
| 2: |
Obtain a binary image and an image with high threshold binarization. Use Sobel operator to obtain gradient binary image . |
| 3: |
for i = 0, …, M do
|
| 4: |
Set the array of IEC to , set the array of LEC and set the array of OEC to . |
| 5: |
for j = 0, …, N − 4 do
|
| 7: |
if
|
| 8: |
Get . |
| 9: |
end
|
| 10: |
end
|
| 11: |
for j = , …, N − 4 do
|
| 13: |
if
|
| 14: |
Get . |
| 15: |
if
|
| 16: |
Get . |
| 17: |
end
|
| 18: |
end
|
| 19: |
for j = 0, …, N do
|
| 20: |
if
or
|
| 21: |
Set . |
| 22: |
end
|
| 23: |
end
|
| 24: |
end
|
| 25: |
Output the edge-removed torus gradient image . |
| Part III |
1: |
Given a grayscale end face image . |
| 2: |
Process and get binary image . |
| 3: |
Create a white circle with as its center, radius and line width, respectively. |
| 4: |
forj = y, y − 1, …,4 do
|
| 5: |
Scan upward from . |
| 6: |
if
|
| 7: |
Get . |
| 8: |
end
|
| 9: |
end
|
| 10: |
Create a white circle with as its center, radius and line width, respectively. |
| 11: |
Use and to remove edges. |
| 12: |
Output the edge-removed grayscale end face image. |