TWI465699B - Method of water level measurement - Google Patents
Method of water level measurement Download PDFInfo
- Publication number
- TWI465699B TWI465699B TW101140546A TW101140546A TWI465699B TW I465699 B TWI465699 B TW I465699B TW 101140546 A TW101140546 A TW 101140546A TW 101140546 A TW101140546 A TW 101140546A TW I465699 B TWI465699 B TW I465699B
- Authority
- TW
- Taiwan
- Prior art keywords
- image
- water level
- value
- boundary
- original image
- Prior art date
Links
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02A—TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
- Y02A90/00—Technologies having an indirect contribution to adaptation to climate change
- Y02A90/30—Assessment of water resources
Landscapes
- Measurement Of Levels Of Liquids Or Fluent Solid Materials (AREA)
Description
本發明係關於一種水位量測方法,尤其是一種透過影像分析處理技術計算水位高度的水位量測方法。The invention relates to a water level measuring method, in particular to a water level measuring method for calculating a water level height through image analysis processing technology.
台灣位處極易致災的西太平洋季風區,且平均每年遭受西太平洋生成颱風侵台四次以上,颱風所挾帶的豪大雨經常導致水患頻傳,帶來嚴重經濟損失。此外,隨著全球暖化、氣候變遷而造成降雨型態改變,近年來短時間內大降雨量的極端暴雨屢見不鲜,極端降雨型態容易造成都市地區短時間內無法排除多餘雨量、區域排洪不及而淹水,對民眾的生命與財產安全造成嚴重威脅。Taiwan is located in the western Pacific monsoon region, which is extremely vulnerable to disasters. On average, it has been invaded by the typhoon in the western Pacific for more than four times a year. The heavy rains brought by the typhoon often lead to frequent floods and serious economic losses. In addition, with the global warming and climate change, the rainfall patterns have changed. In recent years, extreme rainstorms of heavy rainfall have been common in recent years. Extreme rainfall patterns are likely to cause urban areas to be unable to eliminate excess rainfall and areas in a short period of time. Flooding due to flooding is a serious threat to the lives and property of the people.
據此,水災的監控與預警向來是災害防範的首要目標,習知淹水監控方法通常為人工通報後,派駐相關人員到淹水現場以一習用接觸式水位量測裝置測量水位高度,再將測量結果回報至災害應變中心統計處理,以判斷淹水情況,進而發出通報或預警,然而這種方式往往需浪費大量人力進行淹水現場水位量測與結果彙整統計。因此,針對淹水機率較高的低窪地區,通常會常駐設置該習用接觸式水位量測裝置以隨時監測水位,並且透過有線或無線通訊方式自動回傳測量結果,以節省救災資源。Accordingly, the monitoring and early warning of floods has always been the primary target of disaster prevention. The conventional flood monitoring method is usually after manual notification, and the relevant personnel are dispatched to the flooding site to measure the water level by a conventional contact water level measuring device. The measurement results are reported to the disaster response center for statistical treatment to determine the flooding situation, and then to issue a notification or early warning. However, this method often requires a lot of manpower to be used for the flooding site water level measurement and result aggregation statistics. Therefore, for low-lying areas with high flooding probability, the conventional contact water level measuring device is usually set up to monitor the water level at any time, and the measurement results are automatically returned by wired or wireless communication to save disaster relief resources.
然而,該習用接觸式水位量測裝置由於必須伸入水中進行測量,遇到水流湍急時往往難以成功量測,甚至有裝置直接被沖走或沖毀的風險存在。此外,該習用接觸式水 位量測裝置的量測範圍往往受裝置本身的尺寸限制,當淹水深度過高時,容易有裝置本身被淹沒導致失去測量功能的情形產生。However, since the conventional contact type water level measuring device has to be inserted into the water for measurement, it is often difficult to measure successfully when the water flow is in a hurry, and even there is a risk that the device is directly washed away or destroyed. In addition, the conventional contact water The measuring range of the position measuring device is often limited by the size of the device itself. When the flooding depth is too high, it is easy to have a situation in which the device itself is submerged and the measuring function is lost.
為了解決上述習知淹水監控方法所面臨的問題,如中華民國第201024687號「雷射光學影像水位量測裝置及其方法」專利申請案所述內容,揭示一種習知非接觸式水位量測方法,可透過非接觸的方式以一雷射光源射入一水體,並且拍攝水體表面影像以測量該水體水位。該專利案之裝置及其方法雖可避免習用接觸式水位量測裝置必須伸入水中,具有容易量測失敗或毀損裝置的缺點,但該裝置若需設置於各個待偵測地點,仍然有成本較高的問題,難以據以施行大範圍淹水監控。再者,由於淹水時水體往往呈現渾濁且充滿雜物,以雷射光源照射的方式亦具有無法正確量測水位的問題。In order to solve the problems faced by the above-mentioned conventional flood monitoring method, for example, the content of the patent application of the "Lens Optical Image Water Level Measuring Device and Method" of the Republic of China No. 201024687 discloses a conventional non-contact water level measurement. The method can inject a water source into a body of water by a non-contact method, and take a water surface image to measure the water level of the water body. The device and method thereof of the patent can prevent the conventional contact type water level measuring device from extending into the water, and have the disadvantages of easy measurement failure or damage to the device, but the device still needs to be installed at each location to be detected, and still has a cost. The higher the problem, it is difficult to implement a wide range of flood monitoring. Moreover, since the water body tends to be turbid and full of debris when flooded, the method of irradiating with a laser light source also has the problem that the water level cannot be accurately measured.
綜上所述,該習知非接觸式水位量測方法雖可達成「以非接觸方式量測水位」之目的,惟仍有「設置成本過高」及「量測準確度可能受水體顏色與水中漂流物影響」等疑慮,在實際使用時容易衍生不同限制與缺點,確有不便之處,亟需進一步改良,以提升其實用性。In summary, the conventional non-contact water level measurement method can achieve the purpose of "measuring the water level in a non-contact manner", but there are still "the setting cost is too high" and "the measurement accuracy may be affected by the water color and Concerns such as the influence of drifting water in water, it is easy to derive different limitations and shortcomings in actual use, and there are inconveniences that need further improvement to improve its practicability.
本發明的目的乃改良上述之缺點,以提供一種水位量測方法,僅需就傳統監視攝影機所拍攝之影像進行分析處理,即可量測水位高度,具有降低系統設置成本之功效。The object of the present invention is to improve the above disadvantages, and to provide a water level measuring method, which only needs to analyze and process an image taken by a conventional surveillance camera, thereby measuring the water level height, and has the effect of reducing the system installation cost.
本發明另一目的係提供一種水位量測方法,該水位量 測方法以影像辨識方式判斷水位高度,量測時不受水體顏色與水中漂流物影響,具有增加水位量測準確性之功效。Another object of the present invention is to provide a water level measuring method, the water level The measurement method uses the image identification method to judge the height of the water level. The measurement is not affected by the color of the water body and the drifting material in the water, and has the effect of increasing the accuracy of the water level measurement.
本發明又一目的係提供一種水位量測方法,該水位量測方法為使用一梯度運算子邊緣搜尋法偵測邊界位置,於一影像中選出一判斷區塊,針對該判斷區塊套用該梯度運算子邊緣搜尋法,具有提升運算速度之功效。Another object of the present invention is to provide a water level measurement method for detecting a boundary position by using a gradient operator edge search method, selecting a determination block in an image, and applying the gradient to the determination block. The operator edge search method has the effect of increasing the speed of the operation.
本發明水位量測方法,係藉由一電腦系統對一原始影像進行水位量測作業,該方法包含:一影像讀取步驟,藉由該電腦系統讀入該原始影像,依據該原始影像之大小計算出一像素所代表之實際尺寸;一灰階處理步驟,對該原始影像進行灰階運算,該原始影像經灰階運算後之色階屬於一灰階色階範圍;一影像強化步驟,調整該經灰階運算之原始影像,使其色階平均分布於該灰階色階範圍之最大值與最小值之間;一影像校正步驟,依據該監控鏡頭之視角與地平線之夾角,將該原始影像旋轉校正成一水平影像,並自該水平影像中圈選一判斷區塊,以作為一後製影像;及一水位估算步驟,係針對該後製影像套用一梯度運算子邊緣搜尋法,計算該後製影像各像素之影像梯度及影像邊界值,且依據該影像邊界值推算一邊界投影值,以估算至少一邊界位置;再依據該邊界位置判定一水面位置,並依據該原始影像之像素所代表之實際尺寸計算出該水面位置所代表之水位高度。The water level measuring method of the present invention performs a water level measurement operation on an original image by a computer system, and the method includes: an image reading step, wherein the original image is read by the computer system, according to the size of the original image Calculating the actual size represented by a pixel; a grayscale processing step, performing a grayscale operation on the original image, the grayscale of the original image after the grayscale operation belongs to a grayscale colorscale range; an image enhancement step, adjusting The original image of the gray-scale operation is such that the gradation is evenly distributed between the maximum value and the minimum value of the gray-scale gradation range; an image correction step is performed according to the angle between the viewing angle of the monitoring lens and the horizon The image is rotated into a horizontal image, and a determination block is circled from the horizontal image as a post-production image; and a water level estimation step is performed by applying a gradient operator edge search method to the post-production image, and calculating the Image gradient and image boundary value of each pixel of the post-image, and a boundary projection value is estimated according to the image boundary value to estimate at least one boundary position; A position determination of the boundary surface location, and calculating the water level of the represented surface location based on the actual size of the pixel represented by the image of the original.
本發明之水位量測方法,其中,該梯度運算子邊緣搜尋法計算該後製影像各像素之影像梯度及影像邊界值的方法如下式所示:
其中,G代表影像梯度,E代表該影像邊界值,f(x,y)係為該判斷區塊之像素座標值為(x,y)時之灰階值,Gx代表該判斷區塊水平方向之梯度值,Gy代表該判斷區塊垂直方向之梯度值,ε為一閾值。Where G represents the image gradient, E represents the image boundary value, f(x, y) is the grayscale value of the pixel coordinate value of the judgment block (x, y), and Gx represents the horizontal direction of the judgment block. The gradient value, Gy represents the gradient value of the vertical direction of the judgment block, and ε is a threshold value.
本發明之水位量測方法,其中,該閾值使用Canny邊緣檢測算子求得。The water level measuring method of the present invention, wherein the threshold value is obtained using a Canny edge detection operator.
本發明之水位量測方法,其中,推算該邊界投影值及估算該邊界位置的方法如下式所示:
本發明之水位量測方法,其中,該標準值為該判斷區塊寬度的二分之一。The water level measuring method of the present invention, wherein the standard value is one-half of the width of the judgment block.
本發明之水位量測方法,其中,判定該水面位置之方法係為將該至少一邊界位置視為該水面位置。In the water level measuring method of the present invention, the method of determining the position of the water surface is to treat the at least one boundary position as the water surface position.
本發明之水位量測方法,其中,判定該水面位置之方 法係取該至少一邊界位置中,隨時間變動之邊界位置,作為該水面位置。The water level measuring method of the present invention, wherein the square of the water surface position is determined The law takes the boundary position of the at least one boundary position that changes with time as the water surface position.
本發明之水位量測方法,其中,該水位量測方法另包含一濾波處理步驟,係在該影像校正步驟選出一判斷區塊後,對該判斷區塊進行濾波處理以消除雜訊,使該判斷區塊形成該後製影像。The water level measuring method of the present invention, wherein the water level measuring method further comprises a filtering processing step, after selecting a determining block in the image correcting step, filtering the determining block to eliminate noise, so that the The determination block forms the post-production image.
本發明之水位量測方法,其中,該濾波處理步驟所使用之濾波處理方法為中間值濾波。The water level measuring method of the present invention, wherein the filtering processing method used in the filtering processing step is intermediate value filtering.
本發明之水位量測方法,其中該濾波處理步驟所使用之濾波處理方法為平均值濾波。The water level measuring method of the present invention, wherein the filtering processing method used in the filtering processing step is average value filtering.
本發明之水位量測方法,其中,該濾波處理步驟所使用之濾波處理方法為高斯值波。In the water level measuring method of the present invention, the filtering processing method used in the filtering processing step is a Gaussian value wave.
本發明之水位量測方法,其中,該濾波處理步驟所使用之濾波處理方法為拉普拉斯值濾波。In the water level measuring method of the present invention, the filtering processing method used in the filtering processing step is Laplacian value filtering.
為讓本發明之上述及其他目的、特徵及優點能更明顯易懂,下文特舉本發明之較佳實施例,並配合所附圖式,作詳細說明如下:本發明全文所述之「像素」(pixels),係指一影像(image)組成的最小單位,用以表示該影像之解析度(resolution),例如:若該影像之解析度為1024×768,則代表該影像共有(1024×768=786432)個像素,係本發明所屬技術領域中具有通常知識者可以理解。The above and other objects, features and advantages of the present invention will become more <RTIgt; (pixels) is the smallest unit of an image used to represent the resolution of the image. For example, if the resolution of the image is 1024×768, it means that the image is common (1024× 768 = 786432) pixels are understood by those of ordinary skill in the art to which the present invention pertains.
本發明全文所述之「色階」(color level),係指該像素 所顯現顏色分量或亮度的濃淡程度,例如:彩色(color)影像之紅色(R)、綠色(G)、藍色(B)分量的色階範圍(range)各為0~255;或者,灰階(gray-level)影像之亮度(luminance)的色階範圍可為0~255,係本發明所屬技術領域中具有通常知識者可以理解。The "color level" as used throughout the text of the present invention means the pixel The degree of shading of the displayed color component or brightness, for example, the range of the red (R), green (G), and blue (B) components of the color image is 0 to 255; or, gray The gradation range of the luminance of the gray-level image may range from 0 to 255, as will be understood by those of ordinary skill in the art to which the present invention pertains.
本發明全文所述之「機率分布」(probability distribution),係指一影像中所有像素之色階範圍機率分布,亦即該影像各像素所屬色階之分布情形,例如:一灰階影像之色階範圍為0~255(即256個色階),則其機率分布包含以下資訊:色階為0之像素數目、色階為1之像素數目、色階為2之像素數目……以及色階為255之像素數目,係本發明所屬技術領域中具有通常知識者可以理解。The "probability distribution" as used throughout the present invention refers to the probability distribution of the color gradation range of all pixels in an image, that is, the distribution of the gradation of each pixel of the image, for example, the color of a grayscale image. The order range is 0~255 (that is, 256 levels), then the probability distribution includes the following information: the number of pixels with gradation of 0, the number of pixels with gradation of 1, the number of pixels with gradation of 2, and the color gradation A number of pixels of 255 is understood by those of ordinary skill in the art to which the present invention pertains.
請參閱第1圖所示,其係本發明水位量測方法較佳實施例之系統架構圖。其中,藉由至少一監控鏡頭1(例如:習知監視攝影機、網路攝影機或夜間紅外線攝影機等)連接一電腦系統2(例如習知電腦主機、檔案伺服器或雲端伺服器等)作為執行架構,該至少一監控鏡頭1係可拍攝取得一原始影像(original image)A,例如:單一(single)或連續(continued)影像等,該原始影像A可為彩色或灰階影像,該原始影像A包含數個像素,各像素具有一色階,該色階可表示的數值範圍為該影像的色階範圍。該電腦系統2係耦接該至少一監控鏡頭1,以接收該原始影像A,並據以執行本發明水位量測方法較佳實施例所揭示的運作流程,可量測該至少一監控鏡頭1所處地區之積淹水水位高度。在此實施例中,該原始影像A係以單一彩色影像作 為實施態樣進行後續說明,惟不以此為限,依此類推,可應用於黑白或連續影像之水位量測,其係本發明所屬技術領域中具有通常知識者可以理解,在此容不贅述。Please refer to FIG. 1 , which is a system architecture diagram of a preferred embodiment of the water level measurement method of the present invention. Wherein, a computer system 2 (for example, a conventional computer host, a file server, or a cloud server) is connected as an execution architecture by at least one monitoring lens 1 (for example, a conventional surveillance camera, a network camera, or a nighttime infrared camera). The at least one monitoring lens 1 can capture an original image A, such as a single or continuous image, and the original image A can be a color or grayscale image. The original image A There are several pixels, each pixel has a color gradation, and the range of values that can be represented by the color gradation is the gradation range of the image. The computer system 2 is coupled to the at least one monitoring lens 1 to receive the original image A, and according to the operation flow disclosed in the preferred embodiment of the water level measuring method of the present invention, the at least one monitoring lens 1 can be measured. The height of the flooded water level in the area. In this embodiment, the original image A is made in a single color image. For the following description of the implementation, but not limited thereto, and the like, it can be applied to the water level measurement of black and white or continuous image, which can be understood by those having ordinary knowledge in the technical field to which the present invention pertains. Narration.
此外,該至少一監控鏡頭1與該電腦系統2之間較佳串聯連接一影像伺服器3,供接收彙整該至少一監控鏡頭1所拍攝之原始影像A,並據以進行時間取樣處理或影像壓縮處理,再將處理過後之原始影像A轉傳至該電腦系統2。藉此,可避免當該至少一監控鏡頭1之數量過高、或者拍攝之原始影像A長度過長時,所形成之影像檔案大小過大,造成該電腦系統2不堪負荷。In addition, an image server 3 is preferably connected in series between the at least one monitoring lens 1 and the computer system 2 for receiving and collecting the original image A captured by the at least one monitoring lens 1 and performing time sampling processing or imaging. The compressed image is processed, and the processed original image A is transferred to the computer system 2. Thereby, it can be avoided that when the number of the at least one monitoring lens 1 is too high, or the length of the original image A taken is too long, the formed image file size is too large, causing the computer system 2 to be unloaded.
請參閱第2圖所示,其係本發明水位量測方法較佳實施例之運作流程圖。其中,該水位量測方法包含一影像讀取步驟S1、一灰階處理步驟S2、一影像強化步驟S3、一影像校正步驟S4、一濾波處理步驟S5以及一水位估算步驟S6,分別敘述如後。Please refer to FIG. 2, which is a flow chart of the operation of the preferred embodiment of the water level measuring method of the present invention. The water level measurement method includes an image reading step S1, a grayscale processing step S2, an image enhancement step S3, an image correction step S4, a filtering processing step S5, and a water level estimation step S6, respectively .
該影像讀取步驟S1,首先係藉由該電腦系統2讀入一原始影像A,在本實施例當中該原始影像A為一RGB影像,且該原始影像A之色階範圍為0~255,惟本發明不以此為限。該原始影像A由一監控鏡頭1所攝錄,而該監控鏡頭1設置於一固定位置運作,因此該電腦系統2中可預先設定該原始影像A所代表之實際尺寸。該影像讀取步驟S1接著依據該原始影像A之像素大小與其所代表之實際尺寸計算出一影像比例尺△H,可供換算任意像素值所代表之實際尺寸。例如,假設一監控鏡頭1所拍攝之原始影像A包含一司令台,已知該司令台實際高度為500公分, 若該電腦系統2讀入該原始影像A且測量出該司令台之高度為100像素,則可推算出一個像素代表5公分,該影像比例尺△H即為5(cm/pixel)。當該影像讀取步驟S1完成後,開始進行該灰階處理步驟S2。In the image reading step S1, the original image A is read by the computer system 2, and in the embodiment, the original image A is an RGB image, and the gradation range of the original image A is 0 to 255. However, the invention is not limited thereto. The original image A is recorded by a monitoring lens 1 and the monitoring lens 1 is disposed at a fixed position. Therefore, the actual size represented by the original image A can be preset in the computer system 2. The image reading step S1 then calculates an image scale ΔH according to the pixel size of the original image A and the actual size represented by the original image A, which can be used to convert the actual size represented by the arbitrary pixel value. For example, suppose that the original image A taken by a surveillance lens 1 includes a commander station, and the actual height of the commander is known to be 500 cm. If the computer system 2 reads the original image A and measures the height of the command platform to be 100 pixels, it can be inferred that one pixel represents 5 cm, and the image scale ΔH is 5 (cm/pixel). When the image reading step S1 is completed, the grayscale processing step S2 is started.
該灰階處理步驟S2,係對該原始影像A進行灰階處理,主要原理乃依據該原始影像A各像素之紅色、綠色、藍色分量的色階,將該原始影像A色調平均轉換到色階範圍為0~255之灰階影像之色階,該色調轉換方式較佳如下式(1)所示:f(x,y)=0.299×R(x,y)+0.587×G(x,y)+0.114×B(x,y) (1)其中(x,y)為像素座標值,f(x,y)為灰階影像之色階,R(x,y)、G(x,y)、B(x,y)代表紅、綠、藍三種色域。該原始影像A經過轉換過後形成一灰階影像,色彩單一較容易處理。The grayscale processing step S2 performs gray scale processing on the original image A. The main principle is to convert the original image A tones to the color according to the color gradations of the red, green and blue components of each pixel of the original image A. The tone scale of the grayscale image is in the range of 0 to 255. The tone conversion mode is preferably as shown in the following formula (1): f(x, y) = 0.299 × R (x, y) + 0.587 × G (x, y)+0.114×B(x,y) (1) where (x,y) is the pixel coordinate value, f(x,y) is the color scale of the grayscale image, R(x,y), G(x, y), B(x, y) represent three color gamuts of red, green and blue. The original image A is converted to form a grayscale image, and the color is relatively easy to process.
該影像強化步驟S3係對該灰階影像進行影像強化處理,得到一強化影像,主要原理是將該灰階影像的色階範圍機率分佈,平均轉換至0~255,藉以強化該灰階影像之對比值。例如,若一灰階影像之機率分布區域位於25~155之間,係屬於畫面偏暗之情形,經由該影像強化步驟S3可將其機率分佈區域調整為0~255,以利後續步驟對其細節進行判讀。由於該監控鏡頭1所拍攝之原始影像A的畫面品質十分容易受到天候、時間等因素的影響,導致影像模糊、生成雜訊、整體色調過亮或過暗,因此經由該影像強化步驟S3進行影像強化處理後,較能精確觀察觀察細部變化。The image enhancement step S3 performs image enhancement processing on the grayscale image to obtain a enhanced image. The main principle is that the gray scale image probability distribution of the grayscale image is averaged to 0~255, thereby strengthening the grayscale image. Contrast value. For example, if the probability distribution area of a grayscale image is between 25 and 155, which is a case where the screen is dark, the probability distribution area can be adjusted to 0 to 255 via the image enhancement step S3, so as to facilitate subsequent steps. The details are interpreted. Since the picture quality of the original image A captured by the monitoring lens 1 is very susceptible to weather, time, and the like, resulting in image blur, noise generation, and overall hue is too bright or too dark, the image is enhanced through the image enhancement step S3. After the intensive treatment, it is more accurate to observe the changes in the details.
請參閱第2及3圖所示,第3圖係為本發明水位量測 方法較佳實施例之影像校正步驟S4之內部流程圖,該影像校正步驟S4之包含一水平校正子步驟S41及一判斷區塊圈選子步驟S42。該水平校正子步驟S41係對該強化影像進行水平校正,以得到一水平影像,由於該至少一監控鏡頭1的視角通常不是水平直視著待偵測物,故需要校正待偵測物成水平,以方便偵測淹水深度。請再參照第4圖所示,該至少一監控鏡頭1皆設置於一固定位置運作,因此該電腦系統2中針對任一監控鏡頭1皆已預設一水平校正角度θ,該水平校正角度θ係為該監控鏡頭1之視角V與一地平線G之夾角,利用該水平校正角度θ可分別對來自每一監控鏡頭1之影像進行水平校正,該水平校正方式如下式(2)所示:x' =x cos(θ)+y sin(θ)y' =-x sin(θ)+y cos(θ) (2)其中(x,y)為該強化影像之像素座標值,(x’,y’)為該水平影像之像素座標值。該水平校正子步驟S41係可選擇性執行,例如當一監控鏡頭1水平直視待偵測物時,其強化影像即為一水平影像,該電腦系統2中係預設該水平校正角度θ等於零,即省略該水平校正子步驟S41。該判斷區塊圈選子步驟S42係自該水平影像當中選取一判斷區塊R,該判斷區塊R之大小為M×N像素,亦即該判斷區塊R之水平方向寬度共有M個像素,垂直方向長度共有N個像素,且該判斷區塊R之大小較佳占該原始影像A之百分之五以上。此外,該判斷區塊影像R中包含一地平線G,其中,該地平線G所處之實際高度為Ht (cm),而該地平線G之水平高度座標值為H0 ,亦即該地平線G位於該判斷區塊 R中垂直位置之第H0 像素,且0≦H0 <N。Referring to FIG. 2 and FIG. 3, FIG. 3 is an internal flowchart of the image correcting step S4 of the preferred embodiment of the water level measuring method of the present invention. The image correcting step S4 includes a horizontal correcting sub-step S41 and a The judgment block circle selection sub-step S42. The horizontal correction sub-step S41 is to perform horizontal correction on the enhanced image to obtain a horizontal image. Since the angle of view of the at least one monitoring lens 1 is not directly horizontally looking at the object to be detected, it is necessary to correct the level of the object to be detected. To facilitate the detection of flooding depth. Referring to FIG. 4 again, the at least one monitoring lens 1 is disposed at a fixed position. Therefore, the computer system 2 has preset a horizontal correction angle θ for any of the monitoring lenses 1, and the horizontal correction angle θ The angle between the viewing angle V of the monitoring lens 1 and a horizon G is used to correct the image from each of the monitoring lenses 1 by using the horizontal correction angle θ, and the horizontal correction mode is as shown in the following formula (2): x ' = x cos(θ)+ y sin(θ) y' =- x sin(θ)+ y cos(θ) (2) where (x,y) is the pixel coordinate value of the enhanced image, (x', y') is the pixel coordinate value of the horizontal image. The horizontal correction sub-step S41 is selectively executable. For example, when a monitoring lens 1 is directly viewed from the object to be detected, the enhanced image is a horizontal image. The computer system 2 presets the horizontal correction angle θ to be equal to zero. That is, the horizontal correction sub-step S41 is omitted. The determining block circle selection sub-step S42 selects a determination block R from the horizontal image, and the size of the determination block R is M×N pixels, that is, the horizontal width of the determination block R has a total of M pixels. The length of the vertical direction has a total of N pixels, and the size of the determination block R preferably accounts for more than five percent of the original image A. In addition, the determination block image R includes a horizon G, wherein the actual height of the horizon G is H t (cm), and the horizontal height coordinate value of the horizon G is H 0 , that is, the horizon G is located. The judgment is the H 0th pixel of the vertical position in the block R, and 0 ≦ H 0 <N.
該濾波處理步驟S5,係針對該判斷區塊R部分進行濾波處理,主要原理是利用一遮罩對該判斷區塊R進行偵測比對,該遮罩為一習知中位數濾波器(median filter)遮罩,且該遮罩大小較佳為1×(M/2),M/2即為該判斷區塊R之寬度的一半,該判斷區塊R之像素會被該遮罩內的中間值所取代。藉此,可降低該判斷區塊R之雜訊,且由於水位通常僅水平上升或下降運動,因此該濾波處理過程不會濾掉水位資訊成分,經由該濾波處理之判斷區塊R能夠更有效率地估計水位高度。藉由上述步驟,可對該原始影像A之判斷區塊R進行連續影像處理過程,該濾波處理步驟S5最終產生一後製影像B,該後製影像B為一大小為M×N像素且色階範圍為0~255之灰階影像,供後續步驟進行水位估算。該濾波處理步驟S5係可選擇性執行,例如當一原始影像A足夠清晰,並未包含可能影響後續步驟運算結果之雜訊時,無須針對該原始影像A中所選出之判斷區塊R進行濾波處理,因此可省略本步驟,該判斷區塊R即為一後製影像B。The filtering processing step S5 performs filtering processing on the R portion of the determining block, and the main principle is to perform a detection comparison on the determining block R by using a mask, which is a conventional median filter ( Median filter), and the size of the mask is preferably 1×(M/2), and M/2 is half of the width of the determination block R, and the pixel of the determination block R is covered by the mask. Replaced by the intermediate value. Thereby, the noise of the determination block R can be reduced, and since the water level usually only rises or falls horizontally, the filtering process does not filter out the water level information component, and the determination block R can be further provided through the filtering process. Evaluate the water level efficiently. Through the above steps, the continuous image processing process can be performed on the determination block R of the original image A. The filtering processing step S5 finally generates a post-production image B, which is a size of M×N pixels and color. A grayscale image with a range of 0 to 255 for subsequent water level estimation. The filtering processing step S5 is selectively executable. For example, when an original image A is sufficiently clear and does not contain noise that may affect the operation result of the subsequent step, it is not necessary to filter the determination block R selected in the original image A. Processing, so this step can be omitted, and the determination block R is a post-production image B.
請參閱第2及5圖所示,第5圖係為本發明水位量測方法較佳實施例之水位估算步驟S6之內部流程圖,該水位估算步驟S6包含一邊界估算子步驟S61、一邊界投影子步驟S62、一水位判定子步驟S63與一結果計算子步驟S64,該邊界估算子步驟S61係為一種梯度運算子邊緣搜尋法,主要原理係計算該後製影像B中各像素之影像梯度(gradient)值G,並依據該影像梯度值G計算各該像素之影
像邊界值E。該影像邊界值E為1或0,分別代表一像素為一邊界或並非一邊界。該影像梯度值G與影像邊界值E之計算方法如下式(3)、(4)與(5)所示:
該邊界投影子步驟S62係將該後製影像B中,一水平高度之影像邊界值E投影累加,以產生一邊界投影值I,並依據該邊界投影值I判定該水平高度是否為一邊界位置。該投影累加方式以及邊界位置判定方法如下式(6)與(7)所示:
若該後製影像B於該邊界投影子步驟S62僅產生一邊界位置H,則該水位判定子步驟S63直接設定該邊界位置H為一水面位置。然而,該後製影像B中除了水面外,尚可能有其它標的物被判定為邊界位置H,例如經過之路人、車輛或其它遮蔽物體等,導致該邊界投影子步驟S62所產生之邊界位置H的數量超過一個。因此為求更精準地估算水位,該水位判定子步驟S63可針對複數個邊界位置H進行分析比較,主要原理係比較該電腦系統2於不同時間所接收之原始影像A,該不同時間所接收之原始影像A所產生之後製影像B經由該邊界投影子步驟S62,係分別產生複數個邊界位置H,由於淹水時水位通常會隨時間上升或消退,因此水面在各該後製影像B中應屬一變動之邊界位置H,藉由比較該複數個邊界位置H,可排除維持於固定高度之邊界位置H,僅保存隨時間變動之邊界位置H, 並設定為一水面位置。If the post-image B generates only a boundary position H in the boundary projection sub-step S62, the water level determining sub-step S63 directly sets the boundary position H to a water surface position. However, in addition to the water surface, the post-production image B may have other objects determined as boundary positions H, such as passers-by, vehicles or other obscured objects, etc., resulting in the boundary position H generated by the boundary projection sub-step S62. The number is more than one. Therefore, in order to estimate the water level more accurately, the water level determining sub-step S63 can analyze and compare the plurality of boundary positions H. The main principle is to compare the original image A received by the computer system 2 at different times, and the different time is received. After the original image A is generated, the image B is generated by the boundary projection sub-step S62, and a plurality of boundary positions H are respectively generated. Since the water level generally rises or falls with time during flooding, the water surface should be in each of the post-images B. By changing the boundary position H, by comparing the plurality of boundary positions H, the boundary position H maintained at a fixed height can be excluded, and only the boundary position H that changes with time is saved. And set to a water surface position.
該結果計算子步驟S64係將該水面位置與該地平線G之水平高度座標值H0 進行比較運算,並依據該地平線G所處之實際高度為Ht(cm)與該影像比例尺△H(cm/pixel),計算出該水面位置所代表之實際高度。例如,當前述步驟判定出一邊界位置H為一水面位置時,該水面位置所代表之實際高度即為Ht +(H-H0 )×△H(cm),係為該監控鏡頭1所所拍攝地區之積淹水水位高度。The result calculation sub-step S64 compares the water surface position with the horizontal height coordinate value H 0 of the horizon G, and according to the actual height at which the horizon G is located, Ht (cm) and the image scale ΔH (cm/ Pixel), calculate the actual height represented by the water surface position. For example, when the foregoing step determines that a boundary position H is a water surface position, the actual height represented by the water surface position is H t +(HH 0 )×ΔH(cm), which is taken by the monitoring lens 1. The height of the flooded water level in the area.
綜上所述,本發明之水位量測方法始於該影像讀取步驟S1,係由該電腦系統2讀入一原始影像A,經由該灰階處理步驟S2、影像強化步驟S3、影像校正步驟S4與濾波處理S5等後續步驟,對該原始影像A進行影像分析處理以產生一後製影像B,再交由該水位估算步驟S6運算得到一水位高度,係為該原始影像A中的淹水高度。據此,發明之水位量測方法可達成透過影像分析處理技術計算水位高度之目的。In summary, the water level measurement method of the present invention starts from the image reading step S1, in which the computer system 2 reads an original image A, through the grayscale processing step S2, the image enhancement step S3, and the image correction step. Subsequent steps such as S4 and filtering processing S5, performing image analysis processing on the original image A to generate a post-production image B, and then performing the water level estimating step S6 to obtain a water level height, which is the flooding in the original image A. height. Accordingly, the invented water level measurement method can achieve the purpose of calculating the water level height through image analysis processing technology.
藉此,本發明水位量測方法較佳實施例僅需藉由該監控鏡頭1所提供之原始影像A配合一電腦系統2即可量測出水位高度,成本相較於習知接觸式或非接觸式水位量測裝置大幅減低,且該監控鏡頭1係為習知監視攝影機或網路攝影機,因此能夠大量設置以進行大範圍監控。Therefore, the preferred embodiment of the water level measuring method of the present invention only needs to measure the water level height by using the original image A provided by the monitoring lens 1 in conjunction with a computer system 2, and the cost is compared with the conventional contact type or non- The contact type water level measuring device is greatly reduced, and the monitoring lens 1 is a conventional monitoring camera or a network camera, and thus can be installed in a large amount for large-scale monitoring.
再者,本發明水位量測方法較佳實施例使用影像辨識方式,辨識一影像中水位與四周景物的相對關係,即可找出水面位置並據以計算水位高度,因此可準確量測淹水時的水位,不受水體顏色與水中漂流物影響。Furthermore, the preferred embodiment of the water level measuring method of the present invention uses an image recognition method to identify the relative relationship between the water level and the surrounding scenery in an image, thereby finding the water surface position and calculating the water level height, thereby accurately measuring the flooding. The water level at the time is not affected by the color of the water and the drifting water.
此外,本發明水位量測方法較佳實施例已於該原始影像A中取出一判斷區塊R,據該判斷區塊R產生一後製影像B,再針對該後製影像B使用一梯度運算子邊緣搜尋法,以進行邊界偵測估算,相較未選取判斷區塊R直接套用該梯度運算子邊緣搜尋法的情形,節省大量運算過程,是故,運算速度可大幅提升。In addition, in the preferred embodiment of the water level measurement method of the present invention, a determination block R is taken out from the original image A, and a post-production image B is generated according to the determination block R, and a gradient operation is performed on the post-production image B. The sub-edge search method is used to estimate the boundary detection. Compared with the unselected decision block R, the gradient operation sub-edge search method is directly applied, which saves a large number of calculation processes. Therefore, the operation speed can be greatly improved.
本發明水位量測方法較佳實施例,僅需藉由分析處理一影像,即可快速而有效地量測該影像中的水位高度,因此,可以提高影像還原品質及壓縮效率,進而達到「降低系統設置成本」、「增加水位量測準確性」及「提升運算速度」等功效。In the preferred embodiment of the water level measuring method of the present invention, the water level in the image can be quickly and effectively measured by analyzing and processing an image, thereby improving image restoration quality and compression efficiency, thereby achieving "lowering" System setup cost, "increasing water level measurement accuracy" and "improving operation speed".
雖然本發明已利用上述較佳實施例揭示,然其並非用以限定本發明,任何熟習此技藝者在不脫離本發明之精神和範圍之內,相對上述實施例進行各種更動與修改仍屬本發明所保護之技術範疇,因此本發明之保護範圍當視後附之申請專利範圍所界定者為準。While the invention has been described in connection with the preferred embodiments described above, it is not intended to limit the scope of the invention. The technical scope of the invention is protected, and therefore the scope of the invention is defined by the scope of the appended claims.
〔本發明〕〔this invention〕
1‧‧‧監控鏡頭1‧‧‧Monitor lens
2‧‧‧電腦系統2‧‧‧ computer system
3‧‧‧影像伺服器3‧‧‧Image Server
A‧‧‧原始影像A‧‧‧ original image
R‧‧‧判斷區塊R‧‧‧Judgement block
B‧‧‧後製影像B‧‧‧post image
S1‧‧‧影像讀取步驟S1‧‧‧Image reading step
S2‧‧‧灰階處理步驟S2‧‧‧ Grayscale processing steps
S3‧‧‧影像強化步驟S3‧‧‧ Image Enhancement Steps
S4‧‧‧影像校正步驟S4‧‧‧Image correction procedure
S41‧‧‧水平校正子步驟S41‧‧‧Level Correction Substep
S42‧‧‧判斷區塊圈選子步驟S42‧‧‧Judgement block circle selection substep
S5‧‧‧濾波處理步驟S5‧‧‧Filter processing steps
S6‧‧‧水位估算步驟S6‧‧‧ water level estimation steps
S61‧‧‧邊界估算子步驟S61‧‧‧Boundary estimation substep
S62‧‧‧邊界投影子步驟S62‧‧‧Boundary projection substep
S63‧‧‧水位判定子步驟S63‧‧‧ Water level determination sub-step
S64‧‧‧結果計算子步驟S64‧‧‧Result calculation substeps
V‧‧‧監控鏡頭之視角V‧‧‧Viewing the angle of the lens
G‧‧‧地平線G‧‧‧Horizon
θ‧‧‧水平校正角度Θ‧‧‧ horizontal correction angle
H0 ‧‧‧地平線之水平高度座標值H 0 ‧‧‧Horizontal height coordinate value
Ht ‧‧‧地平線代表之實際高度H t ‧‧‧The actual height of the horizon
H‧‧‧邊界位置H‧‧‧Boundary position
△H‧‧‧影像比例尺△H‧‧‧image scale
第1圖:本發明水位量測方法較佳實施例之系統架構圖Figure 1 is a system architecture diagram of a preferred embodiment of the water level measurement method of the present invention
第2圖:本發明水位量測方法較佳實施例之運作流程圖Figure 2 is a flow chart showing the operation of the preferred embodiment of the water level measuring method of the present invention
第3圖:本發明水位量測方法較佳實施例之影像校正步驟之內部流程圖Figure 3: Internal flow chart of the image correction step of the preferred embodiment of the water level measurement method of the present invention
第4圖:本發明水位量測方法較佳實施例之監控鏡頭示意圖4 is a schematic view of a monitoring lens of a preferred embodiment of the water level measuring method of the present invention
第5圖:本發明水位量測方法較佳實施例之水位估算步驟之內部流程圖Figure 5: Internal flow chart of the water level estimation step of the preferred embodiment of the water level measurement method of the present invention
S1‧‧‧影像讀取步驟S1‧‧‧Image reading step
S2‧‧‧灰階處理步驟S2‧‧‧ Grayscale processing steps
S3‧‧‧影像強化步驟S3‧‧‧ Image Enhancement Steps
S4‧‧‧影像校正步驟S4‧‧‧Image correction procedure
S5‧‧‧濾波處理步驟S5‧‧‧Filter processing steps
S6‧‧‧水位估算步驟S6‧‧‧ water level estimation steps
Claims (11)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW101140546A TWI465699B (en) | 2012-11-01 | 2012-11-01 | Method of water level measurement |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW101140546A TWI465699B (en) | 2012-11-01 | 2012-11-01 | Method of water level measurement |
Publications (2)
Publication Number | Publication Date |
---|---|
TW201418671A TW201418671A (en) | 2014-05-16 |
TWI465699B true TWI465699B (en) | 2014-12-21 |
Family
ID=51294271
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW101140546A TWI465699B (en) | 2012-11-01 | 2012-11-01 | Method of water level measurement |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI465699B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI731706B (en) * | 2020-06-04 | 2021-06-21 | 中原大學 | Measuring device and system for water level and method thereof |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI590196B (en) * | 2016-06-06 | 2017-07-01 | 財團法人成大水利海洋研究發展文教基金會 | Method for detecting of liquid |
TWI573099B (en) * | 2016-09-09 | 2017-03-01 | 義守大學 | Method of regional water level measurement |
CN113744325B (en) * | 2021-09-06 | 2024-04-26 | 中国地质科学院勘探技术研究所 | Liquid level detection device and method based on image recognition technology |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW200913673A (en) * | 2007-09-07 | 2009-03-16 | Lite On Technology Corp | Device and method for obtain a clear image |
TW201003045A (en) * | 2008-07-03 | 2010-01-16 | Univ Nat Central | Measurement method for the height of a liquid surface |
TW201030324A (en) * | 2009-02-09 | 2010-08-16 | Nat Applied Res Laboratories | An identification method for liquid level |
CN101901342A (en) * | 2009-05-27 | 2010-12-01 | 深圳迈瑞生物医疗电子股份有限公司 | Method and device for extracting image target region |
TW201124711A (en) * | 2010-01-15 | 2011-07-16 | Univ Nat Central | Monitoring system and method for water quality and quantity |
-
2012
- 2012-11-01 TW TW101140546A patent/TWI465699B/en not_active IP Right Cessation
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW200913673A (en) * | 2007-09-07 | 2009-03-16 | Lite On Technology Corp | Device and method for obtain a clear image |
TW201003045A (en) * | 2008-07-03 | 2010-01-16 | Univ Nat Central | Measurement method for the height of a liquid surface |
TW201030324A (en) * | 2009-02-09 | 2010-08-16 | Nat Applied Res Laboratories | An identification method for liquid level |
CN101901342A (en) * | 2009-05-27 | 2010-12-01 | 深圳迈瑞生物医疗电子股份有限公司 | Method and device for extracting image target region |
TW201124711A (en) * | 2010-01-15 | 2011-07-16 | Univ Nat Central | Monitoring system and method for water quality and quantity |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI731706B (en) * | 2020-06-04 | 2021-06-21 | 中原大學 | Measuring device and system for water level and method thereof |
Also Published As
Publication number | Publication date |
---|---|
TW201418671A (en) | 2014-05-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20140125801A1 (en) | On-line tunnel deformation monitoring system based on image analysis and its application | |
CN103763515B (en) | A kind of video abnormality detection method based on machine learning | |
JP4767240B2 (en) | Method and apparatus for detecting video boundary and computer-readable recording medium embodying the same | |
WO2020110576A1 (en) | Information processing device | |
CN102404602A (en) | Vidicon definition detection method based on definition test card | |
TWI465699B (en) | Method of water level measurement | |
JP7387261B2 (en) | Information processing device, information processing method and program | |
CN112801947A (en) | Visual detection method for dead pixel of LED display terminal | |
JP2012098045A (en) | Crack detector and crack detection program | |
CN112348804A (en) | Method, system and device for monitoring crack caused by foundation pit displacement and storage medium | |
JP2013117409A (en) | Crack detection method | |
CN114092437B (en) | Transformer leakage oil detection method | |
TWI481824B (en) | Method of water level surveillance | |
RU2636681C2 (en) | Extended analysis for image-based evaluation of v-ribbed belt wear | |
CN110728212A (en) | Road well lid monitoring device and method based on computer vision | |
TWI487884B (en) | Method of water level measurement | |
Powell et al. | Automated road distress detection | |
KR101744409B1 (en) | Method and apparatus for detecting water level based on camera in low illumination environment | |
CN114723691B (en) | Method for detecting oil leakage fault degree of hydraulic system based on artificial intelligence | |
CN111307267A (en) | Conductor galloping monitoring method based on concentric circle detection | |
CN116071323A (en) | Rain intensity measuring method based on camera parameter normalization | |
KR101267279B1 (en) | Video processing apparatus and method for removing rain from video | |
CN110533698B (en) | Foundation pit construction pile detection control method based on visual detection | |
TWI573099B (en) | Method of regional water level measurement | |
TWI594212B (en) | Remote monitoring of water conservancy facilities |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
MM4A | Annulment or lapse of patent due to non-payment of fees |