Reputation: 21
W = ones(3);
padded = padarray(W,[1, 1],'symmetric','both');
ASK : dimension = 3x3
after padding = 5x5
can you help me, how to return the dimension back to 3x3 ?
Upvotes: 2
Views: 38
Reputation: 7817
If you padded symmetrically with n
zeros you can just index back using end
:
I_orig = I_padded(n+1:end-n,n+1:end-n);
Upvotes: 2