halcon读取多张图片

自定义函数

lib_read_images(OutputImage,Path,ImageNumber)

OutputImage:输出图片

Path:输入图片路径

ImageNumber:图片数量

try
    tuple_split (Path, '.', Substrings)
    tuple_last_n (Substrings, 1, Selected)
    * 
    for i := 1 to ImageNumber by 1
        tuple_regexp_replace (Path, '-1.'+Selected, '-' + i +'.'+Selected, Result)
        read_image (OutputImage.at(i-1), Result)
    endfor
catch (Exception)
endtry
* 
* 
return ()

调用实例:lib_read_images (InputImage, 'D:/Desktop/094327-1.jpg', 12)

猜你喜欢

转载自blog.csdn.net/qq_42711010/article/details/142204974