how can convert gridded images to matrix data with MATLAB?

preview_player
Показать описание
In this video, I will show you how to save a gridded image as a matrix in Matlab software, then I will plot it.

#Imageprocessing
#Matlab

clear ; close all ; clc
figure('Color','w') ; imshow(I)

G = double(rgb2gray(I))/255 ;
% imshow(G)

for i = 0 : 49
for j = 0 : 49
M(i+1,j+1) = G(round(49+i*18.08),round(84+j*17.28)) ;
end
end

N = zeros(51,51) ; N(1:50,1:50) = M(1:50,1:50) ;

% figure ; S = imagesc(M) ; colormap('gray') ;

% figure ; Ax1 = axes ; surf(N) ; view(0,90) ; colormap('gray') ; axis('tight') ; Ax1.YDir = 'reverse' ; Ax1.XTick = [] ; Ax1.YTick = [] ;

figure('Color','w') ; Ax2 = axes ; pcolor(N) ; colormap('gray') ; Ax2.YDir = 'reverse' ; Ax2.XTick = [] ; Ax2.YTick = [] ;

For more details, refer to the Telegram channel:

Рекомендации по теме