halcon 修改影像格式

QuincyYi發表於2024-12-10

dev_open_file_dialog('read_image', 'dir', 'default', Selection)

list_image_files(Selection, 'default', [], ImageFiles)
SaveFolder := Selection+'/ModeFile/'
file_exists (SaveFolder, FileExists)
if (FileExists == 0)
make_dir (SaveFolder)
endif

for DetectImageIndex := 1 to |ImageFiles|-1 by 1
read_image(ho_Image, ImageFiles[DetectImageIndex])

parse_filename (ImageFiles[DetectImageIndex], BaseName, Extension, Directory)
write_image (ho_Image, 'bmp', 0, SaveFolder+BaseName)

endfor

相關文章