zoukankan      html  css  js  c++  java
  • Image acquisition

                                                                halcon打开USB摄像头
     
    本人用的大街上卖的那种傻瓜式USB摄像头
     
    基本步骤
     
     
     

    dev_update_window('off')

    set_system ('do_low_error', 'true')

    close_all_framegrabbers()

    AcqName :='DirectShow'

    open_framegrabber (AcqName, 1, 1, 0, 0, 0, 0, 'default', -1, 'rgb',\
                       -1, 'false', 'default', 'default', -1, -1, AcqHandle)

    grab_image(Image,AcqHandle)

    get_image_size(Image,Width,Height)

    dev_close_window()

    dev_open_window(0,0,Width,Height,'black',WindowHandle)

    Button :=0

    *Button 不等于1
    while(Button # 1)   
        grab_image(Image,AcqHandle)
        dev_display(Image)
        wait_seconds(0.03)
        *按鼠标左键 button 等于 1
        dev_set_window (WindowHandle)
        *If Mode is set to '~give_error', the error will be 
        *ignored and the program continues with the next operator
        dev_set_check ('~give_error')
        get_mposition(WindowHandle,Row,Column,Button)
        dev_set_check ('give_error')
    endwhile





  • 相关阅读:
    SDN作业(4)
    SDN作业(3)
    第一次个人编程作业
    SDN作业(2)
    SDN作业(1)
    第一次博客作业
    浅谈闭包
    预编译And作用域链
    定时器
    window事件
  • 原文地址:https://www.cnblogs.com/xiaomaLV2/p/2530645.html
Copyright © 2011-2022 走看看