Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#1 |
高级会员
注册日期: 2019-11-21
帖子: 3,006
声望力: 66 ![]() |
![]() First, apologies for my description. I don't know the matrix semantics related to this type of operation so I cannot even begin to know how to search for it. In matlab, I have a matrix A:
That I would like to transform to become something like B:
Where the 1's correspond to row-col locations with 1's in the 5 positions above and to the right AND [there is a single 1 either to the left or below OR both left and below positions are zero]. I can see how this might doable by iterating through each position in A, but this may be slow for very large matrices. I was wondering if there is a filter2 or xcorr2 based approach in matlab that might be faster? I tried both with various kernel matrices on a padded version of A (1-padded above and to the right, 0-padded left and below) but can't come to a definitive answer. More answer... |
![]() |
![]() |