zoukankan      html  css  js  c++  java
  • halcon 图像路径 写txt

    * Image Acquisition 02: Code generated by Image Acquisition 02
    list_files ('F:/keras-retinanet-master/CSV/JPEGImages', ['files','follow_links'], ImageFiles)
    tuple_regexp_select (ImageFiles, ['\.(tif|tiff|gif|bmp|jpg|jpeg|jp2|png|pcx|pgm|ppm|pbm|xwd|ima|hobj)$','ignore_case'], ImageFiles)


    for Index := 0 to |ImageFiles| - 1 by 1
    read_image (Image, ImageFiles[Index])
    * 分割文件名
    parse_filename(ImageFiles[Index], BaseName, Extension, Directory)
    * Image Acquisition 02: Do something
    threshold(Image, Region, 128, 255)
    dilation_circle(Region, RegionDilation, 20)
    erosion_circle(RegionDilation, RegionErosion, 10)
    connection(RegionErosion, ConnectedRegions)
    select_shape(ConnectedRegions, SelectedRegions, 'area', 'and', 1500, 99999)
    *循环个数
    count_obj(SelectedRegions, Number)
    open_file ('C:/Users/xian/Desktop//scratch.txt', 'append', FileHandle)
    for Index1 := 0 to Number-1 by 1
    select_obj(SelectedRegions, ObjectSelected, Index1+1)
    smallest_rectangle1(ObjectSelected, Row1, Column1, Row2, Column2)
    gen_rectangle1(Rectangle, Row1, Column1, Row2, Column2)
    filename := Directory+BaseName
    string_a := filename+'.bmp'+','+Column1+','+Row1+','+Column2+','+Row2+','+'scratch'
    fwrite_string (FileHandle, string_a)
    fnew_line (FileHandle)

    endfor
    close_file (FileHandle)



    endfor

  • 相关阅读:
    js Math对象
    extjs 获取Dom对象
    easyui validatebox 验证集合
    Ext.Ajax.request与form.submit的用法区别
    js获取url参数值
    【原创】extjs4做的grid,带分页,搜索
    SqlServer2005数据库同步
    【原创】jquery实现动态多组图片切换
    easyui表单数据验证
    对象模型图【OMD】阅读指南
  • 原文地址:https://www.cnblogs.com/love6tao/p/12174526.html
Copyright © 2011-2022 走看看