halcon 保存Region [原创]


记录自己的学习之路.

dev_update_window('off')
dev_close_window ()

read_image (Image0, '1.bmp')
dev_open_window_fit_image (Image0, 0, 0, -1, -1, WindowHandle)
dev_display (Image0)
gen_rectangle2 (ROI_0, 1059.34, 1339.58, rad(39.8205), 1124.66, 275.949)

* dump_window_image (Image1, WindowHandle) 经测试会导致位置错误
reduce_domain (Image0, ROI_0, ImageReduced)
* crop_domain (ImageReduced, ImagePart) 经测试会导致位置错误
write_image (ImageReduced, 'tiff', 0, 'region')

*以下测试
dev_clear_window ()
read_image (Image, '2.bmp')
get_image_size (Image, Width, Height)
read_image (Image_Region, 'region')
get_image_size (Image_Region, Width, Height)
threshold (Image_Region, Regions, 1, 255)

reduce_domain (Image, Regions, ImageReduced)


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM