getview.m
来自「matlab处理图像的一些基本方法。其中有一部分mex程序需要安装编译」· M 代码 · 共 46 行
M
46 行
function [M, coord]=getview(c)% GETVIEW - returns the image submatrix corresponding to the current view.%% [M, COORD] = GETVIEW(C)%% inputs:% C - the current view, a vector of [xmin xmax ymin ymax].% outputs:% M - the returned submatrix of I, the image matrix% COORD - the returned current view.%% Claudio spring of 1995%% Copyright (c) 1995 by Claudio Rivetti and Mark Young% claudio@alice.uoregon.edu, mark@alice.uoregon.edu%global I H Handleimgaxif nargin==0 c=[];endif isempty(c) axes(Handleimgax); c=axis; ss=scansize(H); sl=size(I,1); xoff = xoffset(H); yoff = yoffset(H); c(1:2) = c(1:2) - xoff; c(3:4) = c(3:4) - yoff; c=round(c*sl/ss);endif c(3)<1, c(3)=1;endif c(1)<1, c(1)=1;endif c(4)>sl, c(4)=sl;endif c(2)>sl, c(2)=sl;endM=I(c(3):c(4), c(1):c(2));coord=c;return
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?