在MATLAB中,相機視角與「變焦」功能基本相同,因爲沒有透視失真。視角越小,圖像越有效地被放大,因爲視口被放大以適應數字窗口的大小。
The documentation of 'camva'包括這個例子創建了兩個按鈕來放大/縮小場景:
% Set the range checking in the callback statements to keep
% the values for the camera view angle in the range greater
% than zero and less than 180.
uicontrol('Style','pushbutton',...
'String','Zoom In',...
'Position',[20 20 60 20],...
'Callback','if camva <= 1;return;else;camva(camva-1);end');
uicontrol('Style','pushbutton',...
'String','Zoom Out',...
'Position',[100 20 60 20],...
'Callback','if camva >= 179;return;else;camva(camva+1);end');
% Now create a graph to zoom in and out on:
surf(peaks);
所以,如果你要放大,調整視角。如果您想自動「縮放」以適合整個場景,請設置:
camva('auto');
來源
2010-06-02 16:44:00
sml