直⽅图及直⽅图均衡化--halcon
****对图像进⾏线性灰度变换*******
dev_clear_window ()
dev_close_window ()
read_image (Image, 'C:/Users/Public/Documents/MVTec/HALCON-18.11-Steady/examples/images/lcd/tft_cells_01.png') get_image_size (Image, Width, Height)
dev_open_window (0, 0, Width, Height, 'black', WindowHandle)
dev_display (Image)
*灰度转化
rgb1_to_gray (Image, GrayImage)
GrayImage_1:= GrayImage
***********************************************************************
*计算图像的灰度值分布
absolute relative
gray_histo (GrayImage, GrayImage, AbsoluteHisto, RelativeHisto)
*获得灰度直⽅图
gen_region_histo (Region, AbsoluteHisto, 255, 255, 1)
***********************************************************************
dev_close_window ()
dev_open_window (0, 0, Width, Height, 'black', WindowHandle)
dev_display (Image)
************************************************************************
*直⽅图均衡化
equ_histo_image (GrayImage_1, ImageEquHisto)
gray_histo (Region, ImageEquHisto, AbsoluteHisto1, RelativeHisto1)
*获得灰度直⽅图
gen_region_histo (Region1, AbsoluteHisto1, 255, 255, 1)
************************************************************************

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。