本文主要介绍Halcon转OpenCV实例--保险丝颜色识别(附源码)。
实例来源
实例来源于Halcon例程color_fuses.hdev--classify fuses by color
下面是Halcon实例代码和实现效果:
* color_fuses.hdev: classify fuses by color
dev_update_window ('off')
* ****
* step: set up fuse properties and hue ranges
* ****
FuseColors := ['Orange','Red','Blue','Yellow','Green']
FuseTypes := [5,10,15,20,30]
* HueRanges: Orange 10-30, Red 0-10...
HueRanges := [10,30,0,10,125,162,30,64,96,128]
Count := 0
dev_close_window ()
dev_open_window (0, 0, 800, 600, 'black', WH)
while (Count <= 4)
* ****
* step: acquire image
* ****
read_image (Image, 'color/color_fuses_0' + Count)