matlab 截屏代码解释 谢谢谢!!每句的大概含义 15
Img=imread('d:\8.jpg');figure,imshow(uint8(Img));seed_windows=getrect;start_y=round(s...
Img=imread('d:\8.jpg');
figure,imshow(uint8(Img));
seed_windows=getrect;
start_y=round(seed_windows(1));
start_x=round(seed_windows(2));
sub_win_width=round(seed_windows(3));
sub_win_high=round(seed_windows(4));
new_image=zeros(sub_win_high,sub_win_width);
for i=start_x:start_x+sub_win_high
for j=start_y:start_y+sub_win_width
new_image(i-start_x+1,j-start_y+1)=Img(i,j);
end
end 展开
figure,imshow(uint8(Img));
seed_windows=getrect;
start_y=round(seed_windows(1));
start_x=round(seed_windows(2));
sub_win_width=round(seed_windows(3));
sub_win_high=round(seed_windows(4));
new_image=zeros(sub_win_high,sub_win_width);
for i=start_x:start_x+sub_win_high
for j=start_y:start_y+sub_win_width
new_image(i-start_x+1,j-start_y+1)=Img(i,j);
end
end 展开
展开全部
Img=imread('d:\8.jpg');%读取图片
figure,imshow(Img);%显示图片
%figure,imshow(uint8(Img));
seed_windows=getrect;%用鼠标取两点,形成矩形,输出4个角点坐标
start_y=round(seed_windows(1));%获取左上角起点y坐标
start_x=round(seed_windows(2));%获取左上角起点x坐标
sub_win_width=round(seed_windows(3));%获取从起点算起的宽度
sub_win_high=round(seed_windows(4));%获取从起点算起的高度
new_image=zeros(sub_win_high,sub_win_width);%预留空间
for i=start_x:start_x+sub_win_high
for j=start_y:start_y+sub_win_width
new_image(i-start_x+1,j-start_y+1)=Img(i,j);%形成新图片
end
end
figure,imshow(new_image)%显示新图片
figure,imshow(Img);%显示图片
%figure,imshow(uint8(Img));
seed_windows=getrect;%用鼠标取两点,形成矩形,输出4个角点坐标
start_y=round(seed_windows(1));%获取左上角起点y坐标
start_x=round(seed_windows(2));%获取左上角起点x坐标
sub_win_width=round(seed_windows(3));%获取从起点算起的宽度
sub_win_high=round(seed_windows(4));%获取从起点算起的高度
new_image=zeros(sub_win_high,sub_win_width);%预留空间
for i=start_x:start_x+sub_win_high
for j=start_y:start_y+sub_win_width
new_image(i-start_x+1,j-start_y+1)=Img(i,j);%形成新图片
end
end
figure,imshow(new_image)%显示新图片
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询