Check if nxm block of 1s is inside binary matrix
조회 수: 5(최근 30일)
I have a 90x89 binary matrix (see attached). In short, the 1s are good and 0s are bad. I want a quick way to check and return any nxm blocks of all 1s within the large matrix. For example, I want to find out if there are any 3x6 (n=3, m=6) blocks of all 1s within the binary matrix. If there are, return the row and col for each cell within each block.
편집: Bruno Luong 2018년 10월 5일
[i,j] = find(conv2(MM_bin,ones(3,6),'same')==3*6);
I was testing with MM_bin in your MATFILE file which is an 2D array (a matrix in short) that contains 0/1.
If you test on other array with more dimensions than 2, then it's normal that you get error.