Skip to main content
. 2021 Feb 3;21(4):1033. doi: 10.3390/s21041033
Algorithm 2 The pseudocode of our proposed CME-CNN
Input:
   Dection model index u and e;
NMS threshold Nt, Score threshold s; 
Output:
   The detection result imgBuffer; 
1: /*Bulid model and load model parameter*/
2: segamentation Model = nets Factory.getModelu; 
3. detection Model = nets Factory.getModele;
4: imgBuffer  ;
5: /*Detection Framework Start*/
6: while detection Model On  do
7:    /* Get Img Frame*/
8:    img=camera.getImgFrame();
9:    /*Preprocess high resolution image*/
10:    imgBlocks=Preprocessimg        imgBlockR4×256×256×3
11.    /*Morphological filter processing*/
12:    refineBlocks = FiltermaskBlocks, refineBlocksR4×256×256×3
13:    /*Get the img without background */
14:    maskImg = CombinerefineBlocks.*imgBlocks, maskImgR1024×1024×3
15.    output=detection Model.detectmaskImg,
        outputR200×6
16.    /* Decode the output*/
17.    Boxes,Score=Decode  outputoutput
18.    /*Non Maximum Suppression*/
19.    Boxes,Score=NMSBoxes,Score,Nt
20.    for each box,scoreBoxes,Score do
21.        /*Draw the Bounding Boxes in*/
22:        if scores then
23:         resultImg=RectanglereshapeImg,box
24:        /*Append the result in img buffer*/
25:           ImgbufferimgBufferresultImg
26:        end if
27:    end for
28:    if detection Mode off then
29:        break;
30:    end if
31: end while