Skip to main content
. 2024 Dec 20;24(24):8139. doi: 10.3390/s24248139
Algorithm 1 Construction of a binary measurement matrix from image maps.
Input: ml×n matrix containing l maps with n=nx·ny pixels
Input: r—vector of length n with random integer values in the range [1,l]
Input: A—a look-up table; (m+1)×m binary matrix, such that D·A is full rank. Here D is finite difference operator that subtracts matrix rows.
Output: Mk×n measurement matrix with rows containing binary patterns with n pixels each
function make patterns(m,r,A)
     Minitializeandfillwithzeros
     p0
     for i=1,l do ▹ Iterate maps
         mii-throwofm i-th map
         for q=1,(m+1) do ▹ Iterate rows of A
            for j=1,m do ▹ Iterate sectors of map mi
                pp+1 ▹ Index of the next sampling pattern
                vwhere((mi=j)and(ri)) ▹ Get indices of all pixels of j-th sector of i-th map
                M(p,v)A(q,j) ▹ Assign binary values to pixels of a sector
            end for
         end for
     end for
     return M˜ ▹ Return the measurement matrix
end function