Skip to main content
. 2019 May 5;19(9):2079. doi: 10.3390/s19092079
Algorithm 1 The algorithm for CS sampling with multiple MRs in the proposed MRCS
Input: A natural image of W×H with c(c1) channels, and k measurement matrices such as Φh generated with a higher measurement rate and Φl generated with a lower measurement rate.
Output: The results of half-precision CS measurement y
  • 1:

    Detect the bounding boxes of n target objects (e.g., persons, bicycles and cars) with the proposed object detector MYOLO3. The bounding box bj(j<n) is denoted as [xj,yj,wj,hj], where xj and yj declare the coordinates of its top-left corner, wj and hj declare its width and height respectively.

  • 2:

    Divide the input image into patches of size 33×33 without overlap, and get wp×hp=ceil((W1)/33+1)×ceil((H1)/33+1) image patches.

  • 3:

    Declare a wp×hp matrix P={pst},pst{0,1} as the identifier of the divided image patches. The initial values of the elements of P are set as 0.

  • 4:

    while There are detected bounding boxes to be identified in the 1-th channel, i.e., j<n do

  • 5:

     Compute the starting indexes sx and sy for the j-th image patch, i.e., sx=ceil(xj/33) and sy=ceil(yj/33);

  • 6:

     Compute the ending indexes ex and ey for the j-th image patch, i.e., ex=ceil((xj+wj)/33) and ey=ceil((yj+hj)/33);

  • 7:

    while ssx and sex do

  • 8:

      while tsy and tey do

  • 9:

       pst=1;

  • 10:

       t=t+1;

  • 11:

      end while

  • 12:

      s=s+1;

  • 13:

    end while

  • 14:

     j = j+1;

  • 15:

    end while

  • 16:

    while There are channels to be sampled, i.e., ic do

  • 17:

    while s<wp do

  • 18:

      while t<hp do

  • 19:

       Denote the pixels of the image patch identified with pst in the i-th channel as xist;

  • 20:

       if pst=1 then

  • 21:

        Sample the image patch xist with Φh, i.e., yihst=Φhxist;

  • 22:

       else

  • 23:

        Sample the image patch xist with Φl, i.e., yilst=Φlxist;

  • 24:

       end if

  • 25:

       t=t+1;

  • 26:

      end while

  • 27:

      s=s+1;

  • 28:

    end while

  • 29:

     Concatenate all CS measurements sampled with Φh and Φl respectively, represent the values with 16-bit half-precision floats, and then obtain the half-precision CS measurement yi=[yih]FP16[yil]FP16 for the i-th channel;

  • 30:

    i=i+1;

  • 31:

    end while

  • 32:

    Combine yi sampled with multiple MRs in each channel and then obtain the final half-precision CS measurement y.