patch extraction of an image
5 views (last 30 days)
Show older comments
Pravita Lekshmanan
on 20 Jun 2019
Commented: Pravita Lekshmanan
on 4 Jul 2019
i dont know iwhether my code is right for extraction of patch from the right side of an image.
Here is the code:
figure;
[rowsl, columnsl]=size(iml);
blockSizeR=10;
blockSizeC=10;
% [rowsl, columns1]=size(iml);
% for row = 1 : blockSizeR : rowsl
% for col = 1 : blockSizeC : columns1
% patch(:)= iml(:,columnsl:columnsl-blockSizeC);
% imshow(patch);
% end
% end%
2 Comments
Accepted Answer
KALYAN ACHARJYA
on 20 Jun 2019
Edited: KALYAN ACHARJYA
on 20 Jun 2019
im=imread('new.jpeg');
k=1;
[rows colm]=size(im);
for i=1:10:rows-10
for j=1:10:colm-10
im_sub=im(i:i+9,j:j+9);
subplot(round(rows/10),round(colm/10),k),imshow(im_sub);
k=k+1;
end
end
You can also save the all blocks in structure and call the individual cell struture in later.
im=imread('new.jpeg');
k=1;
im_sub={ };
[rows colm]=size(im);
for i=1:10:rows-10
for j=1:10:colm-10
im_sub{k}=im(i:i+9,j:j+9);
k=k+1;
end
end
Next do the imshow of individual blocks.
5 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!