|
Algorithm 1 The algorithm for CS sampling with multiple MRs in the proposed MRCS |
|
Input: A natural image of with channels, and k measurement matrices such as generated with a higher measurement rate and generated with a lower measurement rate. |
|
Output: The results of half-precision CS measurement
|
-
1:
Detect the bounding boxes of n target objects (e.g., persons, bicycles and cars) with the proposed object detector MYOLO3. The bounding box is denoted as , where and declare the coordinates of its top-left corner, and declare its width and height respectively.
-
2:
Divide the input image into patches of size without overlap, and get image patches.
-
3:
Declare a matrix as the identifier of the divided image patches. The initial values of the elements of are set as 0.
-
4:
while There are detected bounding boxes to be identified in the 1-th channel, i.e.,
do
-
5:
Compute the starting indexes and for the j-th image patch, i.e., and ;
-
6:
Compute the ending indexes and for the j-th image patch, i.e., and ;
-
7:
while
and
do
-
8:
while
and
do
-
9:
;
-
10:
;
-
11:
end while
-
12:
;
-
13:
end while
-
14:
j = j+1;
-
15:
end while
-
16:
while There are channels to be sampled, i.e.,
do
-
17:
while
do
-
18:
while
do
-
19:
Denote the pixels of the image patch identified with in the i-th channel as ;
-
20:
if
then
-
21:
Sample the image patch with , i.e., ;
-
22:
else
-
23:
Sample the image patch with , i.e., ;
-
24:
end if
-
25:
;
-
26:
end while
-
27:
;
-
28:
end while
-
29:
Concatenate all CS measurements sampled with and respectively, represent the values with 16-bit half-precision floats, and then obtain the half-precision CS measurement for the i-th channel;
-
30:
;
-
31:
end while
-
32:
Combine sampled with multiple MRs in each channel and then obtain the final half-precision CS measurement .
|