首页 > 其他 > 详细

Halcon算子翻译——break

时间:2017-11-13 10:46:45      阅读:538      评论:0      收藏:0      [点我收藏+]

名称

break - 结束循环执行或离开一个switch段。

用法

break( : : : )

描述

  break结束最近的for,while,或repeat..until循环。 另外,break语句用于离开switch段,特别是在一个case分支的结尾处。 程序跳出,继续在随后的程序行中执行(The program execution is continued at the program line following the corresponding block.)。

  不在循环或switch段的break语句无效。

案例(HDevelop)

read_image (Image, monkey)
threshold (Image, Region, 160, 180)
connection (Region, Regions)
Number := |Regions|
AllRegionsValid := 1
* check if for all regions area <=30
for i := 1 to Number by 1
  ObjectSelected := Regions[i]
  area_center (ObjectSelected, Area, Row, Column)
  if (Area > 30)
    AllRegionsValid := 0
    break
  endif
endfor

结果

break(作为算子)总是返回2(H_MSG_TRUE)。

备选

continue

See also

for, while, repeat, until, switch, case

模块

Foundation

HDevelop例程

two_camera_calibration.hdev        Perform high precision mosaicking using a special calibration object
switch_case.hdev              Use switch/case statement for a multiway branch
handeye_stationarycam_grasp_nut.hdev     Calculate pose for grasping a nut based on results of hand-eye calibration for a stationary camera
camera_calibration_external.hdev      Measure positions on a caliper rule using camera calibration
3d_matching_clamps.hdev            Recognize 3D objects in images using a 3D DXF model

Halcon算子翻译——break

原文:http://www.cnblogs.com/xhiong/p/7824910.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!