【机器视觉】 dev_error_var算子
00. 目錄
文章目錄
- 00. 目錄
- 01. 概述
- 02. 簽名
- 03. 描述
- 04. 注意
- 05. 參數
- 06. 結果
- 07. 附錄
01. 概述
dev_error_var - 定義或取消定義一個錯誤變量。
02. 簽名
dev_error_var( : : ErrorVar, Mode : )
03. 描述
dev_error_var定義一個錯誤變量,它是最后一個算子調用結果狀態的變量。 如果沒有發生錯誤,ErrorVar將會是2(H_MSG_TRUE)。 參數Mode指定是否應使用錯誤變量(1)或不使用(0)。 如果錯誤變量處于激活狀態,每次算子運行完畢后都會更新。 因此,一次算子調用的結果變量在下一次算子的調用之前有效。 該值可以通過將其分配給另一個變量(參見示例)或通過調用dev_error_var(ErrorVar,0)來保存。
原文描述:
dev_error_var defines an error variable, i.e., a variable which contains the result state of the last operator call. ErrorVar will be 2 (H_MSG_TRUE) if no error had occurred. The parameter Mode specifies whether the error variable should be used (1) or not (0). If an error variable is active it will be updated each time an operator execution is finished. Thus a value is only valid until the next call of an operator. The value can be saved by assigning it to another variable (see example) or by calling dev_error_var(ErrorVar,0).
04. 注意
無
05. 參數
ErrorVar (input_control) integer → (integer)
包含錯誤狀態的變量的名稱。
默認值: ‘ErrorVar’
Mode (input_control) integer → (integer)
開啟或關閉錯誤變量。
默認值: 1
列舉值: 0, 1
06. 結果
如果指定參數的值正確,則dev_error_var返回2(H_MSG_TRUE)。 否則會引發異常并返回錯誤代碼。
HDevelop例程
sock_recv.hdev Receive image and tuple data via socket connection
projective_trans_image.hdev Apply projective transformations to an image
get_rectangle_pose_barcode.hdev Estimate 3D pose of bar codes
get_mposition.hdev Query mouse position and button status
error_handling_timeout.hdev Handle grab errors
dev_set_check.hdev Enable/Disable error handling in HDevelop
dev_error_var.hdev Catch errors in HDevelop
cbm_sbm.hdev Compare component-based matching to shape-based matching
cbm_param_visual.hdev Analyze the parameters of component-based matching
cbm_bin_switch.hdev Locate a switch and test its state using component-based matching
3d_position_of_rectangle.hdev Estimate 3D pose of rectangular objects
程序示例
dev_close_window () dev_open_window (0, 0, 512, 512, 'black', WindowHandle) dev_error_var (Error, 1) dev_set_check ('~give_error') FileName := 'wrong_name' read_image (Image, FileName) ReadError := Error if (ReadError != H_MSG_TRUE)write_string (WindowHandle, 'wrong file name: '+FileName) endif07. 附錄
7.1 機器視覺博客匯總
網址:https://dengjin.blog.csdn.net/article/details/116837497
總結
以上是生活随笔為你收集整理的【机器视觉】 dev_error_var算子的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【机器视觉】 dev_clear_obj
- 下一篇: 【机器视觉】 dev_get_excep