基于Matlab的图像分块处理

标签:
matlab图像分块 |
分类: 技术文章 |
lyqmath
http://blog.sina.com.cn/lyqmath
简介
在图像处理中,图像块操作是常用的操作之一。这里介绍一种分块方法。
实例
clc; clear all; close all;
A = imread('cameraman.tif');
info = imfinfo('cameraman.tif');
wd = info.Width;
hd = info.Height;
num = 8;
sub_wd = wd / num;
sub_hd = hd / num;
if ndims(A) == 3
else
end
B=im2double(B);
C=mat2cell(B, num*ones(1, sub_wd), num*ones(1, sub_hd));
D=reshape(C,1,[]);
for k = 1 : length(D)
end
%把像素转化为1列64行的矩阵
----------------------------------------------------------------------------
clc; clear all; close all;
I = imread('cameraman.tif');
sz = size(I);
[x, y] = meshgrid(1:15:sz(2), 1:15:sz(1));
z = ones(size(x));
figure('units', 'normalized', 'position', [0 0 1 1], ...
imshow(I, []);
hold on; axis off;
mesh(x, y, z, 'FaceColor', 'none', ...
结果
http://s1/middle/72586626ga3c44a36e690&690