找回密码
 注册账号

QQ登录

微信登录

matlab图像数据的批处理cutting

摘要: 这是matlab图像数据的批处理cutting,主要涉及使用imcrop函数,为matlab自带函数,这个函数需要图像的坐标位置,即目标的x和y值,此外还需要cutting大小的长和宽。其中,目 ...
这是matlab图像数据的批处理cutting,主要涉及使用imcrop函数,为matlab自带函数,这个函数需要图像的坐标位置,即目标的x和y值,此外还需要cutting大小的长和宽。其中,目标的x和y值可以通过ginput2函数获得。

folder = 'D:\7-21-simplewaystems1\';
name = 'test.tif';
image_data = imread([folder,name]);
missed_circle=Click(I_missed,;
centers_combination=[ ];
centers_combination=[centers_combination;centers;missed_circle];
n=length(centers_combination);
for i=1:n;
centers_combination(i,3)=30;% wideth of x
centers_combination(i,4)=30; % length of y
end
x1=centers_combination(:,1); % location of x
y1=centers_combination(:,2); % location of y
dx=centers_combination(:,3); % wideth of x
dy=centers_combination(:,4); % length of y
cutting ={}; % building cell
for i=1:length(dx);
cutting{i} =imcrop(image_data,maps,[x1(i,1),y1(i,1),dx(i,1),dy(i,1)]); % location of cutting photos
picName=strcat('stems',num2str(i),'.tif'); % naming the cutted stems
imwrite(cutting{i},picName); % exproting the cutted stems
end

matlab图像数据的批处理cutting
好东西一定要看看!
评论 支持 反对

举报

谢谢您的分享!
评论 支持 反对

举报

以后多分享一些这样的有价值的帖子啊
评论 支持 反对

举报

以后多分享一些这样的有价值的帖子啊
评论 支持 反对

举报

谢谢您的分享!
评论 支持 反对

举报

论坛有你更精彩!
评论 支持 反对

举报

好东西一定要看看!
评论 支持 反对

举报

以后多分享一些这样的有价值的帖子啊
评论 支持 反对

举报

论坛有你更精彩!
评论 支持 反对

举报

论坛有你更精彩!
评论 支持 反对

举报

论坛有你更精彩!
评论 支持 反对

举报

论坛有你更精彩!
评论 支持 反对

举报

谢谢您的分享!
评论 支持 反对

举报

好东西一定要看看!
评论 支持 反对

举报

返回顶部