halcon边缘检测-取背景的连通区域

基本思路:

  1. sobel取前景(边缘)
  2. 阈值分割边缘
  3. 去背景连通区域
  4. 填孔

* Determine the connected components of the background of given regions

read_image (Image, 'fabrik')
* Detect edges
sobel_amp (Image, EdgeAmplitude, 'thin_sum_abs', 3)
threshold (EdgeAmplitude, Edges, 5, 255)
background_seg (Edges, BackgroundRegions)
* Fill up holes in regions based on shape feature 'area'
fill_up_shape (BackgroundRegions, RegionFillUp, 'area', 1, 40)
dev_clear_window ()
dev_set_colored (6)
dev_display (RegionFillUp)

猜你喜欢

转载自blog.csdn.net/qq_29407397/article/details/86472290
今日推荐