How to convert image into overlapping blocks?
2 ビュー (過去 30 日間)
古いコメントを表示
I'm trying to extract overlapping patches (size of patch 257x257) of an image with a 50% overlap. I wrote this code. Not sure what went wrong>
a = i
mread('...');
[row col]=size(a)
for i=1:256:col-123
for j = 1:256:row-123
if j~=1&&i~=1
block=a(j-123:j+123,i-123:i+123)
else
block=a(j:j+123,i:i+123)
end
imshow(block)
end
end
0 件のコメント
回答 (1 件)
Image Analyst
2017 年 4 月 5 日
Assuming you got the 50% overlapping blocks, I'm not sure what you want to do with them. Why not just use blockproc() where you can specify a jumpsize of less than the window size to get overlapping?
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!