Skip to main content
. 2026 Aug 14;26(16):5166. doi: 10.3390/s26165166
Algorithm A1 Preprocessing procedure for hydrofoil-region suppression
Input: Averaged grayscale image I
Output: Residual image D
  • 1.
      Store the original image:
    I0←I
  • 2.
      Determine the maximum image intensity:
    Imax←max(I0)
  • 3.
      Extract high-intensity pixels:
    Ith(x,y)←I0(x,y),I0(x,y)≥0.85Imax
      otherwise
    Ith(x,y)←0
  • 4.
      Detect image edges using the Sobel operator:
    E←Sobel(I0)
  • 5.
      Suppress the hydrofoil region and its edges:
    Iw←I0−Ith−E
  • 6.
      Binarize the resulting image:
    B←Binarize(Iw)
  • 7.
      Retain the two largest connected components:
    B2←AreaFilter(B,2)
  • 8.
      Identify the removed small components:
    R←B−B2
  • 9.

      Set pixels corresponding to R to zero in Iw.

  • 10.

    Apply median filtering to Iw using a 6×6 window.

  • 11.

    Apply median filtering to I0 using a 6×6 window.

  • 12.
    Compute the residual image:
    D←MedianFilter(I0)−MedianFilter(Iw)
  • 13.

    Return D.