TW201503057A - Method and device for enhancing partial image contrast of histogram - Google Patents

Method and device for enhancing partial image contrast of histogram Download PDF

Info

Publication number
TW201503057A
TW201503057A TW102124323A TW102124323A TW201503057A TW 201503057 A TW201503057 A TW 201503057A TW 102124323 A TW102124323 A TW 102124323A TW 102124323 A TW102124323 A TW 102124323A TW 201503057 A TW201503057 A TW 201503057A
Authority
TW
Taiwan
Prior art keywords
image
brightness
histogram
area
range
Prior art date
Application number
TW102124323A
Other languages
Chinese (zh)
Other versions
TWI563473B (en
Inventor
Lei Wang
Meng-Ting Wu
Shu-Hao Yeh
Original Assignee
Lei Wang
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lei Wang filed Critical Lei Wang
Priority to TW102124323A priority Critical patent/TW201503057A/en
Publication of TW201503057A publication Critical patent/TW201503057A/en
Application granted granted Critical
Publication of TWI563473B publication Critical patent/TWI563473B/zh

Links

Abstract

This invention relates to a method and a device for enhancing partial image contrast of a histogram. A histogram distribution of a figure or an image is first obtained, and then a brightness range is selected for compressing the grayscale space of an immaterial brightness region of the histogram, such that the pixels of the immaterial brightness region are squeezed to a small range, while the pixels of a material brightness region can obtain a greater brightness grayscale equalization space. Then, a specific histogram stretching contrast enhancement method (HS) or histogram equalization contrast enhancement method (HS) is used to expand the grayscale range of the material block of the figure for obtaining more obvious contrast enhancement and image clarity, so as to solve the problem of figure content distortion caused by unbalanced distribution of brightness grayscale of pixels in other regions of the figure or image when the brightness grayscale of the whole figure or image is partially enhanced.

Description

直方圖局部影像對比增強的方法與裝置Histogram local image contrast enhancement method and device

本發明係一種增強影像對比的裝置,尤指一種擴展局部影像之直方圖範圍以增強影像對比的裝置。The present invention is a device for enhancing image contrast, and more particularly to a device for extending the histogram range of a partial image to enhance image contrast.

現有單張影像(照片)或連續影像(影片)的對比度對於人眼區分該影像質量的好壞佔有相當重要的地位,若拍攝的環境不理想,可能造成所取得影像的對比度不足,產生整體影像表現疲乏的情形,為解決影像對比度不足的問題,各種增強對比度的運算法便應運而生。The contrast of the existing single image (photo) or continuous image (film) plays an important role in distinguishing the quality of the image by the human eye. If the shooting environment is not ideal, the contrast of the obtained image may be insufficient to produce an overall image. In the case of fatigue, in order to solve the problem of insufficient image contrast, various contrast-enhancing algorithms have emerged.

利用對影像對比度的擴張,可使影像在視覺上產生較強烈的感受,進而達到增進影像清晰度的目的。常見的灰階直方圖(Histogram)其灰階(Gray)級的函數是反應影像中像素在每種灰階級出現的次數。如圖1的所示的原始影像,圖2是圖1之原始影像的灰階直方圖統計結果,其中該灰階直方圖的橫座標是灰階級,縱座標是該灰階級出現的像素個數,從圖2的灰階直方圖中可知圖1中的像素大部分是座落於灰階級20至200之間,因此,該灰階直方圖的標示方法是影像最基本的統計特徵。而影像對比增強的原理,是藉由拓展相鄰像素其直方圖之間的對比,使人眼在視覺上能夠感知到更多的影像細節紋理以及邊緣部份。By using the expansion of the contrast of the image, the image can be visually more strongly felt, thereby achieving the purpose of enhancing the sharpness of the image. The common gray-scale histogram (Histogram) function is the number of times the pixels in the reaction image appear in each gray level. As shown in the original image shown in FIG. 1, FIG. 2 is a gray-scale histogram statistical result of the original image of FIG. 1, wherein the horizontal coordinate of the gray-scale histogram is a gray level, and the ordinate is the number of pixels in the gray level. It can be seen from the gray-scale histogram of FIG. 2 that most of the pixels in FIG. 1 are located between the gray levels 20 to 200. Therefore, the gray-scale histogram is marked as the most basic statistical feature of the image. The principle of image contrast enhancement is to make the human eye visually perceive more image detail texture and edge parts by expanding the contrast between adjacent histograms.

現有以影像之直方圖為對比增強處理基礎的影像對比增強技術主要分成兩個類別,分別是直方圖展伸對比增強法(Histogram StretchingBased Methods)以及直方圖均衡對比增強法(Histogram EqualizationBased Methods)的影像對比增強技術,其技術內容分別說明如下。The existing image contrast enhancement techniques based on the histogram of the contrast enhancement processing are mainly divided into two categories, namely Histogram StretchingBased Methods and Histogram EqualizationBased Methods. The contrast enhancement technology, its technical content is explained as follows.

直方圖展伸對比增強法(Histogram StretchingBased Methods)是利用原始影像直方圖以其全域性灰階範圍,重新拉伸分配其新的影像直方圖分佈,其中較著名的方法有Histogram Stretching (HS)以及Improved Histogram Stretching method (IHS)等技術,此類技術的優點在於僅只是對原直方圖的灰階分佈做拉伸而不會改變原圖像的亮度分佈曲線,因而演算法較簡單且不會改變各像素的亮度差異關係,不會產生圖像失真的情況;然而因大部份圖像之直方圖在亮度灰階值範圍內很少有一整段亮度區域均無像素分佈的情況,因而此法往往因此而找不到可供拉伸的亮度範圍而無法產生效果。Histogram StretchingBased Methods use the original image histogram to re-stretch its new image histogram distribution with its global grayscale range. The most famous method is Histogram Stretching (HS). Improved Histogram Stretching method (IHS) and other techniques. The advantage of this technique is that it only stretches the gray scale distribution of the original histogram without changing the brightness distribution curve of the original image, so the algorithm is simpler and does not change. The difference in brightness of each pixel does not cause image distortion; however, since the histogram of most images has little pixel area in the luminance grayscale value range, there is no pixel distribution. Often, the range of brightness that can be stretched is not found and no effect can be produced.

前述HS方法利用原始影像之灰階值做直方圖分析,之後將其直方圖拉伸擴展至全動態區域,如圖3至5所示,圖3所示為原始的直方圖,圖4為將圖3的直方圖減去最小值(0至130),圖5為圖4之刪減後的直方圖透過HS方法後,產生擴展的直方圖。該HS方法適合使用直方圖集中的影像,利用方程式(1)獲得新的輸出像素值,其中該數值255為在8-bit輸入影像的最大亮度值。【數1】 The HS method uses the grayscale value of the original image as a histogram analysis, and then stretches its histogram to the full dynamic region, as shown in Figures 3 to 5. Figure 3 shows the original histogram, and Figure 4 shows The histogram of FIG. 3 is subtracted from the minimum value (0 to 130), and FIG. 5 is the histogram of FIG. 4 after the reduced histogram is transmitted through the HS method, and an extended histogram is generated. The HS method is suitable for using an image in a histogram set, and a new output pixel value is obtained using Equation (1), wherein the value 255 is the maximum brightness value of the 8-bit input image. [Number 1]

基於HS方法,Hee-Chul Kim提出IHS方法,可應用於實現在硬體上影像處理的方法,由方程式(2)表示:【數2】此IHS方法是經由權重參數M(Multiple)及US (User Select)來決定擴展直方圖之強度而取得輸出影像的像素值,權重參數M的值決定主要的擴展強度,權重參數US為使用者設定參數,主要在微調該權重參數M的強度,該IHS方法改良了原有HS會有除法公式的產生,其優點為更容易在硬體上實現。Based on the HS method, Hee-Chul Kim proposed the IHS method, which can be applied to the method of image processing on hardware, which is represented by equation (2): [Number 2] In the IHS method, the intensity of the extended histogram is determined by the weight parameters M(Multiple) and US (User Select) to obtain the pixel value of the output image. The value of the weight parameter M determines the main expansion strength, and the weight parameter US is set by the user. The parameter is mainly to fine-tune the intensity of the weight parameter M. The IHS method improves the original HS to have a division formula, which has the advantage that it is easier to implement on a hardware.

直方圖均衡對比增強法(Histogram EqualizationBased Methods)主要是對原始影像直方圖進行非線性的拉伸,並重新分配影像像素值,使原始影像的直方圖呈均衡性的直方圖分佈。HE方法由於可產生較平均的亮度分佈,使影像在表現上顯得較自然,因此目前在影像對比增強是普遍被應用的技術,這種方法通常用來增加許多影像的全域性對比強度。首先,定義一原始影像為X,該原始影像的總像素數為N,而影像灰階範圍設定為[0,L-1],L代表影像像素最大的灰階值。其機率密度函數(Probability Density Function, PDF)定義如方程式(3):【數3】上述k代表的是灰階級,代表該灰階級上出現的像素個數。圖6為透過PDF計算後的統計結果。而累積密度函數(Cumulative Density Function,CDF)則是根據PDF進行累進的計算,如方程式(4)所示:【數4】而CDF統計的結果,如圖7所示,其累進結果的最大值將等於1;最後透過影像的轉換函數,如方程式(5)所示,【數5】進行直方圖均衡化轉換處理以得到一個對比增強後的影像。如圖8所示,經HE方法處理後,對應的新直方圖分佈是呈0~L-1之間全域性均衡的拓展。Histogram EqualizationBased Methods are mainly used to nonlinearly stretch the original image histogram and redistribute the image pixel values so that the original image histogram is a balanced histogram distribution. The HE method is more commonly used because it produces a more uniform brightness distribution, so image contrast enhancement is currently widely used. This method is often used to increase the global contrast strength of many images. First, an original image is defined as X, the total number of pixels of the original image is N, and the grayscale range of the image is set to [0, L-1], and L represents the largest grayscale value of the image pixel. The Probability Density Function (PDF) is defined as Equation (3): [Number 3] The above k represents the gray class, Represents the number of pixels that appear on the gray level. Figure 6 shows the statistical results after calculation by PDF. The Cumulative Density Function (CDF) is a progressive calculation based on PDF, as shown in equation (4): [Number 4] The result of CDF statistics, as shown in Figure 7, the maximum value of the progressive result will be equal to 1; finally the transfer function through the image, as shown in equation (5), [5] A histogram equalization conversion process is performed to obtain a contrast-enhanced image. As shown in FIG. 8 , after the HE method, the corresponding new histogram distribution is an extension of the global equilibrium between 0 and L-1.

由於HE方法具有直接而簡單的特性,基於HE方法的對比增強改良法在近年來已經陸續發表了許多改良的技術,以BBHE方法為其中一類技術代表說明:首先BBHE 利用原始輸入影像之直方圖根據平均亮度值(Xm)劃分為兩個子直方圖(Sub-Histogram)區域,之後針對這兩區域分別做直方圖均衡化處理,如圖9所示。類似的方法有DSIHE 和SSTHE,同樣也是透過平均亮度或是中間值亮度對直方圖做切割,之後對各子直方圖做個別直方圖均衡化處理。Due to the direct and simple characteristics of the HE method, the contrast enhancement method based on the HE method has been published in recent years. Many improved techniques have been published in recent years. The BBHE method is used as a representative of one of the technical representatives: First, the BBHE uses the histogram of the original input image. The average luminance value (Xm) is divided into two sub-Histogram regions, and then the histogram equalization processing is performed for the two regions, as shown in FIG. Similar methods are DSIHE and SSTHE. The histogram is also cut by the average brightness or the intermediate brightness, and then the individual histogram equalization is performed on each sub-histogram.

另一類方法是結合考慮像素點位置和其像素點灰階級之間的關聯性,以達到對比增強的效果,以Contrast limited adaptivehistogram equalization method(CLAHE)為例,其實現的步驟如下:(1) 分區塊(Block):將輸入影像劃分大小相等的不重疊子區塊,每個子區塊含有的總像素數設定為M。子區塊設定的範圍愈大,其對比增強的效果愈明顯,但是卻容易產生影像細節容易遺失的情形。(2) 計算直方圖:表示子區塊的直方圖,k代表灰階級,其灰階級的設定範圍為0~L-1,其中L 表示可能出現的灰階級數。(3) 計算限制等級:利用方程式(6)計算限制等級(Restrained Level),式中稱作最大斜率,透過設定可決定對比增強的幅度,其值設定的範圍為1~4之間的整數;稱為限制級係數,其值設定的範圍為0~100之間。當等於0時,取最小值;當等於100時,取最大值,此時對應的對比拉伸效果最明顯。【數6】(4)像素點重新分配:根據上一步驟,對每個子區塊,使用相對應的限制等級參數對 子區塊的直方圖進行限制剪切,接下來將剪切下來的像素數目重新分配至子區塊的直方圖的灰階級中,直到所有被剪切的像素被分配完畢。(5) 直方圖均衡化處理:像素分配完成的各子區塊的直方圖,根據HE方法個別做直方圖均衡化的處理。(6) 像素灰階級重建計算:根據上一步驟計算每一個子區塊的亮度平均值,將它設定為參考點,採用雙線性內插法(Bilinear Interpolation)的計算方式得到輸出各子區塊內各像素點其新的灰階級。Another method is to consider the correlation between the pixel position and the gray level of its pixel to achieve contrast enhancement. Take the Contrast limited adaptivehistogram equalization method (CLAHE) as an example. The steps are as follows: (1) Partition Block: The input image is divided into non-overlapping sub-blocks of equal size, and the total number of pixels contained in each sub-block is set to M. The larger the range set by the sub-block, the more obvious the effect of contrast enhancement, but it is easy to cause the image details to be easily lost. (2) Calculate the histogram: Represents a histogram of sub-blocks, k represents the gray level, and its gray level is set from 0 to L-1, where L represents the number of gray levels that may appear. (3) Calculate the restriction level : Calculate the Restricted Level using Equation (6), where Maximum slope The setting determines the magnitude of the contrast enhancement, and the value is set in the range of 1 to 4; It is called the limit level coefficient, and its value is set in the range of 0~100. when When it is equal to 0, Minimum value ;when When it is equal to 100, take the maximum value At this time, the corresponding contrast stretching effect is most obvious. [Number 6] (4) Pixel point reallocation: according to the previous step, for each sub-block, use the corresponding The restriction level parameter limits the cut of the histogram of the sub-block, and then redistributes the number of cut pixels into the gray level of the histogram of the sub-block until all the cut pixels are allocated. (5) Histogram equalization processing: a histogram of each sub-block in which the pixel allocation is completed, and the histogram equalization processing is performed individually according to the HE method. (6) Pixel gray-scale reconstruction calculation: Calculate the average value of the brightness of each sub-block according to the previous step, set it as the reference point, and calculate the sub-area by bilinear interpolation (Bilinear Interpolation). Each pixel in the block points its new gray level.

還有一類技術是利用限制或是修改原始影像的PDF的方式以得到新對比增強的影像。以Adaptively increasing the value of histogram (AIVHE)為例:如方程式(7)及(8)所示,AIVHE針對預防圖像過增強而加入一參數以限制PDF的上限,另外根據基準參數搭配可適應性調整參數,透過調整使用者調整參數對原始圖像PDF做修飾外型(Reshape)之動作以取得新的PDF,之後透過HE方法以達到有效地圖像增強對比。AIVHE方法的特點如下:1. AIVHE利用預先設定之限制參數避免輸出會有過增強的視覺效果;2. 透過可適應調整參數使其適應在各種不同圖像上達到對比增強的效果;3. 透過的調整可決定對比拓展的範圍;4. 透過調整,使其對比增強的圖像更趨近於原始圖像亮度。同樣透過修改PDF達到圖像對比增強的方法有BUBO、AMHE和WTHE等方法,其中WTHE針對維持原始圖像平均亮度的能力有增加一亮度正規化的動作,如此可達到在播放動態圖像的時候不致產生不自然的顯示結果。【數7】【數8】 Another type of technique is to use a way to limit or modify the PDF of the original image to obtain a new contrast-enhanced image. Taking Adaptively increasing the value of histogram (AIVHE) as an example: As shown in equations (7) and (8), AIVHE adds a parameter to prevent image over-enhancement. To limit the upper limit of the PDF, in addition to the benchmark parameters Adjustability parameters with adaptability Through adjustment with The user adjusts the parameters to modify the original image PDF to obtain a new PDF, and then uses the HE method to achieve effective image enhancement contrast. The characteristics of the AIVHE method are as follows: 1. AIVHE utilizes preset limit parameters Avoid the output will have an enhanced visual effect; 2. Adjust the parameters through adaptability Adapt it to contrast enhancement on a variety of different images; 3. through Adjustment can determine the scope of the contrast expansion; 4. through adjustment To make the contrast-enhanced image closer to the original image brightness. Similarly, methods for achieving image contrast enhancement by modifying PDF include BUBO, AMHE, and WTHE. Among them, WTHE has an action of increasing the brightness of the original image to increase the brightness of the original image, so that when the dynamic image is played Does not produce unnatural display results. [Number 7] [Number 8]

如前所述,目前各種影像對比增強技術均著眼於將整張圖像按各像素的亮度灰階值做重分配,以取得對比增強之效果;然而考量諸如醫療造影圖像等特殊影像特徵,此類影像的共同特徵為:像素的亮度灰階值明顯分配失衡,如整張醫療圖像有很大一部份均為接近無亮度的暗黑區塊(非醫療診視區),而所欲觀察的重點區域又因均為相同的人體組織而使其像素散佈於很小的一塊灰階範圍內。而攝影機在夜間無明顯光源所攝錄之暗黑畫面,則使整張圖像的絕大部份區域其像素灰階都落於接近無亮度的灰階部份,少數較亮的像素往往還是因解析度不足或線路干擾所形成之雜訊。由於此類圖像由直方圖的分佈而言,可能所有灰階度都有像素分佈但真正需要觀察的像素確是緊密集中於某個區段的灰階度中,因而若以傳統的對比度增強技術處理,即因這些技術都是著眼於整張圖片的所有像素做考量所設計,導致最後的增強效果十分有限且極易造成內容失真的結果。As mentioned above, various image contrast enhancement techniques are currently focused on redistributing the entire image by the grayscale value of each pixel to achieve contrast enhancement; however, special image features such as medical contrast images are considered. The common feature of such images is that the grayscale values of the pixels are obviously out of balance, such as a large part of the entire medical image is close to the dark block without brightness (non-medical diagnostic area), and the desired observation The focus area is also the same body tissue and its pixels are scattered in a small gray scale. The dark picture of the camera that is not recorded by the obvious light source at night makes the pixel gray level of the whole image fall to the gray level near the non-brightness part of the whole image. A few bright pixels are often caused by Noise generated by insufficient resolution or line interference. Since such images are distributed by histograms, it is possible that all grayscales have a pixel distribution, but the pixels that really need to be observed are indeed closely concentrated in the grayscale of a certain segment, so if they are enhanced with the traditional contrast. Technical processing, that is, because these technologies are designed with all the pixels of the whole picture in mind, the final enhancement effect is very limited and the content distortion is easily caused.

如前揭所述,現有影像對比增強技術均著眼於將整張圖像按各像素的亮度灰階值做重分配,對於影像之像素的亮度灰階值明顯分配失衡時,欲局部增強其亮度灰階值,若以現有的對比度增強技術處理易導致其增強效果有限,且造成整張圖像內容失真的的問題,因此本發明主要目的在提供一直方圖局部影像對比增強的方法與裝置,透過選擇亮度範圍的方式,壓縮非重點亮度區域的灰階空間,使非重點亮度區域之像素擠壓到小範圍,而重點亮度區域的像素可取得更大的亮度灰階值均衡化空間,再透過特定的HS或HE等技術,將圖像重點區塊的灰階值範圍的擴大,而取得更明顯的對比增強及影像清晰的效果,解決整張圖像欲局部增強其亮度灰階值,圖像其他區域之像素的亮度灰階值分配失衡而造成整張圖像內容失真的的問題。As mentioned above, the existing image contrast enhancement techniques focus on redistributing the entire image according to the grayscale value of each pixel. When the luminance grayscale value of the pixel of the image is obviously unbalanced, the brightness is locally enhanced. The gray-scale value, if the existing contrast enhancement technology is processed, the effect of the enhancement is limited, and the whole image content is distorted. Therefore, the main purpose of the present invention is to provide a method and apparatus for contrast enhancement of the local image of the histogram. By selecting the brightness range, the gray-scale space of the non-emphasized brightness area is compressed, so that the pixels of the non-emphasized brightness area are squeezed to a small range, and the pixels of the key brightness area can obtain a larger brightness gray level value equalization space, and then Through the specific HS or HE technology, the grayscale value range of the image key block is expanded to obtain more obvious contrast enhancement and image clearness effect, and the entire image is to be locally enhanced to increase its brightness grayscale value. The problem that the luminance grayscale value of the pixels of other areas of the image is unbalanced causes distortion of the entire image content.

為達成前述目的所採取的主要技術手段係令前述直方圖局部影像對比增強裝置,包含有:  一輸入影像轉換模組,其用以輸入一影像並轉換為一YCbCr訊號;  一區域亮度增強模組,其與輸入影像轉換模組電連接,該區域亮度增強模組群依據多數個控制訊號,轉換並產生一調整後的YCbCr訊號;  一輸出影像轉換模組,其與區域亮度增強模組電連接,該輸入影像轉換模組係輸出經區域亮度增強模組調整後的YCbCr訊號;  一影像亮域輸入介面,其與區域亮度增強模組電連接,該影像亮域輸入介面用以選定一個以上欲增強的灰階度範圍(H、L),或輸入一個以上的像素座標(X、Y)及其灰階範圍門檻(Z);  一座標區域亮度分析單元,其與影像亮域輸入介面電連接,該座標區域亮度分析單元依據影像亮域輸入介面之像素座標(X、Y)及灰階範圍門檻(Z)產生一可擴展範圍值(Hnew、Lnew);  一亮域產生器,其分別與輸入影像轉換模組、區域亮度增強模組、座標區域亮度分析單元及影像亮域輸入介面電連接,該亮域產生器根據YCbCr訊號中的明亮度(Y),建立該影像訊號的機率密度函數,影像亮域輸入介面或座標區域亮度分析單元產生的灰階度範圍(H、L),依該可擴展之範圍(Hnew、Lnew)提供區域亮度增強模組進行對比增強處理。The main technical means for achieving the foregoing purpose is to enable the above-mentioned histogram partial image contrast enhancement device, comprising: an input image conversion module for inputting an image and converting it into a YCbCr signal; an area brightness enhancement module The image enhancement module is electrically connected to the input image conversion module, and the brightness enhancement module group converts and generates an adjusted YCbCr signal according to a plurality of control signals; and an output image conversion module electrically connected to the area brightness enhancement module The input image conversion module outputs a YCbCr signal adjusted by the area brightness enhancement module; an image brightness input interface electrically connected to the area brightness enhancement module, wherein the image brightness input interface is used to select more than one Enhanced grayscale range (H, L), or input more than one pixel coordinate (X, Y) and its grayscale range threshold (Z); a standard area brightness analysis unit, which is electrically connected to the image bright input interface The coordinate area brightness analysis unit generates a pixel coordinate (X, Y) and a gray level range threshold (Z) according to the image bright field input interface. a range value (Hnew, Lnew); a bright field generator, which is electrically connected to the input image conversion module, the area brightness enhancement module, the coordinate area brightness analysis unit, and the image bright field input interface, respectively, the bright field generator is The brightness (Y) in the YCbCr signal establishes the probability density function of the image signal, the gray scale range (H, L) generated by the brightness input unit of the image or the brightness analysis unit of the coordinate area, according to the expandable range (Hnew , Lnew) provides a regional brightness enhancement module for contrast enhancement processing.

為達成前述目的所採取的主要技術手段係令前述直方圖局部影像對比增強方法,包含有:  取得一圖像;  統計該圖像之直方圖分佈,將圖像各像素按灰階值區分為重點區域及非重點區域;  對該直方圖分佈之非重點區域進行壓縮,取得足夠的灰階空間以對特定的灰階區域提供該重點區域進行延展性的對比增強;  將此區域灰階級度拉大而提高亮度差異,並增強其區域影像對比,以提高圖像之細節及清晰化。The main technical means adopted to achieve the foregoing objectives is to make the above-mentioned histogram partial image contrast enhancement method, including: obtaining an image; counting the histogram distribution of the image, and distinguishing each pixel of the image into grayscale values. Regional and non-key areas; compress the non-key areas of the histogram distribution to obtain sufficient gray-scale space to provide the contrast enhancement of the key areas for specific gray-scale areas; Improve the brightness difference and enhance the contrast of its regional image to improve the detail and clarity of the image.

利用前述元件組成的直方圖局部影像對比增強裝置,係針對特定的灰階區域進行對比度增強處理,而非增強整張圖像的對比度,因此先找出該圖像的亮度灰階區域,再壓縮其它區域的直方圖區塊,以產生足夠的灰階空間提供重點區域進行延展性的對比增強,使圖像中的重點主體達到更佳的清晰化效果。由於本發明係針對特定用途的影像特徵做重點式的對比增強處理,使用者可利用影像亮域輸入介面選擇不同的作業方法及不同的對比增強方式,並透過確認重點灰階區域及相關參數,達到多功能的應用目的。解決現有技術欲對整張圖像進行局部增強亮度灰階值時,該圖像其他區域之像素的亮度灰階值會因分配失衡而造成整張圖像內容失真的的問題。The histogram partial image contrast enhancement device composed of the foregoing components performs contrast enhancement processing on a specific grayscale region instead of enhancing the contrast of the entire image, so first find out the luminance grayscale region of the image, and then compress The histogram blocks of other regions are used to generate sufficient gray-scale space to provide key areas for contrast enhancement, so that the key subjects in the image can achieve better clarity. Since the present invention performs key contrast enhancement processing for image features of specific purposes, the user can select different working methods and different contrast enhancement modes by using the image bright field input interface, and confirm the key gray scale regions and related parameters. Achieve versatile application purposes. To solve the problem that the prior art wants to locally enhance the luminance grayscale value of the entire image, the luminance grayscale value of the pixels in other regions of the image may cause distortion of the entire image content due to the distribution imbalance.

本發明在建立一直方圖局部影像對比增強裝置,針對醫療影像造影設備與一般監視器在暗黑環境下所攝錄的影像,將該影像輸出至顯示器前先透過硬體進行局部影像對比增強,使最後輸出於顯示器的畫面為經過重點局部影像對比增強的清晰畫面。使用者透過本裝置可選擇兩種作業模式完成特定灰階區域的選定或直接以點選畫面特定位置的方式指定所要增強的畫面區塊,本技術將透過使用者所調定的壓縮/擴展比例,對使用者所選取的灰階區域做灰階擴展的影像清晰化處理:首先統計該圖像之直方圖分佈,再對分佈中兩極端的其它區域的直方圖區塊做壓縮,騰出足夠的灰階空間提供重點區域做延展性的對比增強,將此區域灰階級度拉大也就是亮度差異變大,即可立即增強其區域影像對比,令細節較好準確辨識以達到更好的清晰化效果。由於本裝置以硬體化的電子電路及邏輯電路直製作,具有處理速度快的優點,適合讓使用者一邊觀察影像效果,一邊調整參數或切換操作模式。The invention establishes a histogram partial image contrast enhancement device, and for the image recorded by the medical image contrast device and the general monitor in a dark environment, the partial image contrast enhancement is performed through the hardware before the image is output to the display, so that The final output to the display is a clear picture that has been enhanced with emphasis on the local image. Through the device, the user can select two working modes to complete the selection of a specific grayscale region or directly specify the screen block to be enhanced by clicking a specific position of the screen. The technology will adjust the compression/expansion ratio set by the user. Image sharpening processing for grayscale extension of the grayscale region selected by the user: firstly, the histogram distribution of the image is calculated, and then the histogram block of other regions in the distribution is compressed to make enough The gray-scale space provides contrast enhancement of the key areas, and the gray level of the area is enlarged, that is, the brightness difference becomes larger, and the contrast of the area image can be immediately enhanced, so that the details are better and accurately identified to achieve better clarity. Effect. Since the device is directly fabricated by hardware electronic circuits and logic circuits, it has the advantages of high processing speed, and is suitable for the user to adjust parameters or switch operation modes while observing the image effect.

關於本發明的較佳實施例,請參閱圖10所示,包含有一輸入影像轉換模組10、一區域亮度增強模組20、一輸出影像轉換模組30、一影像亮域輸入介面40、一座標區域亮度分析單元50與一亮域產生器60,其中  該輸入影像轉換模組10用以輸入不同的影像格式(NTSC、PAL、RGB或DVI)並轉換為一YCbCr訊號(YCbCr)。  該區域亮度增強模組20是與輸入影像轉換模組10電連接,該區域亮度增強模組20群設有多個控制訊號(門檻值(H)、門檻值(L)、門檻值(Hnew)、門檻值(Lnew)與灰階範圍門檻(Z)),其依據該等控制訊號轉換前述YCbCr訊號並產生一調整後的YCbCr訊號(NewYCbCr)。  該輸出影像轉換模組30是與區域亮度增強模組20電連接,該輸出影像轉換模組30係輸出經區域亮度增強模組20調整後的YCbCr訊號。  該影像亮域輸入介面40是與區域亮度增強模組20電連接,該影像亮域輸入介面40具有多數個調整參數(門檻值(H)、門檻值(L)、像素座標(X、Y)與灰階範圍門檻(Z)),該影像亮域輸入介面40用以選定欲增強的灰階度範圍門檻值(H、L)、輸入一個以上的像素座標(X、Y)及其灰階範圍門檻(Z);於本較佳實施例中,該灰階度範圍門檻值(H、L)係由一旋鈕或一開關調整其數值。  該座標區域亮度分析單元50是與影像亮域輸入介面40電連接,該座標區域亮度分析單元50依據影像亮域輸入介面40之像素座標(X、Y)及灰階範圍門檻(Z)產生一可擴展範圍值(Hnew、Lnew)。  該亮域產生器60是分別與輸入影像轉換模組10、區域亮度增強模組20、影像亮域輸入介面40及座標區域亮度分析單元50電連接,該亮域產生器60根據輸入影像轉換模組10之YCbCr訊號中的明亮度(Y),建立該影像訊號的機率密度函數(PDF),影像亮域輸入介面40或座標區域亮度分析單元50產生的灰階度範圍門檻值(H、L),依該可擴展之範圍(Hnew、Lnew)提供區域亮度增強模組20進行對比增強處理。A preferred embodiment of the present invention, as shown in FIG. 10, includes an input image conversion module 10, an area brightness enhancement module 20, an output image conversion module 30, an image brightness input interface 40, and a The coordinate area brightness analyzing unit 50 and a bright field generator 60 are configured to input different image formats (NTSC, PAL, RGB or DVI) and convert them into a YCbCr signal (YCbCr). The area brightness enhancement module 20 is electrically connected to the input image conversion module 10, and the area brightness enhancement module 20 group is provided with a plurality of control signals (threshold value (H), threshold value (L), threshold value (Hnew). a threshold value (Lnew) and a grayscale range threshold (Z), which convert the YCbCr signal according to the control signals and generate an adjusted YCbCr signal (NewYCbCr). The output image conversion module 30 is electrically connected to the area brightness enhancement module 20, and the output image conversion module 30 outputs the YCbCr signal adjusted by the area brightness enhancement module 20. The image brightness input interface 40 is electrically connected to the area brightness enhancement module 20, and the image brightness input interface 40 has a plurality of adjustment parameters (threshold value (H), threshold value (L), pixel coordinates (X, Y). And the gray scale range threshold (Z)), the image bright field input interface 40 is used to select the gray scale range threshold value (H, L) to be enhanced, input one or more pixel coordinates (X, Y) and its gray scale Range threshold (Z); In the preferred embodiment, the gray scale range threshold (H, L) is adjusted by a knob or a switch. The coordinate area brightness analyzing unit 50 is electrically connected to the image bright field input interface 40. The coordinate area brightness analyzing unit 50 generates a pixel coordinate (X, Y) and a gray level range threshold (Z) according to the image bright field input interface 40. Extensible range values (Hnew, Lnew). The bright field generator 60 is electrically connected to the input image conversion module 10, the area brightness enhancement module 20, the image bright field input interface 40, and the coordinate area brightness analysis unit 50, respectively. The light field generator 60 converts the mode according to the input image. The brightness (Y) in the YCbCr signal of the group 10 establishes the probability density function (PDF) of the image signal, and the threshold value of the gray scale range generated by the image bright field input interface 40 or the coordinate area brightness analyzing unit 50 (H, L) The area brightness enhancement module 20 is provided for contrast enhancement processing according to the expandable range (Hnew, Lnew).

本發明之直方圖局部影像對比增強裝置,當其接收醫療造影設備或攝影監視器的動態影像,首先將NTSC等類比訊號解碼成數位訊號,再針對視訊規格做解交錯等數位訊號處理,將訊號整理成亮度與色差格式(YCbCr),其中亮度為Y,藍色色差為Cb,紅色色差為Cr,區域亮度增強模組20會針對亮度Y做處理,處理完之Y再與Cb、Cr結合成調整後的YCbCr訊號(NewYCbCr),透過輸出影像轉換模組30再將此NewYCbCr轉為NTSC、PAL、DVI或RGB等輸出型式,再送至對應的顯示裝置(螢幕)。The histogram partial image contrast enhancement device of the present invention firstly decodes the analog signal of the medical imaging device or the photographic monitor, first decodes the analog signal such as NTSC into a digital signal, and then performs deinterlacing and other digital signal processing for the video standard, and the signal is processed. The brightness and color difference format (YCbCr) is arranged, wherein the brightness is Y, the blue color difference is Cb, and the red color difference is Cr. The area brightness enhancement module 20 processes the brightness Y, and the processed Y is combined with Cb and Cr. The adjusted YCbCr signal (NewYCbCr) is converted into an NTSC, PAL, DVI or RGB output type through the output image conversion module 30, and then sent to the corresponding display device (screen).

使用者係透過影像亮域輸入介面40進行下列操作:1. 透過旋鈕或開關選擇其使用模式及壓縮率(Z值)。2. 若選擇動態調整模式,則可根據顯示結果以旋鈕調整亮度重點觀察區域(L,H值)。3. 若選指定物件模式,則可透過觸控螢幕或滑鼠等輸入裝置,直接指定螢幕畫面的其中一點座標(X,Y),使指定的物體在畫面中產生對比增強的效果。The user performs the following operations through the image bright field input interface 40: 1. Select the mode of use and the compression ratio (Z value) through a knob or a switch. 2. If the dynamic adjustment mode is selected, the brightness key observation area (L, H value) can be adjusted with the knob according to the display result. 3. If you select the specified object mode, you can directly specify one point (X, Y) of the screen image through the input device such as touch screen or mouse, so that the specified object will produce contrast enhancement effect on the screen.

在直方圖局部影像對比增強裝置之輸入影像轉換模組10設有一圖框緩衝器(Frame Buffer)(圖中未示),其儲存影像的Y值矩陣以供座標區域亮度分析單元50及亮域產生器60指定物件的L及H值分析以及產生伸展範圍(Lnew, Hnew),最後再由區域亮度增強模組20根據L、H、Lnew、Hnew以及Z值做最後的影像直方圖分佈特定區域的拉伸/壓縮。The input image conversion module 10 of the histogram partial image contrast enhancement device is provided with a frame buffer (not shown) for storing the Y value matrix of the image for the coordinate region brightness analysis unit 50 and the bright field. The generator 60 specifies the L and H value analysis of the object and generates the stretch range (Lnew, Hnew), and finally the region brightness enhancement module 20 performs the final image histogram distribution according to the L, H, Lnew, Hnew, and Z values. Stretch/compression.

在Lnew及Hnew的產生上,係壓縮非重點區域之非重點亮度範圍的灰階空間,使非重點區域之像素擠壓到小範圍,而大量像素集中的重點亮度範圍可因此而取得更大的亮度灰階值均衡化空間,再透過HS技術做灰階值的拉伸,將原本因亮度灰階值過份接近而顯得模糊一片的圖像重點灰階區段;以圖11的直方圖為例,將圖中Le至L及H至He部分的灰階級空間,壓縮1/Z倍後放置到新位置,新位置即為圖12所示0至Lnew及Hnew至255的空間,圖中Le及He表示整張原始影像的最低灰階度值與最高灰階度值,其小於Le與大於He的區域因未曾使用而造成灰階級度的浪費,故在本發明係將此浪費掉的空間一併移入至可拉伸區域。根據醫療影像灰階分佈之特性,使用者(醫生)欲診斷之部位通常集中於直方圖H與L之間,故本方法將灰階度介於H與L之間的區域訂為欲對比增強區域,小於L以及大於H之區域為不重要可壓縮之區域,將可壓縮區域壓縮後如圖12所示,加上原本小於Le及大於He的頭尾未曾使用之灰階級空間,所產生之Hnew到Lnew之間的範圍即為騰出之灰階級空間。In the generation of Lnew and Hnew, the gray-scale space of the non-emphasized brightness range of the non-emphasized area is compressed, so that the pixels of the non-key area are squeezed to a small range, and the key brightness range of a large number of pixel sets can be made larger. The luminance gray scale value equalization space is further stretched by the HS technique to make the gray scale value of the image which is originally blurred due to the excessive closeness of the gray scale value; the histogram of FIG. 11 is For example, the gray-scale space of Le to L and H to He in the figure is compressed by 1/Z times and placed in a new position. The new position is the space from 0 to Lnew and Hnew to 255 shown in Fig. 12, in which Le And He represents the lowest gray scale value and the highest gray scale value of the entire original image, and the area smaller than Le and greater than He causes waste of gray level due to non-use, so the space was wasted in the present invention. Move into the stretchable area together. According to the characteristics of the gray scale distribution of medical images, the part that the user (doctor) wants to diagnose is usually concentrated between the H and L of the histogram, so the method sets the area of the gray scale between H and L to be contrast enhanced. The area, the area smaller than L and larger than H is an unimportant compressible area, and the compressible area is compressed as shown in FIG. 12, and the gray-scale space which is originally used less than Le and greater than He is used. The range between Hnew and Lnew is the vacated gray class space.

有關直方圖分佈特定區域的拉伸/壓縮技術如以下所述:透過判斷欲處理的pixel(K)位於直方圖的哪一個區域,選擇對應的方式處理,在小於L值的灰階級部分及大於H值的灰階級部分,這兩部分會根據輸入之折疊率Z做空間折疊壓縮的動作,位於中間大於L值到小於H值的部分,則做直方圖均衡拉伸的動作,在此步驟需用到Hnew方程式(9)及Lnew方程式(10)的值。【數9】【數10】公式(9)中,Maxgray表圖像之最大灰階值,K代表圖中的某一顆像素,如果一張圖為512×512,則K就有262144個,pixel(K)表示K這個像素的灰階級度,NewPixel(K)表示K這個像素新的灰階級度。接收到pixel(K),若判斷其值位於直方圖的L<pixel(K)<H區間,此區間直方圖要拉伸拓展其範圍至Lnew到Hnew以達到達到影像對比增強效果,其方式如方程式(11)所示,Pixel(K)-L表示此灰階度與L的灰階級差,再乘上舊的範圍與新範圍的拉伸比例並取最小整數,即可算出在新範圍與Lnew的灰階級度差,最後加上Lnew就可得出K的新灰階級Pixel(K)。【數11】 The stretching/compression technique for the specific region of the histogram distribution is as follows: by determining which region of the histogram the pixel (K) to be processed is located, the corresponding method is selected, and the grayscale portion smaller than the L value is larger than The gray-scale part of the H value, the two parts will perform the space folding compression action according to the input folding rate Z. In the middle of the part larger than the L value to less than the H value, the histogram equalizing the stretching action is performed. The values of equations (9) and Lnew equations (10) of Hnew are used. [Number 9] [Number 10] In formula (9), the maximum grayscale value of the Maxgray table image, K represents a certain pixel in the graph. If a graph is 512×512, then there are 262144 K, and pixel(K) represents K pixel. The gray level, NewPixel (K) represents the new gray level of K. After receiving pixel(K), if the value is determined to be in the L<pixel(K)<H interval of the histogram, the histogram of the interval should be stretched and extended to Lnew to Hnew to achieve the image contrast enhancement effect. Equation (11), Pixel(K)-L represents the gray level difference between this gray scale and L, and multiplied by the stretch ratio of the old range and the new range. And take the smallest integer, you can calculate the gray level difference between the new range and Lnew, and finally add Lnew to get K's new gray class Pixel (K). [Number 11]

圖13為區域灰階HS擴展增強演算法之流程圖,在此流程中所欲處理之灰階值範圍假定為[0..255],故Maxgray為255,但本方法亦可適用於其它不同的灰階值域。本流程首先讀入欲處理的圖並放入一矩陣中,輸入H、L、Z值:其中H與L表欲增強的灰階範圍,使灰階落於[L:H]範圍的像素能藉本方法產生延展增強的效果,而Z值則為原圖像的灰階分佈中,非重點範圍(小於L或大於H)的部份向兩極壓縮的倍率。接著分析出此圖片的直方圖並找出此圖最小亮度值Le與最大亮度值He,接著算出此圖所有像素個數放入allelement待用,流程圖中k代表某個像素,接下來使用for迴圈令圖片所有的像素的像素值pixel(k) 依序進入公式計算(k由1至allelement),判斷像素值Pixel(k) 的所在範圍以對應處理方式做該點新灰階值之計算。k=k+1代表此像素計算完成,換下一個像素,所有像素皆計算完成其各自的newpixel(k),將新圖存到另一矩陣中,即為完成對比增強之圖像。Figure 13 is a flow chart of the regional gray-scale HS expansion enhancement algorithm. The grayscale value range to be processed in this flow is assumed to be [0..255], so Maxgray is 255, but the method can also be applied to other differences. Grayscale value range. This process first reads the graph to be processed and puts it into a matrix, and inputs H, L, and Z values: where H and L are to be enhanced by the gray scale range, so that the gray scale falls in the [L:H] range of pixels. By this method, the effect of the extension enhancement is produced, and the Z value is the magnification of the portion of the non-emphasis range (less than L or greater than H) that is compressed toward the two poles in the gray scale distribution of the original image. Then analyze the histogram of the picture and find the minimum brightness value Le and the maximum brightness value He of the picture, then calculate the number of all pixels in the picture into the allelement to be used, k in the flow chart represents a certain pixel, and then use for The loop returns the pixel value pixel(k) of all the pixels of the picture into the formula calculation (k from 1 to allelement), and judges the range of the pixel value Pixel(k) to calculate the new grayscale value of the point in the corresponding processing manner. . k=k+1 means that the calculation of this pixel is completed, and one pixel is replaced. All the pixels are calculated to complete their respective newpixel(k), and the new image is stored in another matrix, that is, the contrast enhanced image is completed.

前述之圖像各像素按灰階值區分為重點區域及兩端非重點區域,使用者可透過操作模式的選擇採用指定畫面特定位置之灰階為基準灰階,利用佇列(Queue)儲存已確定與參考點相同區塊/物件的座標,逐一比較相鄰的像素是否隸屬同一區塊/物件,並將滿足同一區塊/物件的相鄰座標再存入佇列(Queue)中,如此反覆處理直到確定所有隸屬同一區塊/物件的像素座標。若比較相鄰的像素是否隸屬同一區塊/物件,首先判斷相鄰像素的灰階值與相鄰的參考點灰階值之差是否小於一亮度差門檻,若不滿足則將該像素的灰階值與周邊像素的灰階值做平均以根據環境關係以調整其灰階值,若該灰階值與相鄰的參考點灰階值之差小於亮度差門檻,則亦算是隸屬同一區塊/物件,並根據其原始亮度值調整重點灰階範圍。該調整重點灰階範圍,係指根據所判定的區塊/物件中之像素,選擇其中的最小灰階值為L參數,最大灰階值為H參數。Each pixel of the image is divided into a key area and a non-key area at both ends according to the gray scale value. The user can select the gray level of the specific position of the specified screen as the reference gray level through the operation mode selection, and use the queue to store the already used Queue. Determining the coordinates of the same block/object as the reference point, comparing whether adjacent pixels belong to the same block/object, and storing the adjacent coordinates of the same block/object in the queue, thus repeating Processing until all pixel coordinates belonging to the same block/object are determined. If comparing adjacent pixels to the same block/object, first determine whether the difference between the grayscale value of the adjacent pixel and the adjacent reference point grayscale value is less than a luminance difference threshold, and if not, the gray of the pixel The order value is averaged with the grayscale values of the surrounding pixels to adjust the grayscale value according to the environmental relationship. If the difference between the grayscale value and the adjacent reference point grayscale value is less than the luminance difference threshold, it is also belonged to the same block. / Object, and adjust the key grayscale range according to its original brightness value. The adjustment focus gray scale range refers to selecting the minimum gray scale value as the L parameter according to the determined pixel in the block/object, and the maximum gray scale value is the H parameter.

圖14A與圖14B為根據使用者輸入的座標做區域亮度分析,以產生所指定區域/物體的亮度範圍L,H值的演算流程圖,其功用在利用使用者所輸入之點座標(x,y)做起點,利用分支設限(Branch-&-Bound)邏輯向四方擴展以尋找所點選之區域/物體的亮度範圍值(L,H),在此流程中所欲處理之圖像灰階值範圍亦假定為[0..255],但未來本方法亦可適用於其它不同的灰階值域。而g(x,y)函式則如方程式(12)所示,公式中a,b參數為系統設定之模糊化區間參考範圍,而w[]矩陣則為系統設定的區間範圍加權比重值,此方程式為對點(x,y)做相鄰區塊的糢糊化處理公式,使判斷點(x,y)與鄰點(x+i,y+j)是否同屬於一區塊/物體時能根據四周的亮度差異做調適性的判斷,並具此產生出較符合現實的L,H值。【數12】 14A and FIG. 14B are flow charts for performing area brightness analysis based on coordinates input by a user to generate a brightness range L, H of a specified area/object, and the function is to utilize a point coordinate (x, input by the user). y) Be the starting point, use Branch-&-Bound logic to expand to the square to find the brightness range value (L, H) of the selected area/object, and the image gray to be processed in this process The range of magnitudes is also assumed to be [0..255], but in the future this method can also be applied to other different grayscale value domains. The g(x,y) function is shown in equation (12). The a and b parameters in the formula are the fuzzy interval reference range set by the system, and the w[] matrix is the weighted specific gravity value of the interval range set by the system. This equation is a fuzzy processing formula for the neighboring block (x, y) to make the judgment point (x, y) and the neighboring point (x+i, y+j) belong to a block/object. It can make the judgment of adaptability according to the difference of brightness around, and it produces the L and H values which are more realistic. [Number 12]

有關本發明應用於醫療造影設備取得之影像的轉換效果,請參閱附件1至3,由於醫療造影器材產生之影像大多為灰階圖,但因受限於儀器性能,醫療造影器材產生之影像往往不夠清晰,雖細節有拍出但時常因亮度(灰階度)過於相近令人以目視難以辨識,透過直方圖局部影像對比增強裝置可明顯得知經轉換後的影像較為清晰而易於辨識。For the conversion effect of the image obtained by the present invention applied to the medical imaging apparatus, please refer to the attachments 1 to 3. Since the images produced by the medical imaging apparatus are mostly gray scale diagrams, the images produced by the medical imaging apparatus are often limited due to the performance of the instrument. Not clear enough, although the details are taken, but often the brightness (gray scale) is too close to be visually illegible. Through the histogram partial image contrast enhancement device, it is obvious that the converted image is clear and easy to identify.

附件1的影像為腦部斷層掃描(CT)拍攝,由下圖圈選區域可明顯看出經對比增強後之影像腦部灰質(右側圈選處)與白質(上方圈選處)較分明,且腫瘤(左側圈選處)之邊界及腫瘤內含物較清晰,此圖診斷重點為需判斷腫瘤邊界,以及檢視腫瘤內是否有鈣化、纖維化或增生之血管,對比增強後腫瘤邊界及內容物更分明,皆可幫助病灶判斷。The image of Annex 1 is taken by brain tomography (CT). It can be seen from the circled area below that the contrast-enhanced image of the gray matter of the brain (the right circle is selected) and the white matter (the upper circle) are more distinct. The boundary of the tumor (left side circle) and the tumor content are clear. The diagnosis of this picture is to determine the tumor boundary and to examine whether there are calcification, fibrosis or hyperplasia in the tumor, and the tumor boundary and content after contrast enhancement. The matter is more distinct and can help the lesion to judge.

附件2的影像亦為腦部斷層掃描(CT)拍攝,此圖主要症狀為疑似有出血的情況,上圖之右顳葉疑似有出血,經對比增強後之下圖,可明顯看出右顳葉與左顳葉紋路色澤形狀有明顯不同(右側圈選處),即可斷定有出血的情況。The image of Annex 2 is also taken by brain tomography (CT). The main symptom of this picture is suspected bleeding. The right temporal lobe of the above picture is suspected to have bleeding. After contrast enhancement, the lower right picture can be clearly seen. The shape of the leaf and the left temporal lobe are significantly different (the right circle is selected), and the bleeding can be determined.

附件3的影像為核磁共振造影(MRI)的人體腰椎影像,上圖影像無法清楚看到硬腦膜上腔是否有異物壓迫,利用PACS之影像處理會使原本較亮部分更加過亮,而中間硬腦膜上腔反而無法清楚影響判讀,經調整後之下圖的影像可清楚看到硬腦膜上腔(中央圈選處)及被壓迫之神經根(箭頭)。The image of Annex 3 is the human lumbar vertebrae image of magnetic resonance imaging (MRI). The above image cannot clearly see whether there is any foreign body oppression in the upper dura mater. The image processing using PACS will make the brighter part of the original more bright, while the middle is hard. The upper surface of the meninges can not clearly affect the interpretation. After adjustment, the image of the lower image can clearly see the upper dura mater (the central circle) and the nerve root (arrow).

10‧‧‧輸入影像轉換模組10‧‧‧Input image conversion module

20‧‧‧區域亮度增強模組
30‧‧‧輸出影像轉換模組
40‧‧‧影像亮域輸入介面
50‧‧‧座標區域亮度分析單元
60‧‧‧亮域產生器
20‧‧‧Regional brightness enhancement module
30‧‧‧Output image conversion module
40‧‧‧Image Bright Field Input Interface
50‧‧‧Coordinate area brightness analysis unit
60‧‧‧ Bright field generator

圖1是現有的原始影像圖。圖2是對應圖1影像內容的灰階直方圖。圖3是現有另一影像的原始直方圖。圖4是將圖3減去最小值的直方圖。圖5是將圖4刪減後的直方圖透過直方圖展伸對比增強法(HS)擴展的直方圖。圖6是經機率密度函數(PDF)計算的直方圖。圖7是經累積密度函數(CDF)計算的統計圖。圖8是透過直方圖均衡對比增強法(HE)於0~L-1間全域性均衡拓展的示意圖。圖9是透過BBHE分成兩個子直方圖並分別均衡化處理的示意圖。圖10是本發明較佳實施例的電路方塊圖。圖11是本發明較佳實施例之原始的直方圖。圖12是本發明較佳實施例之擴展的直方圖。圖13是本發明較佳實施例之區域灰階擴展增強法的流程圖。圖14A、14B是本發明較佳實施例之座標區域亮度分析法的流程圖。附件1是腦部斷層掃描(CT)影像之影像對比增強前後的對照圖(一)。附件2是腦部斷層掃描(CT)影像之影像對比增強前後的對照圖(二)。附件3是核磁共振造影(MRI)之影像對比增強前後的對照圖。Figure 1 is a prior art original image. 2 is a gray scale histogram corresponding to the image content of FIG. 1. Figure 3 is an original histogram of another conventional image. Figure 4 is a histogram of subtracting the minimum value from Figure 3. Figure 5 is a histogram of the histogram expanded by the histogram extension contrast enhancement (HS) extension of Figure 4. Figure 6 is a histogram calculated by the probability density function (PDF). Figure 7 is a statistical graph calculated by the cumulative density function (CDF). FIG. 8 is a schematic diagram of global full-scale equalization expansion between 0 and L-1 by histogram equalization contrast enhancement (HE). FIG. 9 is a schematic diagram of dividing into two sub-histograms by BBHE and separately equalizing processing. Figure 10 is a block diagram of a circuit in accordance with a preferred embodiment of the present invention. Figure 11 is an original histogram of a preferred embodiment of the present invention. Figure 12 is an expanded histogram of a preferred embodiment of the present invention. Figure 13 is a flow chart of a region gray scale extension enhancement method in accordance with a preferred embodiment of the present invention. 14A and 14B are flowcharts showing a method of brightness analysis of a coordinate area in accordance with a preferred embodiment of the present invention. Annex 1 is a comparison chart before and after image contrast enhancement of brain tomography (CT) images (1). Attachment 2 is a comparison chart before and after image contrast enhancement of brain tomography (CT) images (2). Annex 3 is a comparison chart before and after contrast enhancement of magnetic resonance imaging (MRI).

10‧‧‧輸入影像轉換模組 10‧‧‧Input image conversion module

20‧‧‧區域亮度增強模組 20‧‧‧Regional brightness enhancement module

30‧‧‧輸出影像轉換模組 30‧‧‧Output image conversion module

40‧‧‧影像亮域輸入介面 40‧‧‧Image Bright Field Input Interface

50‧‧‧座標區域亮度分析單元 50‧‧‧Coordinate area brightness analysis unit

60‧‧‧亮域產生器 60‧‧‧ Bright field generator

Claims (6)

一種直方圖局部影像對比增強方法,包含有:  取得一圖像;  統計該圖像之直方圖分佈,將圖像各像素按灰階值區分為重點區域及非重點區域;  對該直方圖分佈之非重點區域進行壓縮,取得足夠的灰階空間以對特定的灰階區域提供該重點區域進行延展性的對比增強;以及  將此區域灰階級度拉大而提高亮度差異,並增強其區域影像對比,以提高圖像之細節及清晰化。A histogram partial image contrast enhancement method includes: obtaining an image; and calculating a histogram distribution of the image, and classifying each pixel of the image into a key area and a non-key area according to a gray scale value; distributing the histogram The non-key area is compressed, and sufficient gray space is obtained to provide the contrast enhancement of the key area for the specific gray area; and the gray level of the area is enlarged to increase the brightness difference and enhance the regional image contrast. To improve the detail and clarity of the image. 如請求項1所述之直方圖局部影像對比增強方法,係對直方圖兩端之非重點區域進行壓縮,透過公式,使重點區域向兩端延伸擴展。The histogram local image contrast enhancement method according to claim 1 is to compress the non-key areas at both ends of the histogram by using a formula versus , so that the key areas extend to both ends. 如請求項2所述之直方圖局部影像對比增強方法,係壓縮非重點區域之非重點亮度範圍的灰階空間,使非重點區域之像素擠壓到小範圍,而大量像素集中的重點亮度範圍取得更大的亮度灰階值均衡化空間,並由HS技術做灰階值的拉伸,透過公式轉換至較大區段的灰階,使灰階值範圍擴大。The histogram partial image contrast enhancement method according to claim 2 is to compress the gray scale space of the non-emphasized brightness range of the non-key area, so that the pixels of the non-key area are squeezed to a small range, and the key brightness range of the plurality of pixel sets is concentrated. Obtain a larger brightness grayscale value equalization space, and use HS technology to do the grayscale value stretching, through the formula Convert to the grayscale of the larger segment to expand the grayscale value range. 如請求項1至3中任一項所述之直方圖局部影像對比增強方法,係將圖像各像素按灰階值區分為重點區域及兩端非重點區域後,使用者透過操作模式的選擇採用指定畫面特定位置之灰階為基準灰階,由一佇列(Queue)儲存已確定與參考點相同區塊/物件的座標,逐一比較相鄰的像素是否隸屬同一區塊/物件,並將滿足同一區塊/物件的相鄰座標再存入該佇列(Queue)中,並反覆處理直到確定所有隸屬同一區塊/物件的像素座標。The histogram partial image contrast enhancement method according to any one of claims 1 to 3, wherein the pixels of the image are divided into the focus area and the non-key areas at both ends according to the gray scale value, and the user selects the operation mode. Using the gray level of the specific position of the specified picture as the reference gray level, the Queue stores the coordinates of the same block/object as the reference point, and compares whether the adjacent pixels belong to the same block/object one by one, and Adjacent coordinates satisfying the same block/object are then stored in the queue and repeated until all pixel coordinates belonging to the same block/object are determined. 如請求項4所述之直方圖局部影像對比增強方法,比較相鄰的像素是否隸屬同一區塊/物件,是先判斷相鄰像素的灰階值與相鄰的參考點灰階值之差是否小於一亮度差門檻,若不滿足則將該像素的灰階值與周邊像素的灰階值做平均,以根據環境關係調整其灰階值,若該灰階值與相鄰的參考點灰階值之差小於亮度差門檻,則亦算是隸屬同一區塊/物件,並根據其原始亮度值調整重點灰階範圍,該調整重點灰階範圍是指根據所判定的區塊/物件中之像素,選擇其中的最小灰階值為L參數,最大灰階值為H參數。The method for contrast enhancement of a histogram partial image according to claim 4 is to compare whether adjacent pixels belong to the same block/object, and first determine whether the difference between the grayscale value of the adjacent pixel and the gray value of the adjacent reference point is Less than a luminance difference threshold, if not satisfied, the grayscale value of the pixel is averaged with the grayscale value of the surrounding pixel to adjust the grayscale value according to the environmental relationship, if the grayscale value and the adjacent reference point grayscale If the difference between the values is smaller than the luminance difference threshold, it is also subject to the same block/object, and the key gray scale range is adjusted according to the original brightness value, and the adjusted key gray scale range refers to the pixel in the determined block/object. Select the minimum grayscale value as the L parameter and the maximum grayscale value as the H parameter. 一種直方圖局部影像對比增強裝置,包含有:  一輸入影像轉換模組,其用以輸入一影像並轉換為一YCbCr訊號;  一區域亮度增強模組,其與輸入影像轉換模組電連接,該區域亮度增強模組群依據多數個控制訊號,轉換並產生一調整後的YCbCr訊號;  一輸出影像轉換模組,其與區域亮度增強模組電連接,該輸入影像轉換模組係輸出經區域亮度增強模組調整後的YCbCr訊號;  一影像亮域輸入介面,其與區域亮度增強模組電連接,該影像亮域輸入介面用以選定一個以上欲增強的灰階度範圍(H、L),或輸入一個以上的像素座標(X、Y)及其灰階範圍門檻(Z);  一座標區域亮度分析單元,其與影像亮域輸入介面電連接,該座標區域亮度分析單元依據影像亮域輸入介面之像素座標(X、Y)及灰階範圍門檻(Z)產生一可擴展範圍值(Hnew、Lnew);  一亮域產生器,其分別與輸入影像轉換模組、區域亮度增強模組、座標區域亮度分析單元及影像亮域輸入介面電連接,該亮域產生器根據YCbCr訊號中的明亮度(Y),建立該影像訊號的機率密度函數,影像亮域輸入介面或座標區域亮度分析單元產生的灰階度範圍(H、L),依該可擴展之範圍(Hnew、Lnew)提供區域亮度增強模組進行對比增強處理。A histogram partial image contrast enhancement device includes: an input image conversion module for inputting an image and converting into a YCbCr signal; and an area brightness enhancement module electrically connected to the input image conversion module, The area brightness enhancement module group converts and generates an adjusted YCbCr signal according to a plurality of control signals; an output image conversion module is electrically connected to the area brightness enhancement module, and the input image conversion module outputs the area brightness The enhanced YCbCr signal of the enhanced module; an image bright field input interface electrically connected to the regional brightness enhancement module, wherein the image bright field input interface is used to select more than one gray scale range (H, L) to be enhanced, Or input more than one pixel coordinate (X, Y) and its grayscale range threshold (Z); a standard area brightness analysis unit, which is electrically connected to the image bright field input interface, the coordinate area brightness analysis unit is input according to the image brightness field The pixel coordinates (X, Y) of the interface and the grayscale range threshold (Z) produce an extendable range value (Hnew, Lnew); a bright field generator, The two are respectively electrically connected to the input image conversion module, the area brightness enhancement module, the coordinate area brightness analysis unit and the image bright field input interface, and the bright field generator establishes the image signal according to the brightness (Y) in the YCbCr signal. The probability density function, the gray scale range (H, L) generated by the image bright field input interface or the coordinate area brightness analysis unit, and the area brightness enhancement module is provided for contrast enhancement processing according to the expandable range (Hnew, Lnew).
TW102124323A 2013-07-08 2013-07-08 Method and device for enhancing partial image contrast of histogram TW201503057A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW102124323A TW201503057A (en) 2013-07-08 2013-07-08 Method and device for enhancing partial image contrast of histogram

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW102124323A TW201503057A (en) 2013-07-08 2013-07-08 Method and device for enhancing partial image contrast of histogram

Publications (2)

Publication Number Publication Date
TW201503057A true TW201503057A (en) 2015-01-16
TWI563473B TWI563473B (en) 2016-12-21

Family

ID=52718463

Family Applications (1)

Application Number Title Priority Date Filing Date
TW102124323A TW201503057A (en) 2013-07-08 2013-07-08 Method and device for enhancing partial image contrast of histogram

Country Status (1)

Country Link
TW (1) TW201503057A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI711005B (en) * 2019-03-14 2020-11-21 宏碁股份有限公司 Method for adjusting luminance of images and computer program product
CN112686845A (en) * 2020-12-23 2021-04-20 合肥联宝信息技术有限公司 Image processing method and device and computer readable medium
TWI785335B (en) * 2020-05-20 2022-12-01 大陸商北京集創北方科技股份有限公司 Fingerprint collection and processing method, fingerprint collection and processing system and information processing device utilizing same

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI676962B (en) * 2018-01-08 2019-11-11 瑞昱半導體股份有限公司 Contrast enhancement method and apparatus thereof based on histogram adjustment

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7006688B2 (en) * 2001-07-05 2006-02-28 Corel Corporation Histogram adjustment features for use in imaging technologies
US7835588B2 (en) * 2006-11-29 2010-11-16 Nokia Corporation Contrast optimization of images
TWI438718B (en) * 2010-11-26 2014-05-21 Univ Nat Chunghsing Image processing method and system by using adaptive inverse hyperbolic curve
CN102110289B (en) * 2011-03-29 2012-09-19 东南大学 Method for enhancing color image contrast ratio on basis of variation frame
KR20130035019A (en) * 2011-09-29 2013-04-08 삼성전기주식회사 Image processing device and method for processing image
TWI463879B (en) * 2011-12-26 2014-12-01 Univ Nat Chunghsing Modulated image processing method and system thereof
TWM448754U (en) * 2012-10-24 2013-03-11 Nat Univ Chin Yi Technology Image contrast enhancement system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI711005B (en) * 2019-03-14 2020-11-21 宏碁股份有限公司 Method for adjusting luminance of images and computer program product
TWI785335B (en) * 2020-05-20 2022-12-01 大陸商北京集創北方科技股份有限公司 Fingerprint collection and processing method, fingerprint collection and processing system and information processing device utilizing same
CN112686845A (en) * 2020-12-23 2021-04-20 合肥联宝信息技术有限公司 Image processing method and device and computer readable medium
CN112686845B (en) * 2020-12-23 2022-04-15 合肥联宝信息技术有限公司 Image processing method and device and computer readable medium

Also Published As

Publication number Publication date
TWI563473B (en) 2016-12-21

Similar Documents

Publication Publication Date Title
CN104299204A (en) Histogram local image contrast enhancing method and histogram local image contrast enhancing device
Salem et al. Medical image enhancement based on histogram algorithms
JP5397059B2 (en) Image processing apparatus and method, program, and recording medium
KR101625362B1 (en) Method for converting input image data into output image data, image conversion unit for converting input image data into output image data, image processing apparatus, display device
Duan et al. Tone-mapping high dynamic range images by novel histogram adjustment
US8374430B2 (en) Apparatus and method for feature-based dynamic contrast enhancement
US7755670B2 (en) Tone-conversion device for image, program, electronic camera, and tone-conversion method
CN103544684A (en) Image processing method and image processing apparatus
CN102930517A (en) Image enhancement method implemented through histogram equalization
CN111105376B (en) Single-exposure high-dynamic-range image generation method based on double-branch neural network
CN104021532A (en) Image detail enhancement method of infrared image
TW201503057A (en) Method and device for enhancing partial image contrast of histogram
WO2015173570A1 (en) Compressing high dynamic range images
CN110060222B (en) Image correction method and device and endoscope system
CN108198155A (en) A kind of self application tone mapping method and system
JP2005039460A (en) Image processing method and apparatus
JPH10191100A (en) Video signal processing method
KR101650050B1 (en) Image processing apparatus, method, and program
Imtiaz et al. Image enhancement and space-variant color reproduction method for endoscopic images using adaptive sigmoid function
Beghdadi et al. Ceed-a database for image contrast enhancement evaluation
Shu et al. Locally adaptive rank-constrained optimal tone mapping
JP2007151094A (en) Tone-conversion device for image, program, electronic camera, and tone-conversion method
Toh et al. Implementation of high dynamic range rendering on acute leukemia slide images using contrast stretching
Wang et al. Low visual difference virtual high dynamic range image synthesizer from a single legacy image
CN109345464A (en) A kind of method and system of image procossing that realizing HDR in Bayer data field

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees