halcon-直方圖均衡

KKK5發表於2019-09-28
****對影像進行線性灰度變換*******
 
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
 
***********************************************************************
*計算影像的灰度值分佈
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)

————————————————
版權宣告:本文為CSDN博主「德鵬君」的原創文章,遵循 CC 4.0 BY-SA 版權協議,轉載請附上原文出處連結及本宣告。
原文連結:https://blog.csdn.net/cuhinzozfi/article/details/90678510

相關文章