图像切割matlab程序
2018-03-28 16:28
232 查看
clc; clear all; [pathname,filename] = uigetfile('*.*','选择图片','E:\裂纹\NG2裂纹\'); src_path =strcat(filename,pathname) ; dst_path = 'E:\学习资料\MATLAB程序\裂纹分割\'; if ~exist('E:\学习资料\MATLAB程序\裂纹分割\') mkdir('E:\学习资料\MATLAB程序\裂纹分割\'); end A = imread(src_path); figure; imshow(A); [m,n,l] = size(A); a = 8; figure; for i = 1:a for j = 1:a m_start = 1+ (i-1)*fix(m/a); m_end = i*fix(m/a); n_start = 1+ (j-1)*fix(m/a) ; n_end = j*fix(n/a); AA = A(m_start:m_end,n_start:n_end,:); imwrite(AA,[dst_path num2str(i) '_' num2str(j) '.jpg'],'jpg'); subplot(8,8,(i-1)*8+j); imshow(AA); hold on; end end
原图:
相关文章推荐
- MATLAB图像增强程序举例
- 小波图像重构 Matlab 程序 - V3.0版
- Matlab实现图像切割
- matlab练习程序(图像旋转,双线性插值)
- 【转】matlab练习程序(奇异值分解压缩图像)
- matlab 实践程序8——将指定的图像移动到另一个文件夹
- MatlabGUI图像界面入门程序——加法界面
- matlab练习程序(图像傅里叶变换,幅度谱,相位谱)
- matlab练习程序(TV模型图像修复)
- 基于SIFT点特征匹配的图像配准MATLAB程序
- 【转】 直方图规范化用于图像增强 matlab程序
- 一个很好的Matlab图像边缘检测程序
- matlab练习程序(图像马赛克)
- 基于MATLAB的图像自适应阈值分割程序
- matlab练习程序(模糊集图像增强)
- matlab图像缩放程序
- MATLAB双目标定——棋盘格左右图像自动保存MATLAB程序
- matlab图像处理程序大集合
- matlab练习程序(图像水平/竖直移动)
- 【转】 MATLAB图像增强程序举例