Skip to main content
. 2018 Feb 11;18(2):548. doi: 10.3390/s18020548
Algorithm 2 ROI Classification.
Input: A symbolic image with ROIs labeled by sequential integers.
Output: The category of each ROI in the map.
Begin:
  • 1:

    Detect the maximum integer in the symbolic image: NR;

  • 2:

    Perform Canny edge detector to the image, then search the pixel coordinates on the edge of each ROI: Ei=Xi,YiT;

  • 3:

    for i = 1 to NR do

  • 4:

       for θk = 0 to 90 do

  • 5:

          Calculate the coordinate of the edge pixels in the rotated Cartesian coordinate system: E^iθk=Tθk·Ei=[X^iθk,Y^iθk]T;

  • 6:

          Calculate the two-dimensional spans of the ROI: ΔX^=max[X^i(θk)]min[X^i(θk)], ΔY^=max[Y^i(θk)]min[Y^i(θk)];

  • 7:

          Initialize Ri as a distributed ROI under θk;

  • 8:

          Calculate the side-lengths of the MBR: aik=maxΔX^,ΔY^, bik=minΔX^,ΔY^;

  • 9:

          if bik<lsw then

  • 10:

             Ri is a point ROI under θk;

  • 11:

             if aik>lsw then

  • 12:

                Ri is a quasi-point ROI under θk;

  • 13:

             end if

  • 14:

          end if

  • 15:

       end for

  • 16:

       Traverse all θk and classify Ri according to (16).

  • 17:

    end for