Skip to main content
. 2018 Aug 25;18(9):2808. doi: 10.3390/s18092808
Algorithm 1. Pseudo code of SLIC-SegNet algorithm.
Preparatory work for SegNet module [30]:
  a: Convolution operation, get the feature value x;
  b: Batch Normalizing Transform;
  c: Training a Batch-Normalized Network;
Result: the trained SegNet module.
Initialize: k = {1 … K}, i = {1 … 480}, j = {1 … 360}, n = {1 … N}, m = { 1… M}. Bi(i−1 ,…, n) represents the set of pixels in each sorted area, the RGB components of each pixel are denoted as IBm(x, y); IAn(x, y) stand for the pixels in Ank, Mode represents the component value of the most frequently occurring RGB components of all pixels in Ank, recorded as IMode
Repeat
1.  Collect kth image: Ik(xi, yj)
   For k = 1…K do
2.    Run the SLIC module:
       Assign the best matching pixels;
       Compute new cluster centers and residual error E;
       until E ≤ threshold;
       Enforce connectivity;
       Output the each pixel block Ank ∈ {A1, A2 … AN|∑n=1NAnk=Ik}; where An = n each pixel IAn(x, y) ∈ Ank
3.    Run the trained SegNet module:
       Activate feature value;
       Deconvolution, get the feature value Xn;
       Find the maximum probability of each pixel in all categories.
       Output the label set Bmk ∈ {B1, B2 … BM|∑m=1MBmk=Bk}, IBm(x, y) ∈ Bmk
4.     Match Ak and Bk, define set Cnk = Ank
        For i = 1 … n
          find each xAn, yAn of ICn
          InMode = Mode(IB(xAn, yAn));
          For each (xAn, yAn) ∈ Ank
            Assignthe Mode of the RGB component to ICn(xAn, yAn):
            ICn(xAn, yAn) = InMode
          End for
         End for
         Output Cnk ∈ {C1, C2 … CN|∑n=1NCnk=Ck}, ICn(x, y) ∈ Cnk
5.  Gait selection and run the Robot;
    End for
Until the Robot switched off.