📄 cutimage.m
字号:
function cimg=cutimage%CUTIMAGE Copy from a specified position in the current image an area, % defined with the mouse, to the global variable CutPaste and % set the same area to a value equal to the mean of the values % of the image.%% Claudio 28 Sept. 1995%%% Copyright (c) 1995 by Claudio Rivetti and Mark Young% claudio@alice.uoregon.edu, mark@alice.uoregon.edu%global H I CutPaste;if nargin>0 error('Too many input arguments.');endif ~isimage setviewmode('TOPVIEW'); showimage;end% rect = [left, bottom, width, height] [cimg, rect]=imcrop;ss=scansize(H);px=size(I,1);rect(1)=rect(1)-xoffset(H);rect(2)=rect(2)-yoffset(H);rect=rect*px/ss;rect=round(rect);value=min(min(I));CutPaste=I(rect(2):rect(2)+rect(4), rect(1):rect(1)+rect(3));setimage(CutPaste*0+value, [rect(1) rect(2)]);set(findobj('tag', 'PASTEITEM'), 'Enable', onoff(~isempty(CutPaste)));if nargout == 1cimg=CutPaste;end return;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -