1):安装halocn包:pip install mvtec-halcon==20111
2):导入halcon包。一般使用import halcon as ha
3):根据官方示例:
下面的代码使用framegrabber获取图像序列的第一个图像,并以一种特定的方式显示该图
framegrabber = ha.open_framegrabber(
name='File',
horizontal_resolution=1,
vertical_resolution=1,
image_width=0,
image_height=0,
start_row=0,
start_column=0,
field='default',
bits_per_channel=-1,
color_space='default',
generic=-1,
external_trigger='default',
camera_type='board/board.seq',
device='default',
port=1,
line_in=