| Algorithm 2 Morphological opening |
| 1. BEGIN |
| 2. VOID open1d(image,u) { |
| 3. FOR i in 1,length(image.lines) do |
| 4. line = image.lines[i] |
| 5. filtered = [] |
| 6. FOR j in 1,length(line.runs) do |
| 7. if runs[j].width() >= u then |
| 8. filtered.append(line.runs[j]) |
| 9. ENDFOR |
| 10. image.lines[i] = filtered |
| 11. ENDFOR |
| 12. END |