% 获取小窗口
img = imread('blocksrc1.JPG');
figure;
imshow(img);  
h=imrect;          %运行完这句后,可以在图中框出需要的区域
pos = getPosition(h); %待区域决定后,运行这句就会返回区域的位置和大小
col=round(pos(1)) : round(pos(1)+pos(3));  %根据pos计算行下标
row=round(pos(2)) : round(pos(2) + pos(4));   %根据pos计算列下标
subwin=img(row,col,:);
figure;
imshow(subwin);

 

 

 MATLAB 图片鼠标画框保存

相关文章:

  • 2021-11-27
  • 2021-12-26
  • 2022-12-23
  • 2021-08-05
  • 2022-12-23
  • 2022-01-07
  • 2022-02-08
猜你喜欢
  • 2022-03-08
  • 2021-12-04
  • 2022-02-08
  • 2022-02-08
  • 2021-09-29
  • 2021-09-12
相关资源
相似解决方案