MATLAB Answers

0

Patch image using mat2tiles and back to original image

Asked by dinial utami on 14 Jul 2019
Latest activity Edited by Image Analyst
on 14 Jul 2019
I used the Mat2tiles function for patching the input image, but how do I combine the patch images back to the original image?
My code is like this.
close all;
clear all;
img = imread('rice.png');
patches = mat2tiles(img,[64,64]);
[m n] = size(patches);
i = m * n;
for j = 1:i
b = patches{j};
figure,imshow(patches{j});
file_B = strcat('F:\IMG',num2str(j),'.png');
imwrite(b,file_B);
end

  0 Comments

Sign in to comment.

0 Answers