TWI831640B - Image processing system having dehazing mechanism - Google Patents
Image processing system having dehazing mechanism Download PDFInfo
- Publication number
- TWI831640B TWI831640B TW112108840A TW112108840A TWI831640B TW I831640 B TWI831640 B TW I831640B TW 112108840 A TW112108840 A TW 112108840A TW 112108840 A TW112108840 A TW 112108840A TW I831640 B TWI831640 B TW I831640B
- Authority
- TW
- Taiwan
- Prior art keywords
- depth
- pixel block
- calculation module
- pixel
- initial
- Prior art date
Links
- 238000004364 calculation method Methods 0.000 claims description 119
- 239000003086 colorant Substances 0.000 claims description 12
- 238000002834 transmittance Methods 0.000 claims description 7
- 238000010586 diagram Methods 0.000 description 6
- 238000013473 artificial intelligence Methods 0.000 description 3
- 230000036760 body temperature Effects 0.000 description 1
- 230000002496 gastric effect Effects 0.000 description 1
- 230000005484 gravity Effects 0.000 description 1
- 230000029058 respiratory gaseous exchange Effects 0.000 description 1
- 210000002784 stomach Anatomy 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
Abstract
Description
本發明涉及影像處理,特別是涉及一種具有除霧機制的影像處理系統。The present invention relates to image processing, and in particular to an image processing system with a defogging mechanism.
在車輛行駛上,為提高行車安全,需對車用照相機擷取到的含霧影像執行除霧演算法,以提供車輛附近的清晰影像給車用的人工智能(artificial intelligence, AI)自動駕駛輔助裝置學習,以分析出最佳的行經路線。When driving a vehicle, in order to improve driving safety, it is necessary to perform a defogging algorithm on the foggy images captured by the vehicle camera to provide clear images near the vehicle for the vehicle's artificial intelligence (AI) automatic driving assistance. The device learns to analyze the best route.
隨著近年來醫療技術的發展,醫用內視鏡廣泛使用於擷取人體內部的影像,例如胃部影像。在取得腸胃內視鏡時,患者在呼吸時可能會造成醫用內視鏡的鏡面起霧。或者,人類體溫可能造成放入體內部的醫用內視鏡的鏡面起霧,導致醫用內視鏡所擷取的影像模糊。因此,需進一步對擷取的含霧影像使用除霧演算法,才能獲取清晰的人體內部影像。With the development of medical technology in recent years, medical endoscopes are widely used to capture images of the inside of the human body, such as images of the stomach. When obtaining a gastrointestinal endoscope, the patient's breathing may cause the mirror surface of the medical endoscope to fog up. Alternatively, human body temperature may cause the mirror of a medical endoscope placed inside the body to fog up, resulting in blurry images captured by the medical endoscope. Therefore, it is necessary to further use a defogging algorithm on the captured foggy images to obtain clear internal images of the human body.
然而,現有影像除霧演算法,需使用大量硬體設備,佔用空間內大量面積,運算複雜度極高,需消耗大量電力,且除霧品質尚需提升。However, existing image defogging algorithms require the use of a large amount of hardware equipment, occupy a large area of space, are extremely computationally complex, consume a large amount of power, and the quality of defogging needs to be improved.
本發明所要解決的技術問題在於,針對現有技術的不足提供一種具有除霧機制的影像處理系統,包含影像讀取識別模組、初始深度計算模組、平均深度計算模組、理想深度計算模組以及深度校正計算模組。影像讀取識別模組配置以讀取原始影像的顏色深度。初始深度計算模組連接影像識別模組。初始深度計算模組配置以判斷原始影像劃分出的多個像素區塊中的各像素區塊內的多個像素點的每一者的初始深度。平均深度計算模組連接初始深度計算模組。平均深度計算模組配置以計算原始影像的各像素區塊內的多個像素點的初始深度的平均值作為平均深度。理想深度計算模組連接初始深度計算模組。理想深度計算模組配置以依據影像讀取識別模組讀取多個像素區塊的順序,以設定各像素區塊的理想深度。深度校正計算模組連接平均深度計算模組以及理想深度計算模組。深度校正計算模組配置以將各像素區塊的平均深度與其理想深度進行比較,以決定是否校正各像素區塊的顏色。當深度校正計算模組判斷原始影像中的哪一像素區塊的平均深度與其理想深度之間的關係不符合一預設關係時,深度校正計算模組對那一像素區塊的初始深度進行校正。The technical problem to be solved by the present invention is to provide an image processing system with a defogging mechanism in view of the shortcomings of the existing technology, including an image reading and recognition module, an initial depth calculation module, an average depth calculation module, and an ideal depth calculation module. and a depth correction calculation module. The image reading and recognition module is configured to read the color depth of the original image. The initial depth calculation module is connected to the image recognition module. The initial depth calculation module is configured to determine the initial depth of each of the plurality of pixels in each of the plurality of pixel blocks divided by the original image. The average depth calculation module is connected to the initial depth calculation module. The average depth calculation module is configured to calculate the average of the initial depths of multiple pixels in each pixel block of the original image as the average depth. The ideal depth calculation module is connected to the initial depth calculation module. The ideal depth calculation module is configured to set the ideal depth of each pixel block according to the order in which the image reading recognition module reads the plurality of pixel blocks. The depth correction calculation module is connected to the average depth calculation module and the ideal depth calculation module. The depth correction calculation module is configured to compare the average depth of each pixel block with its ideal depth to determine whether to correct the color of each pixel block. When the depth correction calculation module determines that the relationship between the average depth of a pixel block in the original image and its ideal depth does not meet a preset relationship, the depth correction calculation module corrects the initial depth of that pixel block. .
在實施例中,當深度校正計算模組判斷哪一像素區塊的平均深度大於理想深度或平均深度與理想深度之間的差值小於一理想深度差門檻值時,深度校正計算模組校正那一像素區塊的初始深度。In an embodiment, when the depth correction calculation module determines which pixel block has an average depth greater than the ideal depth or the difference between the average depth and the ideal depth is less than an ideal depth difference threshold, the depth correction calculation module corrects that pixel block. The initial depth of the one-pixel block.
在實施例中,當深度校正計算模組判斷哪一像素區塊的平均深度小於理想深度且平均深度與理想深度之間的差值大於理想深度差門檻值時,深度校正計算模組不校正那一像素區塊的初始深度。In an embodiment, when the depth correction calculation module determines which pixel block has an average depth less than the ideal depth and the difference between the average depth and the ideal depth is greater than the ideal depth difference threshold, the depth correction calculation module does not correct that pixel block. The initial depth of the one-pixel block.
在實施例中,深度校正計算模組將欲校正的那一像素區塊的初始深度、平均深度以及理想深度中的全部或數者分別乘上多個權重值後相加以計算出那一像素區塊的一參考校正深度。深度校正計算模組依據所述參考校正深度以對那一像素區塊的像素區塊的初始深度進行校正。In an embodiment, the depth correction calculation module multiplies all or some of the initial depth, average depth, and ideal depth of the pixel area to be corrected by multiple weight values, and then adds them together to calculate the pixel area. A reference correction depth for the block. The depth correction calculation module corrects the initial depth of the pixel block of that pixel block based on the reference correction depth.
在實施例中,所述的具有除霧機制的影像處理系統更包含目標深度決定模組。目標深度決定模組連接影像讀取識別模組以及平均深度計算模組。目標深度決定模組配置以設定原始影像的各像素區塊的目標深度。當目前的像素區塊的平均深度小於上一像素區塊的平均深度或與上一像素區塊之間的差值小於一平均深度差門檻值時,目標深度決定模組設定目前的像素區塊的目標深度,等於目前的像素區塊內出現次數最多的初始深度。當目前的像素區塊的平均深度大於上一像素區塊的平均深度且與上一像素區塊之間的差值大於平均深度差門檻值時,目標深度決定模組設定目前的像素區塊的目標深度等於上一像素區塊的平均深度。In an embodiment, the image processing system with a defogging mechanism further includes a target depth determination module. The target depth determination module is connected to the image reading and recognition module and the average depth calculation module. The target depth determination module is configured to set the target depth of each pixel block of the original image. When the average depth of the current pixel block is less than the average depth of the previous pixel block or the difference between the current pixel block and the previous pixel block is less than an average depth difference threshold, the target depth determination module sets the current pixel block The target depth is equal to the initial depth that occurs most frequently in the current pixel block. When the average depth of the current pixel block is greater than the average depth of the previous pixel block and the difference between the current pixel block and the previous pixel block is greater than the average depth difference threshold, the target depth determination module sets the current pixel block's average depth. The target depth is equal to the average depth of the previous pixel block.
在實施例中,深度校正計算模組將欲校正的那一像素區塊的目標深度、初始深度、平均深度以及理想深度中的全部或數者分別乘上多個權重值後相加以計算出那一像素區塊的一參考校正深度。深度校正計算模組依據所述參考校正深度以對那一像素區塊的像素區塊的初始深度進行校正。In an embodiment, the depth correction calculation module multiplies all or some of the target depth, initial depth, average depth, and ideal depth of the pixel block to be corrected by multiple weight values, and then calculates the sum. A reference correction depth for a pixel block. The depth correction calculation module corrects the initial depth of the pixel block of that pixel block based on the reference correction depth.
在實施例中,當初始深度計算模組判斷原始影像中的哪一像素點的多種顏色的顏色深度皆為零值時,初始深度計算模組設定那一像素點的飽和度為零值。當初始深度計算模組判斷原始影像中的哪一像素點的多種顏色的顏色深度皆非為零值時,初始深度計算模組計算那一像素點的多種顏色中的最小顏色深度與最大顏色深度的比例,並依據所述比例以判斷那一像素點的飽和度。In an embodiment, when the initial depth calculation module determines which pixel in the original image has a color depth of multiple colors that are all zero, the initial depth calculation module sets the saturation of that pixel to zero. When the initial depth calculation module determines which pixel in the original image has a non-zero color depth of multiple colors, the initial depth calculation module calculates the minimum color depth and maximum color depth among the multiple colors of that pixel. ratio, and determine the saturation of that pixel based on the ratio.
在實施例中,初始深度計算模組定義各像素點的多種顏色中的最大顏色深度為各像素點的明度。初始深度計算模組依據每一像素點的飽和度和明度以計算每一像素點的初始深度。In an embodiment, the initial depth calculation module defines the maximum color depth among multiple colors of each pixel as the brightness of each pixel. The initial depth calculation module calculates the initial depth of each pixel based on the saturation and brightness of each pixel.
在實施例中,所述的具有除霧機制的影像處理系統更包含最大深度比對模組。最大深度比對模組連接深度校正計算模組。最大深度比對模組配置以將從深度校正計算模組將校正後的原始影像的多個像素點的顏色深度相互比對,以比對出各像素區塊中的最大顏色深度,作為一影像還原參數。In an embodiment, the image processing system with a defogging mechanism further includes a maximum depth comparison module. The maximum depth comparison module is connected to the depth correction calculation module. The maximum depth comparison module is configured to compare the color depths of multiple pixels of the corrected original image with each other from the depth correction calculation module to compare the maximum color depth in each pixel block as an image. Restore parameters.
在實施例中,所述的具有除霧機制的影像處理系統更包含清晰影像還原模組。清晰影像還原模組連接深度校正計算模組。深度校正計算模組依據原始影像的顏色深度與清楚影像的顏色深度的比例以計算出透射率。影像還原模組將原始影像的多個像素區塊的初始深度與透射率以及校正後的所述原始影像的所述多個像素點的顏色深度進行運算,以計算出原始影像還原成清楚影像時的顏色深度,並據以還原出清楚影像顯示。In an embodiment, the image processing system with a defogging mechanism further includes a clear image restoration module. The clear image restoration module is connected to the depth correction calculation module. The depth correction calculation module calculates the transmittance based on the ratio of the color depth of the original image to the color depth of the clear image. The image restoration module calculates the initial depth and transmittance of the multiple pixel blocks of the original image and the color depth of the multiple pixels of the corrected original image to calculate the time required to restore the original image to a clear image. the color depth and restore a clear image display accordingly.
請參閱圖1和圖2,其中圖1為本發明第一實施例的具有除霧機制的影像處理系統的方塊圖,圖2為本發明第一實施例的具有除霧機制的影像處理系統計算出原始影像校正後的顏色深度的步驟流程圖。Please refer to Figures 1 and 2. Figure 1 is a block diagram of an image processing system with a defogging mechanism according to the first embodiment of the present invention. Figure 2 is a calculation diagram of an image processing system with a defogging mechanism according to the first embodiment of the present invention. Step-by-step flow chart to obtain the corrected color depth of the original image.
如圖1所示,本發明第一實施例的影像處理系統可包含影像讀取識別模組10、初始深度計算模組20、平均深度計算模組30、理想深度計算模組40以及深度校正計算模組50。As shown in FIG. 1 , the image processing system according to the first embodiment of the present invention may include an image reading and
影像讀取識別模組10可連接初始深度計算模組20以及理想深度計算模組40。理想深度計算模組40可連接深度校正計算模組50。平均深度計算模組30可連接初始深度計算模組20以及深度校正計算模組50。The image reading and
如圖1所示的影像處理系統可執行如圖2所示的步驟S11~S33,如下詳細說明,但本發明不以此為限。實務上,可依據實際需求,適當地調整步驟S11~S33的執行順序和內容。The image processing system shown in Figure 1 can perform steps S11 to S33 shown in Figure 2, as described in detail below, but the invention is not limited thereto. In practice, the execution order and content of steps S11 to S33 can be appropriately adjusted according to actual needs.
在步驟S11,利用影像讀取識別模組10讀取影像,作為原始影像。在本文中,利用影像讀取識別模組10所讀取的原始影像為空氣中含有霧霾時所擷取的模糊影像。In step S11, the image is read using the image reading and
在步驟S13,利用影像讀取識別模組10識別原始影像劃分出的多個像素區塊的各像素區塊內的多個像素點的顏色深度。In step S13, the image reading and
在步驟S15,利用初始深度計算模組20判斷原始影像劃分出的多個像素區塊中的各像素區塊內的多個像素點的每一者的初始深度。In step S15 , the initial
應理解,本文所述從所述原始影像劃分出的多個像素區塊的數量以及各像素區塊的面積可取決於實際需求,本發明不以此為限。It should be understood that the number of multiple pixel blocks divided from the original image and the area of each pixel block described herein may depend on actual requirements, and the present invention is not limited thereto.
在步驟S17,利用平均深度計算模組30計算原始影像的多個像素區塊內的每一像素區塊內的多個像素點分別的多個初始深度的平均值,作為每一像素區塊的一平均深度。In step S17, the average
在步驟S19,利用理想深度計算模組40依據影像讀取識別模組10讀取原始影像的多個像素區塊的順序,以設定原始影像的多個像素區塊內的每一像素區塊的理想深度(或稱預設深度)。In step S19, the ideal
舉例而言,理想深度計算模組40可依據影像讀取識別模組10所讀取的上一張影像的最大深度,作為目前原始影像的最大深度d0。若原始影像的總高度為 H,n 為目前讀取到這行中的第幾個像素區塊。若影像讀取識別模組10為沿縱向方向由上往下讀取,n 即為由上至下數來第幾個像素區塊。當 n小於H/2 時,也就是目前讀取還在原始影像的上半部時,理想深度為d0。相反地,當 n大於或等於H/2 時,也就是到達原始影像的下半部時,理想深度會隨讀取時間或讀取高度(平均地)遞減,直到沿縱向方向由上往下讀取的最後一個像素區塊。For example, the ideal
在步驟S21,利用深度校正計算模組50將原始影像劃分出的多個像素區塊中的各像素區塊的平均深度與其理想深度進行比較。In step S21, the depth
在步驟S23,利用深度校正計算模組50判斷原始影像中的各像素區塊的平均深度與其理想深度之間的關係是否符合預設關係。In step S23, the depth
若深度校正計算模組50判斷原始影像中的哪一像素區塊的平均深度與其理想深度之間的關係符合預設關係時,執行步驟S25。If the depth
舉例而言,若深度校正計算模組50判斷原始影像中的哪一像素區塊的平均深度小於理想深度且此像素區塊與理想深度的差值大於一理想深度差值門檻值(即符合預設關係)時,深度校正計算模組50評估可能有近物,執行步驟S25。在步驟S25,深度校正計算模組50保留那一像素區塊的原始顏色深度,不對那一像素區塊執行校正。For example, if the depth
相反地,若深度校正計算模組50判斷原始影像中的哪一像素區塊的平均深度與其理想深度之間的關係不符合預設關係時,深度校正計算模組50則對原始影像中的那一像素區塊的初始深度進行校正,以將所述原始影像的顏色深度校正為清楚影像的顏色深度。On the contrary, if the depth
舉例而言,若深度校正計算模組50判斷原始影像中的像素區塊的平均深度大於理想深度或是此像素區塊與理想深度的差值小於所述理想深度差值門檻值(即不符合預設關係)時,深度校正計算模組50對原始影像中的那一像素區塊的初始深度進行校正。For example, if the depth
本發明實施例的影像處理系統可依序執行步驟S27~S33,來將原始影像的顏色深度校正,但本發明不以此為限。實務上,可依據實際需求,適當地調整步驟S27~S33的執行順序和內容。The image processing system of the embodiment of the present invention can sequentially execute steps S27 to S33 to correct the color depth of the original image, but the present invention is not limited thereto. In practice, the execution order and content of steps S27 to S33 can be appropriately adjusted according to actual needs.
在步驟S27,利用深度校正計算模組50設定欲校正的那一像素區塊的初始深度的權重值,將原始影像中欲校正的那一像素區塊的初始深度乘上其權重值,以取得第一運算值。In step S27, the depth
在步驟S29,利用深度校正計算模組50設定欲校正的那一像素區塊的平均深度的權重值,將原始影像中欲校正的那一像素區塊的平均深度乘上其權重值,以取得第二運算值。In step S29, the depth
在步驟S31,利用深度校正計算模組50設定欲校正的那一像素區塊的理想深度的權重值,將原始影像中欲校正的那一像素區塊的理想深度乘上其權重值,以取得第三運算值。In step S31, the depth
在步驟S33,利用深度校正計算模組50將原始影像中欲校正的那一像素區塊的第一運算值、第二運算值與第三運算值進行(相加)運算,以計算那一所述像素區塊的一參考校正深度,依據所述參考校正深度以對那一像素區塊的像素區塊的初始深度進行校正。In step S33, the depth
請參閱圖1至圖3,其中圖3為本發明第一實施例的具有除霧機制的影像處理系統計算出原始影像的初始深度的步驟流程圖。Please refer to FIGS. 1 to 3 . FIG. 3 is a flowchart of steps for calculating the initial depth of an original image by the image processing system with a defogging mechanism according to the first embodiment of the present invention.
本發明實施例的影像處理系統可對原始影像的各像素區塊執行如圖3所示的步驟S151~S158,以實現計算原始影像的各像素點的初始深度。The image processing system of the embodiment of the present invention can perform steps S151 to S158 as shown in FIG. 3 for each pixel block of the original image to calculate the initial depth of each pixel point of the original image.
在步驟S151,利用影像讀取識別模組10分析原始影像的各像素點的多種顏色分別的多個顏色深度。In step S151, the image reading and
在步驟S152,利用初始深度計算模組20將原始影像的各像素點的多種顏色分別的多個顏色深度相互進行比對,以找出每一像素點的多種顏色分別的多個顏色深度中的最大值,作為此一像素點的最大顏色深度。In step S152, the initial
在步驟S153, 利用初始深度計算模組20依據原始影像的每一像素點的多種顏色中的最大顏色深度,來評估此像素點的明度。In step S153, the initial
在本實施例中,利用初始深度計算模組20將原始影像的每一像素點的多種顏色中的最大顏色深度,直接作為此像素點的明度。In this embodiment, the initial
舉例而言,利用初始深度計算模組20將原始影像的各像素點的紅色(R)深度、綠色(G)深度以及藍色(B)深度中的最大深度,取深度最大的那一顏色的深度作為此像素點的明度。For example, the initial
在步驟S154,利用初始深度計算模組20判斷原始影像的每一像素點的多種顏色中的最大顏色深度是否為零值。In step S154, the initial
若初始深度計算模組20判斷原始影像的哪一像素點的多種顏色中的最大顏色深度是為零值時,對那一像素點依序執行步驟S155、S158,以判定那一像素點的飽和度為零值,最後依據那一像素點的明度和飽和度以計算那一像素點的初始深度。If the initial
相反地,若初始深度計算模組20判斷原始影像的哪一像素點的最大顏色深度不是為零值時,依序執行步驟S156~S158。On the contrary, if the initial
在步驟S156,利用初始深度計算模組20將原始影像的各像素點的多種顏色分別的多個顏色深度相互進行比對,以找出每一像素點的多種顏色分別的多個顏色深度中的最小值,作為此一像素點的最小顏色深度。In step S156, the initial
在步驟S157,利用初始深度計算模組20計算各像素點的最小顏色深度與最大顏色深度的比例,並依據所述比例以判斷那一像素點的飽和度,例如但不限於以下列公式計算:
S(x)
,
其中,S(x)代表原始影像的多個像素點中的第x個像素點的飽和度,Dmin代表第x個像素點的最小顏色深度,Dmax代表第x個像素點的最大顏色深度。
In step S157, the initial
在步驟S158,利用初始深度計算模組20依據原始影像的多個像素點的每一像素點的飽和度和明度,以計算出每一像素點的初始深度。In step S158, the initial
舉例而言,利用初始深度計算模組20將原始影像每一像素點的飽和度和明度代入下列公式,以計算出原始影像每一像素點的初始深度:
,
其中,
代表原始影像的多個像素點中的第x個像素點的初始深度,a1、a2、a3為比重值,
代表原始影像的明度,
代表原始影像的飽和度。舉例而言,a1為0.12,a2為0.96,a3為-0.78,在此僅舉例說明,本發明不此為限。
For example, the initial
請參閱圖4和圖5,其中圖4為本發明第二實施例的具有除霧機制的影像處理系統的方塊圖,圖5為本發明第二實施例的具有除霧機制的影像處理系統將原始影像還原為清晰影像的步驟流程圖。Please refer to Figures 4 and 5. Figure 4 is a block diagram of an image processing system with a defogging mechanism according to a second embodiment of the present invention. Figure 5 is a block diagram of an image processing system with a defogging mechanism according to a second embodiment of the present invention. Flowchart of steps to restore original images to clear images.
第二實施例與第一實施例相同之處,不在下文中贅述。The similarities between the second embodiment and the first embodiment will not be described again below.
本發明的影像處理系統更可包含如圖4所示的清晰影像還原模組60以及最大深度比對模組70以及目標深度決定模組80。清晰影像還原模組60、最大深度比對模組70以及目標深度決定模組80可連接深度校正計算模組50。目標深度決定模組80更可連接平均深度計算模組30。The image processing system of the present invention may further include a clear
本發明的影像處理系統可例如執行在圖形處理器、中央處理器或其他電子裝置上。The image processing system of the present invention may, for example, be executed on a graphics processor, a central processing unit, or other electronic devices.
本發明的影像處理系統可執行如圖5所示的步驟S41~S44。相比第一實施例,本發明第二實施例的影像處理系統在計算校正後的原始影像(即清晰影像)的顏色深度時,除了初始深度、平均深度以及理想深度外,更加入目標深度,作為加權運算參數,詳細說明如下。The image processing system of the present invention can perform steps S41 to S44 as shown in FIG. 5 . Compared with the first embodiment, the image processing system of the second embodiment of the present invention adds the target depth in addition to the initial depth, average depth and ideal depth when calculating the color depth of the corrected original image (ie, the clear image). The weighting operation parameters are explained in detail below.
在步驟S41,利用目標深度決定模組80依據原始影像的各像素區塊的平均深度與其前一(讀取的)像素區塊的平均深度之間的關係,來設定原始影像的多個像素區塊中的各像素區塊的目標深度。In step S41, the target
在步驟S42,利用深度校正計算模組50設定欲校正的那一像素區塊的目標深度的權重值,將原始影像中欲校正的那一像素區塊的目標深度乘上其權重值,以取得第四運算值。In step S42, the depth
在步驟S43,利用深度校正計算模組50將原始影像中欲校正的那一像素區塊的第一運算值(初始深度與其權重值的乘積值)、第二運算值(平均深度與其權重值的乘積值)、第三運算值(理想深度與其權重值的乘積值)與第四運算值(目標深度與其權重值的乘積值)進行(相加)運算,以計算出那一所述像素區塊的一參考校正深度。利用深度校正計算模組50依據所述參考校正深度,以對那一像素區塊的像素區塊的初始深度進行校正(至與所述參考校正深度相同)。In step S43, the depth
上述步驟S41~S43的運算以下列方程式表示:
dc(x, n) = W1 × di(x, n) + W2 × davg + W3× def + W4 × dtar,
其中dc(x, n)代表原始影像中的多個像素區塊內被影像讀取識別模組10讀取的第n個像素區塊/原始影像切分出的多個像素區塊內的第x個像素區塊校正後的顏色深度,W1代表像素區塊的初始深度的權重值,di代表像素區塊的初始深度,W2代表像素區塊的平均深度的權重值,davg代表像素區塊的平均深度,W3代表像素區塊的理想深度(或稱預設深度)的權重值,def代表像素區塊的理想深度,W4代表像素區塊的目標深度的權重值,dtar代表第n個像素區塊的目標深度。
The operations of the above steps S41~S43 are expressed by the following equation:
dc(x, n) = W1 × di(x, n) + W2 × davg + W3× def + W4 × dtar,
where dc(x, n) represents the n-th pixel block in the multiple pixel blocks in the original image read by the image reading and
舉例而言,W1為0.125,W2為0.125,W3為0.125,W4為0.625,在此僅舉例說明,本發明不以此為限。實務上,可依據實際需求,決定初始深度、平均深度、理想深度以及目標深度用於計算原始影像校正後的顏色深度的比重,以分別設定權重值W1、W2、W3、W4。For example, W1 is 0.125, W2 is 0.125, W3 is 0.125, and W4 is 0.625. This is only an example, and the invention is not limited thereto. In practice, the proportions of the initial depth, average depth, ideal depth, and target depth used to calculate the corrected color depth of the original image can be determined based on actual needs to set the weight values W1, W2, W3, and W4 respectively.
在計算出原始影像的所有需校正的多個像素區塊分別的多個參考校正深度之後,深度校正計算模組50將最後校正後的原始影像的每一像素區塊的初始深度代入下列方程式,以計算出那一像素區塊的透射率:
t(x) = e
– βd(x),
其中,t(x)代表透射率,β代表散射係數,d(x)為第x個像素區塊的初始深度。
After calculating the multiple reference correction depths of all the pixel blocks of the original image that need to be corrected, the depth
最大深度比對模組70可將最後校正後的原始影像的所有顏色深度相互比對,以找出原始影像中的最大顏色深度,作為一影像還原參數。The maximum
影像還原模組60可執行下方程式,以計算出清楚影像的各像素區塊的初始深度:
J(x) =
+ A,
其中,J(x)代表未經散射的清楚影像的第x個像素區塊的初始深度,I(x)代表含有霧霾的原始影像的第x個像素區塊的初始深度,A代表影像還原參數,t(x)代表第x個像素區塊的透射率。
The
在步驟S44,利用影像還原模組60依據清楚影像的各像素區塊的初始深度,以將原始影像還原成清楚影像顯示。In step S44, the
請參閱圖4至圖6,其中圖6為本發明第二實施例的具有除霧機制的影像處理系統決定目標深度的步驟流程圖。Please refer to FIGS. 4 to 6 , wherein FIG. 6 is a flow chart of steps for determining a target depth in an image processing system with a defogging mechanism according to a second embodiment of the present invention.
本發明第二實施例的影像處理系統可執行步驟S411~S417,來設定原始影像的多個像素區塊的每一像素區塊的目標深度。The image processing system according to the second embodiment of the present invention can execute steps S411 to S417 to set the target depth of each pixel block of the plurality of pixel blocks of the original image.
在步驟S411,利用目標深度決定模組80取得原始影像的多個像素區塊內的其中一像素區塊的平均深度,即目前像素區塊的平均深度。In step S411, the target
在步驟S412,利用目標深度決定模組80取得原始影像的多個像素區塊內,在目前像素區塊前被影像讀取識別模組10讀取的上一像素區塊的平均深度。In step S412, the target
在步驟S413,利用目標深度決定模組80判斷目前像素區塊的平均深度是否小於上一像素區塊的平均深度,或目前像素區塊的平均深度與上一像素區塊之間的差值是否小於一平均深度差門檻值。In step S413, the target
若目標深度決定模組80判斷目前像素區塊的平均深度不小於上一像素區塊的平均深度,且目前像素區塊的平均深度與上一像素區塊之間的差值不小於所述平均深度差門檻值時,依序執行步驟S414、S415。If the target
在步驟S414,利用目標深度決定模組80保留上一像素區塊的平均深度。In step S414, the target
在步驟S415,利用目標深度決定模組80將目標深度設定為,等於上一像素區塊的平均深度。In step S415, the target
相反地,若目標深度決定模組80判斷目前像素區塊的平均深度小於上一像素區塊的平均深度,或目前像素區塊的平均深度與上一像素區塊之間的差值小於所述平均深度差門檻值時,依序執行步驟S416、S417。On the contrary, if the target
在步驟S416,利用目標深度決定模組80將目前像素區塊的多個像素點分別的多個顏色深度相比進行比對,以從目前像素區塊的多個像素點分別的多個顏色深度中取得出現次數最多的顏色深度。In step S416, the target
在步驟S417,利用目標深度決定模組80將目標深度設定為等於,目前像素區塊的多個像素點分別的多個顏色深度中取得出現次數最多的顏色深度。In step S417, the target
綜上所述,本發明提供一種具有除霧機制的影像處理系統,其在可在低硬體成本的條件下,有效地將含霧的模糊影像進行除霧,以產生無霧的清晰影像,作為人工智能(artificial intelligence, AI)系統學習(learning)和訓練(traning)的數據,如此可降低人工智能系統訓練出模型的複雜度,同時提高訓練模型的準確度。To sum up, the present invention provides an image processing system with a defogging mechanism, which can effectively defogging a hazy image containing fog to produce a clear image without fog at a low hardware cost. As data for learning and training of artificial intelligence (AI) systems, this can reduce the complexity of the model trained by the artificial intelligence system and improve the accuracy of the training model.
以上所公開的內容僅為本發明的優選可行實施例,並非因此侷限本發明的申請專利範圍,所以凡是運用本發明說明書及圖式內容所做的等效技術變化,均包含於本發明的申請專利範圍內。The contents disclosed above are only preferred and feasible embodiments of the present invention, and do not limit the scope of the patent application of the present invention. Therefore, all equivalent technical changes made by using the description and drawings of the present invention are included in the application of the present invention. within the scope of the patent.
10:影像讀取識別模組 20:初始深度計算模組 30:平均深度計算模組 40:理想深度計算模組 50:深度校正計算模組 60:清晰影像還原模組 70:最大深度比對模組 80:目標深度決定模組 S11~S33、S151~S158、S41~S44、S411~S417:步驟10:Image reading and recognition module 20:Initial depth calculation module 30: Average depth calculation module 40:Ideal depth calculation module 50: Depth correction calculation module 60:Clear image restoration module 70: Maximum depth comparison module 80:Target depth determination module S11~S33, S151~S158, S41~S44, S411~S417: steps
圖1為本發明第一實施例的具有除霧機制的影像處理系統的方塊圖。FIG. 1 is a block diagram of an image processing system with a defogging mechanism according to the first embodiment of the present invention.
圖2為本發明第一實施例的具有除霧機制的影像處理系統計算出原始影像校正後的顏色深度的步驟流程圖。FIG. 2 is a flowchart of steps for calculating the corrected color depth of an original image by the image processing system with a defogging mechanism according to the first embodiment of the present invention.
圖3為本發明第一實施例的具有除霧機制的影像處理系統計算出原始影像的初始深度的步驟流程圖。FIG. 3 is a flowchart of steps for calculating the initial depth of an original image by the image processing system with a defogging mechanism according to the first embodiment of the present invention.
圖4為本發明第二實施例的具有除霧機制的影像處理系統的方塊圖。FIG. 4 is a block diagram of an image processing system with a defogging mechanism according to a second embodiment of the present invention.
圖5為本發明第二實施例的具有除霧機制的影像處理系統將原始影像還原為清晰影像的步驟流程圖。FIG. 5 is a flow chart of steps for restoring an original image to a clear image by the image processing system with a defogging mechanism according to the second embodiment of the present invention.
圖6為本發明第二實施例的具有除霧機制的影像處理系統決定目標深度的步驟流程圖。FIG. 6 is a flowchart of the steps for determining the target depth of the image processing system with a defogging mechanism according to the second embodiment of the present invention.
10:影像讀取識別模組 10:Image reading and recognition module
20:初始深度計算模組 20:Initial depth calculation module
30:平均深度計算模組 30: Average depth calculation module
40:理想深度計算模組 40:Ideal depth calculation module
50:深度校正計算模組 50: Depth correction calculation module
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW112108840A TWI831640B (en) | 2023-03-10 | 2023-03-10 | Image processing system having dehazing mechanism |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW112108840A TWI831640B (en) | 2023-03-10 | 2023-03-10 | Image processing system having dehazing mechanism |
Publications (1)
Publication Number | Publication Date |
---|---|
TWI831640B true TWI831640B (en) | 2024-02-01 |
Family
ID=90824736
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW112108840A TWI831640B (en) | 2023-03-10 | 2023-03-10 | Image processing system having dehazing mechanism |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI831640B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102243758A (en) * | 2011-07-14 | 2011-11-16 | 浙江大学 | Fog-degraded image restoration and fusion based image defogging method |
TW201308251A (en) * | 2011-08-04 | 2013-02-16 | Yi-Wu Chiang | Underwater image enhancement system |
TW201535323A (en) * | 2014-03-14 | 2015-09-16 | Nat Univ Chin Yi Technology | System and method for image defogging, system and method for driving assistance |
CN106999030A (en) * | 2014-07-24 | 2017-08-01 | Z思快尔有限公司 | Multicore fibrescope |
WO2019064825A1 (en) * | 2017-09-27 | 2019-04-04 | ソニー株式会社 | Information processing device, information processing method, control device, and image processing device |
-
2023
- 2023-03-10 TW TW112108840A patent/TWI831640B/en active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102243758A (en) * | 2011-07-14 | 2011-11-16 | 浙江大学 | Fog-degraded image restoration and fusion based image defogging method |
TW201308251A (en) * | 2011-08-04 | 2013-02-16 | Yi-Wu Chiang | Underwater image enhancement system |
TW201535323A (en) * | 2014-03-14 | 2015-09-16 | Nat Univ Chin Yi Technology | System and method for image defogging, system and method for driving assistance |
CN106999030A (en) * | 2014-07-24 | 2017-08-01 | Z思快尔有限公司 | Multicore fibrescope |
CN110251058A (en) * | 2014-07-24 | 2019-09-20 | Z思快尔有限公司 | Multicore fibrescope |
WO2019064825A1 (en) * | 2017-09-27 | 2019-04-04 | ソニー株式会社 | Information processing device, information processing method, control device, and image processing device |
Non-Patent Citations (2)
Title |
---|
專書 張城豪及鄺獻榮 可用於水下影像除霧之快速導引濾波器硬體架構設計與實現 臺灣博碩論文知識加值系統(https://hdl.handle.net/11296/bt9xwb) 2022年10月12日; * |
專書 郭建志及沈岱範 內視鏡影像鏡面反射去除之自動修補技術研究 臺灣博碩論文知識加值系統(https://hdl.handle.net/11296/ctkbn6) 2017年08月01日 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8139819B2 (en) | Eye open/close recognizing apparatus and recording medium | |
KR100981003B1 (en) | Moving body image extraction apparatus and computer readable storage medium storing program | |
CN111292257B (en) | Retinex-based image enhancement method in scotopic vision environment | |
CN106683080B (en) | A kind of retinal fundus images preprocess method | |
CN105405105B (en) | Display grey scale curve for breast molybdenum target image corrects system and method | |
CN111784668A (en) | Digestive endoscopy image automatic freezing method based on perceptual hash algorithm | |
CN110910319B (en) | Operation video real-time defogging enhancement method based on atmospheric scattering model | |
CN105096267B (en) | A kind of method and apparatus that eye brightness is adjusted based on identification of taking pictures | |
CN109816666B (en) | Symmetrical full convolution neural network model construction method, fundus image blood vessel segmentation device, computer equipment and storage medium | |
CN105744118B (en) | A kind of video enhancement method and video enhancement systems based on video frame adaptive | |
CN112639865A (en) | Image processing system, learning completion model, and image processing method | |
WO2019015477A1 (en) | Image correction method, computer readable storage medium and computer device | |
US20120120196A1 (en) | Image counting method and apparatus | |
CN109255760A (en) | Distorted image correction method and device | |
CN109766007A (en) | A kind of the blinkpunkt compensation method and compensation device, display equipment of display equipment | |
JP2007312810A (en) | Image processing device | |
CN111080537A (en) | Intelligent control method, medium, equipment and system for underwater robot | |
JP2004032207A (en) | Image display, projector, program and storage medium | |
CN117237279A (en) | Blind quality evaluation method and system for non-uniform distortion panoramic image | |
CN109934787B (en) | Image splicing method based on high dynamic range | |
TWI831640B (en) | Image processing system having dehazing mechanism | |
JP2007096437A (en) | Determination of image creator's intention | |
US9323981B2 (en) | Face component extraction apparatus, face component extraction method and recording medium in which program for face component extraction method is stored | |
CN114897647B (en) | Teaching auxiliary system | |
CN110012277A (en) | A kind of auto white balance method and device for portrait image |