Skip to main content
. 2018 Mar 25;18(4):972. doi: 10.3390/s18040972
Algorithm 2 Data acquisition by using a Neuro-Fuzzy filter. (Figure 6 bottom).
Input: capture image
Output: extract α^real,CoG(X,Y) values
Require: camera ON
  • 1:

    Capture (Img)

  • 2:

    Binarize (Img) //Threshold of the object to be detected

  • 3:

    if (Object_detected (Img) == true) then

  • 4:

     //Extraction values from the original frame

  • 5:

     Bottle = Get_Blobs(Img)

  • 6:

     (XCoG,YCoG) = Get_CoG(Bottle)

  • 7:

    α = Get_Angle_Inclination(Bottle)

  • 8:

    end if

  • 9:

  • 10:

    //Applying of the Fuzzy filter previously trained

  • 11:

    while (i < n) do

  • 12:

     //Search of similarities within the dataset

  • 13:

    if ((Lin<XCoG<Lsn) and (Rin<YCoG<Rsn) and (Pin<α<Psn)) then

  • 14:

        α^real=Angleerrorα

  • 15:

        return

  • 16:

    end if

  • 17:

    i++

  • 18:

    end while

  • 19:

    return XCoG,YCoG,α^real // α^real is the real inclination angle