Halcon判断一个点是否在某个区域
2017-10-12 17:08
411 查看
* Index of all regions containing a given pixel * read_image (Image, 'fabrik') dev_close_window () dev_open_window (0, 0, 512, 512, 'black', WindowID) dev_set_color ('white') dev_set_draw ('fill') * Segment an image using regiongrowing regiongrowing (Image, Regions, 1, 1, 3, 400) Button := 1 dev_set_color ('red') while (Button == 1) * Click with the mouse on the region to be selected * Quit the loop with the right mouse button get_mbutton (WindowID, Row, Column, Button) get_region_index (Regions, Row, Column, Index) if (Index != []) select_obj (Regions, ObjectSelected, Index) endif endwhile
* * This example program shows how to use select_xld_point. * * Color code: * red - test point * white - contours, selected * dim gray - contours, not selected * * * dev_close_window () dev_open_window (0, 0, 512, 512, 'black', WindowHandle) * * * PointRow := 100.0 PointCol := 100.0 gen_contour_polygon_xld (Contours, [50,50,150,150,50], [50,150,150,50,50]) gen_contour_polygon_xld (Contour2, [50,50,150,150,50], [200,300,300,200,200]) concat_obj (Contours, Contour2, Contours) select_xld_point (Contours, SelectedContours, PointRow, PointCol) gen_cross_contour_xld (Cross, PointRow, PointCol, 6, 0.785398) dev_clear_window () dev_set_color ('dim gray') dev_display (Contours) dev_set_color ('white') dev_display (SelectedContours) dev_set_color ('red') dev_display (Cross) stop () * * * * Contours that are not closed will be closed automatically. * Therefore, the selection for the open contours is exactly * the same as in the previous example. * PointRow := 100.0 PointCol := 100.0 gen_contour_polygon_xld (Contours, [50,50,150,150], [50,150,150,50]) gen_contour_polygon_xld (Contour2, [50,50,150,150], [200,300,300,200]) concat_obj (Contours, Contour2, Contours) select_xld_point (Contours, SelectedContours, PointRow, PointCol) gen_cross_contour_xld (Cross, PointRow, PointCol, 6, 0.785398) dev_clear_window () dev_set_color ('dim gray') dev_display (Contours) dev_set_color ('white') dev_display (SelectedContours) dev_set_color ('red') dev_display (Cross) stop () * * * * Intersecting line segments may cause holes in a polygon. Note that * line segments in real world applications will practically never intersect. * PointRow := 200.0 PointCol := 200.0 gen_contour_polygon_xld (Contours, [50,50,250,250,150,150,350,350,50], [50,250,250,150,150,350,350,50,50]) select_xld_point (Contours, SelectedContours, PointRow, PointCol) gen_cross_contour_xld (Cross, PointRow, PointCol, 6, 0.785398) dev_clear_window () dev_set_color ('dim gray') dev_display (Contours) dev_set_color ('white') dev_display (SelectedContours) dev_set_color ('red') dev_display (Cross) stop () * * * * Points lying directly on one of the contour's line segments * cannot be classified reliably. * PointRow := 200.0 PointCol := 200.0 gen_contour_polygon_xld (Contours, [150,150,250,250,150], [100,200,200,100,100]) gen_contour_polygon_xld (Contour2, [100,100,200,200,100], [150,250,250,150,150]) concat_obj (Contours, Contour2, Contours) gen_contour_polygon_xld (Contour3, [150,150,250,250,150], [200,300,300,200,200]) concat_obj (Contours, Contour3, Contours) gen_contour_polygon_xld (Contour4, [200,200,300,300,200], [150,250,250,150,150]) concat_obj (Contours, Contour4, Contours) select_xld_point (Contours, SelectedContours, PointRow, PointCol) gen_cross_contour_xld (Cross, PointRow, PointCol, 6, 0.785398) dev_clear_window () dev_set_color ('dim gray') dev_display (Contours) dev_set_color ('white') dev_display (SelectedContours) dev_set_color ('red') dev_display (Cross)
相关文章推荐
- JAVA判断一个点坐标是否在一个多边形区域内和是否在一个圆形区域内
- 判断一个点是否在指定区域内
- 获取轮廓中心点,并且判断是否在一个矩形区域内
- 判断一个点是否在三角形区域内
- Unity中判断一个点或一张图片是否在另一张图片区域内
- 地图处理方法-判断一个点是否在某个区域内
- 百度地图 判断一个标注点是否在多边形区域里
- 百度地图 判断一个标注点是否在多边形区域里
- iOS判断一个点是否在一个区域内
- 判断一个点是否在多边形区域内
- Java 判断一个点是否在多边形区域内【转】
- 如何判断一个指定的经纬度点是否落在一个多边形区域内?
- 判断一个点是否在某个区域内。百度,高德,腾讯都能用。(php版)
- Matlab如何判断一个点是否落在一个不规则的封闭区域中
- 判断一个点是否在指定区域内
- 判断鼠标是否落在界面中某一个区域内
- 判断一个点是否在多边形区域内
- iOS开发-判断一个点是否在某个区域
- Java 判断一个点是否在多边形区域内
- iOS开发-判断一个点是否在某个区域