晓木虫
学术数据库客户端

matlab图像数据的批处理cutting

 找回密码
 注册会员

QQ登录

微信登录

matlab图像数据的批处理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
好东西一定要看看!
谢谢您的分享!
以后多分享一些这样的有价值的帖子啊
以后多分享一些这样的有价值的帖子啊
谢谢您的分享!
论坛有你更精彩!
好东西一定要看看!
以后多分享一些这样的有价值的帖子啊
论坛有你更精彩!
论坛有你更精彩!
论坛有你更精彩!
论坛有你更精彩!
谢谢您的分享!
好东西一定要看看!
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则  | 请遵守晓木虫管理条例,不得违反国家法律法规

返回顶部