User Command Area

The User Command Area (UCA) consists of the bottom two lines of the terminal screen where most interaction with the  tasks  takes place. The user can type task-related commands in the UCA and Hermes can put there task-related prompts.

An important aspect of the prompts is that they are treated in exactly the same way as information typed by the user, i.e. the user can erase or modify a prompt supplied by Hermes as if he typed it himself. Prompts in the UCA are always in the form of a legal complete or partial command.

If there is something wrong with a command, an error message is displayed at the end of the UCA.

The information in the UCA is used as the context for a number of functions of Hermes. E.g. TAB (or CTRL-I) causes the user document of any taskname present in the UCA to be displayed and CTRL-C aborts the task if it is active.

The two lines of the UCA are one logical long line which can be edited using the Hermes command line editing functions.

Prompt `cycling'

Characters  CTRL-T  and  SPACE  are somewhat special.  CTRL-T  erases the UCA and then prompts with the name of an active task. It does this in a circular fashion so if more than one task is active, another taskname is displayed when  CTRL-T  is pressed again.

If the UCA is ``free'', pressing the space bar does a similar thing for tasks waiting for input. This makes it easier for the user to do something else before he supplies the requested input, e.g. run another task which supplies information that helps to give the input. (The UCA is ``free'' when it is empty, or when it only contains an unmodified prompt supplied by Hermes.)

Example:

will become  when SPACE is pressed.

Minimal matching

Hermes can provide `minimal matching' for task names and user input keywords typed in the UCA. This facility can be switched on and off by typing  ESC M . It can also be switched on using the statement  MATCH=ON  in the Hermes  defaults file . If it is on, task names will be completed when a blank or  RETURN  is typed on a command line that only contains an abbreviated task name. Keywords will be completed when ` = ' is typed. If the keyword is ambiguous, Hermes will beep and refuse to accept the keyword; if it is not known, Hermes will also beep but will accept the keyword.

Hermes obtains the taskname and keyword information from the .dc1 documents in $gip_tsk. For this reason minimal matching does not work for tasks which are not installed. Minimal matching only works in the UCA; it is not possible to use abbreviated task names or keywords from COLA or nHermes.

Aborting, suspending and resuming tasks

Tasks can be aborted by typing  CTRL-C  They can be suspended and resumed by typing  CTRL-W  or  CTRL-G . If more than one task is active, the target task's name must be present in the UCA.

Command recall

Previously entered commands can be brought back to the UCA by using the ANSI up-arrow and down-arrow keys. If the user has typed some text in the UCA, only commands which match this text will be brought back. The commands are saved in the text file  HERMES.cmd , so that they are preserved between sessions.

Task control summary

CTRL-C
abort task
CTRL-G
suspend or resume task (synonym of  CTRL-W)
CTRL-I
(= TAB) activate or deactivate  help display
CTRL-W
suspend or resume task (synonym of  CTRL-G)
ESC D
change  working directory
ESC K
activate and deactivate  input parameter monitoring
ESC E
edit parameters or user-specified file
ESC W
save displayed parameters in (default) file
ESC R
save contents of keyword in (recall) file
ESC S
activate  menu to modify task context
ESC T
change  task path
ESC TAB
switch user input  keyword help display on or off

See also:

Overview of all  Escape Sequences and Control Keys
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
你可以参考以下代码实现GUI界面,显示质心坐标: ```matlab function varargout = centroid_gui(varargin) % CENTROID_GUI MATLAB code for centroid_gui.fig % CENTROID_GUI, by itself, creates a new CENTROID_GUI or raises the existing % singleton*. % % H = CENTROID_GUI returns the handle to a new CENTROID_GUI or the handle to % the existing singleton*. % % CENTROID_GUI('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in CENTROID_GUI.M with the given input arguments. % % CENTROID_GUI('Property','Value',...) creates a new CENTROID_GUI or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before centroid_gui_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to centroid_gui_OpeningFcn via varargin. % % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one % instance to run (singleton)". % % See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help centroid_gui % Last Modified by GUIDE v2.5 29-Jun-2021 11:59:01 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @centroid_gui_OpeningFcn, ... 'gui_OutputFcn', @centroid_gui_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else gui_mainfcn(gui_State, varargin{:}); end % End initialization code - DO NOT EDIT % --- Executes just before centroid_gui is made visible. function centroid_gui_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to centroid_gui (see VARARGIN) % Choose default command line output for centroid_gui handles.output = hObject; % Update handles structure guidata(hObject, handles); % UIWAIT makes centroid_gui wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = centroid_gui_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout{1} = handles.output; % --- Executes on button press in start_btn. function start_btn_Callback(hObject, eventdata, handles) % hObject handle to start_btn (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) load ('6mm_matlab.mat'); % 相机标定基本参数 M = cameraParams.IntrinsicMatrix'; R = cameraParams.RotationMatrices(:,:,1); T = cameraParams.TranslationVectors(1,:)'; v = VideoReader('shoujilux7.mp4'); while hasFrame(v) frame = readFrame(v); gray_frame = rgb2gray(frame); % gamma校正 gamma = 1.5; gamma_corrected = imadjust(gray_frame,[],[],gamma); % 高斯滤波 sigma = 1; hsize = ceil(6*sigma); h = fspecial('gaussian', hsize, sigma); filtered_frame = imfilter(gamma_corrected, h); % Otsu阈值分割 T = graythresh(filtered_frame); [m, n] = size(filtered_frame); E = bwareaopen(im2bw(filtered_frame, T), round(m*n/1000), 8); % Canny边缘检测 canny_edge = edge(E, 'canny'); % 形态学膨胀 se = strel('disk', 2); dilated_edge = imdilate(canny_edge, se); % 连通域分析 stats = regionprops('table', dilated_edge, 'Area', 'Centroid'); % 筛选面积最大的连通区域 [~, idx] = max(stats.Area); centroid = stats.Centroid(idx, :); % 将质心坐标显示在GUI中 d = 100; % 假设质心到相机的距离为100mm pixel_coord = [centroid(1); centroid(2); 1]; world_coord = inv(M) * pixel_coord * d; set(handles.coord_text, 'String', ['x: ', num2str(world_coord(1)), ' y: ', num2str(world_coord(2)), ' z: ', num2str(world_coord(3))]); % 显示帧和质心 axes(handles.video_axes); imshow(frame); hold on; plot(centroid(1), centroid(2), 'r+', 'MarkerSize', 10); hold off; drawnow; end % --- Executes on button press in stop_btn. function stop_btn_Callback(hObject, eventdata, handles) % hObject handle to stop_btn (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Stop the video set(handles.coord_text, 'String', ''); axes(handles.video_axes); cla; % --- Executes when user attempts to close figure1. function figure1_CloseRequestFcn(hObject, eventdata, handles) % hObject handle to figure1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Stop the video and delete the GUI stop_btn_Callback(handles.stop_btn, eventdata, handles); delete(hObject); ``` 然后在GUIDE中创建一个新的GUI,将上面的代码复制到.m文件中,并在GUI中添加一个Axes(用于显示视频)和一个Static Text(用于显示坐标)。最后将按钮的回调函数链接到相应的.m文件中的函数即可。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值