TWI666426B - Liquid level detecting method - Google Patents

Liquid level detecting method Download PDF

Info

Publication number
TWI666426B
TWI666426B TW107138035A TW107138035A TWI666426B TW I666426 B TWI666426 B TW I666426B TW 107138035 A TW107138035 A TW 107138035A TW 107138035 A TW107138035 A TW 107138035A TW I666426 B TWI666426 B TW I666426B
Authority
TW
Taiwan
Prior art keywords
image
value
height
liquid surface
liquid level
Prior art date
Application number
TW107138035A
Other languages
Chinese (zh)
Other versions
TW202016512A (en
Inventor
Yuan Hsiang Lin
林淵翔
Chao Chin Chang
張朝欽
Shi Wei Lin
林世為
Chun Yi Yeh
葉君頤
Original Assignee
National Taiwan University Of Science And Technology
國立臺灣科技大學
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 National Taiwan University Of Science And Technology, 國立臺灣科技大學 filed Critical National Taiwan University Of Science And Technology
Priority to TW107138035A priority Critical patent/TWI666426B/en
Application granted granted Critical
Publication of TWI666426B publication Critical patent/TWI666426B/en
Publication of TW202016512A publication Critical patent/TW202016512A/en

Links

Landscapes

  • Measurement Of Levels Of Liquids Or Fluent Solid Materials (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

一種液面高度偵測方法,用於偵測從一焊料槽內部向上湧起之一焊料波的一液面高度。此方法先以一影像擷取裝置從焊料槽側面擷取一待測影像,並從此待測影像中選取一感興趣區域。再根據此感興趣區域之一亮度資料及一環境光色,從複數量測流程中選擇一適當的量測流程。執行所選擇的量測流程,以取得在該待測影像中代表該液面高度的一像素值,並將此像素值轉換為波焊現場的一現實高度量測值。此方法利用非接觸式的即時影像分析,能適應不同亮度下的動態變化液面,在色光干擾下亦能取得一精確的量測結果。A liquid surface height detection method is used to detect a liquid surface height of a solder wave rising from the inside of a solder bath. In this method, an image capturing device is first used to capture an image to be tested from the side of the solder bath, and a region of interest is selected from the image to be tested. An appropriate measurement process is selected from the complex measurement process based on the brightness data of an area of interest and an ambient light color. The selected measurement process is performed to obtain a pixel value representing the height of the liquid surface in the image to be measured, and the pixel value is converted into a real height measurement value at the wave welding site. This method uses non-contact real-time image analysis, which can adapt to the dynamic change of liquid surface under different brightness, and can obtain an accurate measurement result under the interference of colored light.

Description

液面高度偵測方法Level detection method

本發明與一種液面高度偵測方法有關,特別是與一種利用視覺化的影像來偵測液面高度的方法有關。The invention relates to a method for detecting the height of a liquid surface, and more particularly to a method for detecting the height of a liquid surface using a visualized image.

目前市面上高功率電路的印刷電路板(Printed Circuit Board, PCB)仍以雙列直插封裝(Dual In-line Package, DIP)元件為主要之設計,而DIP元件的焊接仍以波焊(Wave Soldering)為主。At present, the printed circuit board (PCB) of high-power circuits on the market still uses dual in-line package (DIP) components as the main design, and the welding of DIP components is still wave soldering (Wave Soldering).

圖1為習知的波焊系統示意圖。習知的波焊系統100包括一輸送軌道110、一助焊劑噴嘴120、一預熱器130、一焊料槽140、一風扇150及一中央控制器160。插裝了雙列直插封裝元件172的印刷電路板170置於輸送軌道110上,經過了助焊劑噴嘴120噴塗助焊劑,再以預熱器130預熱之後,再經過焊料槽140上方進行波焊。波焊時將熔融的液態焊料,借助於泵浦的作用,在焊料槽140液面形成一特定形狀的焊料波。印刷電路板170以一特定的角度以及一特定的浸入深度穿過焊料波的波峰,而實現焊點焊接的過程。FIG. 1 is a schematic diagram of a conventional wave welding system. The conventional wave soldering system 100 includes a conveying rail 110, a flux nozzle 120, a preheater 130, a solder tank 140, a fan 150, and a central controller 160. The printed circuit board 170 in which the DIP package element 172 is inserted is placed on the conveying rail 110, sprayed with flux through the flux nozzle 120, and preheated by the preheater 130, and then waved over the solder tank 140. weld. During wave soldering, a liquid solder having a specific shape is formed on the liquid surface of the solder bath 140 by means of a pump by means of a pump. The printed circuit board 170 passes through the crest of the solder wave at a specific angle and a specific immersion depth, thereby realizing the process of solder joint welding.

然而,在波焊過程中,可能因為焊料表面氧化而形成焊料渣的堆積並阻塞泵浦,或是因焊接時之消耗,而造成焊料波高度下降。焊料波高度不穩定會影響到焊接品質,造成焊點拉尖、氣泡、針孔、焊點橋接或短路等問題。為了維持焊接品質,需快速地偵測焊料波的液面高度,以及即時調整。However, during the wave soldering process, the solder surface may be oxidized to cause the accumulation of solder slag and block the pump, or the consumption during soldering may cause the solder wave height to decrease. The highly unstable solder wave will affect the welding quality, causing problems such as solder point sharpening, air bubbles, pin holes, solder bridge or short circuit. In order to maintain soldering quality, the liquid level of the solder wave needs to be detected quickly and adjusted in real time.

目前偵測液面高度方式,主要為以下三類:The current detection methods of liquid level are mainly the following three types:

一、用人眼目測耐高溫玻璃測量板來觀察液面高度。但此方法過度依賴人工的判斷,同時也需要安排人力隨時在高溫環境中注意液面的變化。First, use human eyes to visually observe the high temperature resistant glass measuring plate to observe the liquid level. However, this method relies too much on manual judgment, and at the same time, it is necessary to arrange manpower to pay attention to the liquid level change at any time in a high temperature environment.

二、使用市面上販售之錫波高度量測專用接觸式感測器。接觸式的感測器需接觸液面,因此難以選擇適當的架設位置。並且,其量測範圍僅有接觸到的部分,無法量測到焊料波表面上不同位置的液面高度之變化。2. Use the tin wave height measurement special contact sensor sold on the market. The contact type sensor needs to contact the liquid surface, so it is difficult to select an appropriate mounting position. In addition, the measurement range is only the contacted part, and it is impossible to measure the change of the liquid surface height at different positions on the solder wave surface.

三、使用市面上販售之錫波高度量測專用非接觸式感測器,通常為雷射及超音波量測,需裝置在液面上方。如圖1所示,一非接觸感測器180裝設於焊料槽140上方,由上往下發射雷達光或超音波到達穩定液面計算反射時間差,對於動態波動的液面,無法提供精確而穩定的液面高度量測結果。另有一習知的非接觸式感測器是透過渦電流(Eddy current)進行量測,其量測距離需在15mm以內,因此限制了架設位置。且量測位置僅限於感測器正下方的液面高度變化,無法得到整個液體表面的高度變化。3. Use the non-contact sensor special for tin wave height measurement on the market, usually laser and ultrasonic measurement, which need to be installed above the liquid surface. As shown in FIG. 1, a non-contact sensor 180 is installed above the solder tank 140, and emits radar light or ultrasonic waves from the top to the bottom to reach the stable liquid surface to calculate the reflection time difference. For a dynamically fluctuating liquid surface, it cannot provide accurate and accurate Stable level measurement results. Another conventional non-contact sensor is measured by Eddy current, and its measurement distance needs to be within 15mm, so the installation position is limited. And the measurement position is limited to the height change of the liquid surface directly below the sensor, and the height change of the entire liquid surface cannot be obtained.

有鑑於此,本案發明人改善了非接觸式的液面高度量測方法,期能解決上述各種習知方法的問題。In view of this, the inventor of the present invention has improved a non-contact method for measuring the height of a liquid surface, and hopes to solve the above-mentioned problems of various conventional methods.

本發明之一目的在於提供一種液面高度偵測方法,其感測距離大於習知非接觸式感測器,能使監測人員逺離高溫的焊料槽,同時看見現場實況。It is an object of the present invention to provide a method for detecting the height of a liquid surface, which has a sensing distance greater than that of a conventional non-contact sensor, and can enable a monitoring person to get away from a high-temperature solder bath while seeing the actual situation on the scene.

本發明之另一目的在於提供一種液面高度偵測方法,可適應動態變化的液面,且可精確地量測到焊料波的液面高度。Another object of the present invention is to provide a method for detecting a liquid surface height, which can adapt to a dynamically changing liquid surface and accurately measure the liquid surface height of a solder wave.

為了達到上述目的,本發明提供一種液面高度偵測方法,適用於偵測從一焊料槽內部向上湧起之一焊料波的一液面高度。此方法包括以下步驟:先以一影像擷取裝置從焊料槽的側面擷取一待測影像;從待測影像中選取一感興趣區域;利用一影像處理單元取得感興趣區域之一亮度資料及一環境光色;以一運算單元提供複數量測流程,並且根據亮度資料及環境光色,從複數量測流程中選擇其一;接著,運算單元執行所選擇的量測流程,以取得感興趣區域的一像素值,此像素值係為待測影像中代表該液面高度的像素數目;運算單元提供一轉換係數,並以該轉換係數將像素值轉換為一現實高度量測值;以及利用一使用者介面,顯示現實高度量測值。In order to achieve the above object, the present invention provides a liquid level detection method, which is suitable for detecting a liquid level height of a solder wave rising upward from the inside of a solder tank. The method includes the following steps: first capturing an image to be measured from the side of the solder bath with an image capturing device; selecting an area of interest from the image to be measured; using an image processing unit to obtain brightness data of one of the areas of interest; and An ambient light color; a complex measurement process is provided by an arithmetic unit, and one of the complex measurement processes is selected according to the brightness data and the ambient light color; then, the arithmetic unit executes the selected measurement process to obtain interest A pixel value of the area, which is the number of pixels representing the liquid surface height in the image to be measured; the operation unit provides a conversion coefficient, and uses the conversion coefficient to convert the pixel value into a real height measurement value; and uses A user interface displays actual height measurements.

在一實施例中,提供該轉換係數的步驟包括:以影像擷取裝置從焊料槽的側面擷取一校正用的影像,從校正用的影像取得一校正像素值與一實際液面高度資訊;接著,運算單元根據校正像素值與實際液面高度資訊,求得兩者的一比例轉換資訊,並將比例轉換資訊定義為轉換係數。In one embodiment, the step of providing the conversion coefficient includes: using an image capturing device to capture a correction image from the side of the solder bath, and obtain a correction pixel value and actual liquid level information from the correction image; Then, the arithmetic unit obtains a ratio conversion information of the two based on the corrected pixel value and the actual liquid surface height information, and defines the ratio conversion information as a conversion coefficient.

在一實施例中,環境光色具有一色度座標,色度座標包括一紅色值、一綠色值及一藍色值, 三者的總和為一總色度值,並且複數量測流程包括一第一量測流程及一第二量測流程。可利用以下的判斷步驟來決定要使用那一個量測流程。首先,提供一亮度參考值及一色度比例值;再利用運算單元判斷此亮度資料是否小於亮度參考值;若此亮度資料小於亮度參考值,則提供一光源對焊料波的液面進行照光,再以影像擷取裝置擷取一照光影像以取代待測影像;若此亮度資料大於亮度參考值,則再判斷紅色值佔總色度值的比例是否大於色度比例值;以及若紅色值佔總色度值的比例大於色度比例值,則執行第一量測流程,否則執行第二量測流程。In one embodiment, the ambient light color has a chromaticity coordinate. The chromaticity coordinate includes a red value, a green value, and a blue value. The sum of the three is a total chromaticity value, and the complex measurement process includes a first A measurement process and a second measurement process. You can use the following judgment steps to decide which measurement process to use. First, provide a brightness reference value and a chromaticity ratio value; then use an arithmetic unit to determine whether the brightness data is less than the brightness reference value; if the brightness data is less than the brightness reference value, provide a light source to illuminate the liquid level of the solder wave, and then An image capture device is used to capture a light image to replace the test image; if the brightness data is greater than the brightness reference value, then determine whether the ratio of the red value to the total chroma value is greater than the chroma ratio; and if the red value accounts for the total If the proportion of the chromaticity value is greater than the proportion of the chromaticity value, the first measurement process is performed, otherwise the second measurement process is performed.

在一實施例中,第一量測流程包括:依序對感興趣區域進行一幀差運算、一二值化處理及一形態學處理;接著,辨識焊料波的一邊緣位置;並且根據此邊緣位置,取得前述的像素值。In an embodiment, the first measurement process includes: sequentially performing a frame difference operation, a binarization process, and a morphological process on the region of interest; then, identifying an edge position of the solder wave; and according to the edge Position to obtain the aforementioned pixel value.

在一實施例中,第二量測流程包括:對感興趣區域進行對比加強,得出一對比加強影像,以突顯一反光部分;將對比加強影像依序進行一灰階轉換處理、一二值化處理、一侵蝕膨脤處理及一邊緣偵測處理;從對比加強影像中取得反光部分之一反光像素參考值。另外,對感興趣區域進行對比淡化,得出一對比淡化影像,以突顯一未反光部分;將對比淡化影像進行一負片處理,得出該未反光部分的一負片影像;將此負片影像依序進行一均衡化處理、一二值化處理、一侵蝕膨脤處理及一邊緣偵測處理;再從負片影像中取得未反光部分之一未反光像素參考值。最後,比較反光像素參考值及未反光像素參考值,以得到前述的像素值。In an embodiment, the second measurement process includes: performing contrast enhancement on the region of interest to obtain a contrast-enhanced image to highlight a reflective portion; sequentially performing a gray-scale conversion process, and a binary value on the contrast-enhanced image. Processing, an erosion and expansion process, and an edge detection process; one of the reflective pixel reference values is obtained from the contrast-enhanced image. In addition, contrast-fading is performed on the area of interest to obtain a contrast-fade image to highlight an unreflected portion; the contrast-fade image is processed to a negative to obtain a negative image of the unreflected portion; and the negative image is sequentially An equalization process, a binarization process, an erosion expansion process, and an edge detection process are performed; and an unreflected pixel reference value of one of the unreflected portions is obtained from the negative image. Finally, the reference value of the reflective pixel and the reference value of the non-reflective pixel are compared to obtain the aforementioned pixel value.

在一實施例中,上述的方法還包括:定義一液面高度基準值;以及將現實高度量測值與液面高度基準值進行比較,以得到一高度差。In an embodiment, the method further includes: defining a reference value of the liquid level; and comparing the measured value of the actual height with the reference value of the liquid level to obtain a height difference.

在一實施例,運算單元取得複數像素參考值,其代表焊料波的整體液面上多個不同位置之液面高度,並利用轉換係數將這些像素參考值轉換為多個水平高度值,以形成一液面波動曲線;並將此液面波動曲線顯示於使用者介面中In one embodiment, the arithmetic unit obtains a plurality of pixel reference values, which represent the heights of the liquid surface at a plurality of different positions on the entire liquid surface of the solder wave, and uses a conversion coefficient to convert these pixel reference values into a plurality of horizontal height values to form A liquid level wave curve; displaying the liquid level wave curve in the user interface

本發明利用非接觸式的即時影像分析,在偵測時可以量測到整個液面多個點的水平高度值;且提供了根據高度及環境色光來選擇量測流程的機制,故能適應不同亮度下的動態變化液面,在色光干擾下亦能取得一精確的量測結果。The invention utilizes non-contact real-time image analysis, which can measure the horizontal height values of multiple points on the entire liquid surface during detection; and provides a mechanism for selecting the measurement process according to the height and ambient color light, so it can adapt to different The dynamic change of liquid level under brightness can also obtain an accurate measurement result under the interference of colored light.

有關本發明之前述及其他技術內容、特點與功效,在以下配合參考圖式之一較佳實施例的詳細說明中,將可清楚的呈現。以下實施例中所提到的方向用語,例如:上、下、左、右、前或後等,僅是用於參照隨附圖式的方向。因此,該等方向用語僅是用於說明並非是用於限制本發明。The foregoing and other technical contents, features, and effects of the present invention will be clearly presented in the following detailed description of a preferred embodiment with reference to the accompanying drawings. The directional terms mentioned in the following embodiments, such as: up, down, left, right, front or rear, etc., are merely directions for referring to the accompanying drawings. Therefore, these directional terms are only used to illustrate and not to limit the present invention.

圖2為本發明之一實施例的液面高度偵測系統示意圖。液面高度偵測系統200包括一影像擷取裝置210、一影像處理單元220、一運算單元230、一使用者介面240及一光源250。影像擷取裝置210例如是一攝影機,其適合搭配影像處理單元220來進行影像視覺處理,其架設位置位於焊料槽140的側面,以得出一待測影像。影像處理單元220用以對該待測影像進行影像格式轉換、濾波、對比加強或淡化、二值化、侵蝕膨脹、邊緣化等處理。FIG. 2 is a schematic diagram of a liquid level detection system according to an embodiment of the present invention. The liquid level detection system 200 includes an image capturing device 210, an image processing unit 220, an operation unit 230, a user interface 240, and a light source 250. The image capturing device 210 is, for example, a camera, which is suitable for performing image visual processing with the image processing unit 220, and its mounting position is located on the side of the solder tank 140 to obtain an image to be tested. The image processing unit 220 is configured to perform image format conversion, filtering, contrast enhancement or fading, binarization, erosion and expansion, and edge processing on the image to be measured.

運算單元230包括一亮度判斷模組232、一色度判斷模組234、一像素判讀模組236及一像素轉換模組238,以供執行一判斷流程及多種不同的量測流程。亮度判斷模組232用以判斷待測影像的亮度,據以控制光源250。色度判斷模組234判斷待測影像的色度,據以從多種量測流程中選擇一適當的量測流程。像素判讀模組236用來判讀待測影像中代表液面高度的一像素值Pm,其為該待測影像中代表該液面高度的像素數目,例如:將該待測影像置於一個以像素做為座標單位的繪圖座標中,此時液面線上的每一點位皆可以用一橫座標與一縱座標來表示,其中該縱座標所對應的像素數目即是代表該點位的液面高度。像素轉換模組238用以將待測影像中代表液面高度的像素值Pm轉換成波焊現場的液面高度,以下稱為「現實高度量測值」,其單位可為常用的公制或英制的長度單位。The computing unit 230 includes a brightness determination module 232, a chromaticity determination module 234, a pixel interpretation module 236, and a pixel conversion module 238, for performing a determination process and a plurality of different measurement processes. The brightness judging module 232 is configured to judge the brightness of the image to be measured and control the light source 250 accordingly. The chromaticity determination module 234 determines the chromaticity of the image to be measured, and accordingly selects an appropriate measurement process from a variety of measurement processes. The pixel interpretation module 236 is used to determine a pixel value Pm representing the height of the liquid surface in the image to be measured, which is the number of pixels representing the height of the liquid surface in the image to be measured. For example: placing the image to be measured in a pixel In the drawing coordinates as a coordinate unit, at this time, each point on the liquid surface can be represented by a horizontal coordinate and a vertical coordinate, where the number of pixels corresponding to the vertical coordinate is the height of the liquid level representing the point. . The pixel conversion module 238 is used to convert the pixel value Pm representing the liquid surface height in the image to be measured into the liquid surface height of the wave welding site, which is hereinafter referred to as the "real height measurement value", and its unit can be commonly used metric or imperial Unit of length.

在本實施例中,所有功能皆可建立在一使用者介面240上,例如圖2A所示,為一matlab所撰寫之圖形使用者介面240 (Graphical User Interface,簡稱GUI介面)。該GUI介面240能讀取影像擷取裝置210之資訊以及調整影像擷取裝置210之功能,並且具有讀取使用者設定以及儲存資料之功能,且GUI介面240中可顯示當前液面的現實高度量測值,及當前的待測影像。圖2A的GUI介面240之左半部為一設定選單,其包含多個參數設定欄位,右半部有三個顯示區241、242、243。顯示區241用以顯示當前的待測影像;顯示區242顯示待測影像中焊料波整體液面上各點的水平高度所形成的液面波動曲線;顯示區243用以顯示焊料波液面上多個不同的水平高度。In this embodiment, all functions can be established on a user interface 240, for example, as shown in FIG. 2A, a graphical user interface 240 (Graphical User Interface, GUI interface) written by Matlab. The GUI interface 240 can read the information of the image capture device 210 and adjust the function of the image capture device 210, and has the function of reading user settings and storing data, and the GUI interface 240 can display the actual height of the current liquid surface Measured value and current image to be measured. The left half of the GUI interface 240 in FIG. 2A is a setting menu, which includes a plurality of parameter setting fields, and the right half has three display areas 241, 242, and 243. The display area 241 is used to display the current image to be measured; the display area 242 is used to display the liquid level fluctuation curve formed by the horizontal height of each point on the entire liquid surface of the solder wave in the image to be measured; the display area 243 is used to display the solder wave liquid surface Multiple different levels.

利用上述的液面高度偵測系統200可執行本發明的液面高度偵測方法,包含:如圖3所示的畫面校正及液面高度基準值HR設定流程、如圖4的判斷流程,以及圖5至圖6所示的液面高度量測流程A及B。本發明的方法適用於偵測從一焊料槽140內部向上湧起之一焊料波的一液面高度,尤其是在焊料波的液面呈現動態變化時。The liquid level detection method of the present invention can be performed by using the liquid level detection system 200 described above, including: a screen correction as shown in FIG. 3 and a liquid level reference value HR setting process, a judgment process as shown in FIG. 4, and The liquid level height measurement processes A and B shown in FIGS. 5 to 6. The method of the present invention is suitable for detecting a liquid surface height of a solder wave rising upward from the inside of a solder tank 140, especially when the liquid surface of the solder wave exhibits a dynamic change.

圖3為本發明之一實施例的液面高度偵測方法之畫面校正及液面高度基準值設定流程示意圖。在偵測液面高度之前,先進行畫面校正(Start 1)。以影像擷取裝置210從焊料槽140的側面擷取一校正用的影像,此校正用的影像顯示從焊料槽140內部向上湧起的錫波側視圖 (S300)。影像擷取裝置210是一影像感測器,例如:電荷耦合元件(charge coupled device, CCD)或互補式金氧半導體感測器(complementary metal oxide semiconductor sensor, CMOS sensor)。影像擷取裝置210可具有自動補光功能,能在陰暗環境中仍保有一定清晰的畫面。在擷取校正用的影像之前,需在錫波液面的位置上放置一已知高度的標準物,例如一刻度玻璃板;再用影像擷取裝置210擷取出該校正用的影像。藉此刻度玻璃板,即可由該校正用的影像中看出錫波的一實際液面高度資訊Ha。接著,選擇功能模式(S310),例如:一校正模式M1或一基準值設置模式M2。FIG. 3 is a schematic diagram of a screen correction and a liquid level reference value setting method for a liquid level detection method according to an embodiment of the present invention. Before detecting the liquid level, perform a screen correction (Start 1). An image capturing device 210 is used to capture a correction image from the side of the solder bath 140, and the correction image shows a side view of a tin wave rising upward from the solder bath 140 (S300). The image capturing device 210 is an image sensor, such as a charge coupled device (CCD) or a complementary metal oxide semiconductor sensor (CMOS sensor). The image capturing device 210 may have an automatic light fill function, and still maintain a certain clear picture in a dark environment. Before capturing the image for calibration, a standard with a known height, such as a graduated glass plate, needs to be placed on the level of the tin wave surface. The image capture device 210 is then used to capture the calibration image. By calibrating the glass plate, an actual level information Ha of the tin wave can be seen from the image used for the calibration. Next, a function mode is selected (S310), for example, a correction mode M1 or a reference value setting mode M2.

在校正模式M1下,利用影像擷取裝置210從該校正用的影像中選取一感興趣區域(ROI, region of interest)的影像,以下簡稱為一ROI影像。在校正模式M1中,須先確定量測距離,固定攝影機位置,接著在量測目標處放置一已知高度的標準物,例如前述的刻度玻璃板,藉此得到實際液面高度資訊Ha。運算單元230利用其像素判讀模組236從ROI影像中取得一校正像素值Pc(S320)。像素轉換模組238再根據校正像素值Pc與實際液面高度資訊Ha的比例關係,得到兩者的比例轉換資訊,並將該比例轉換資訊定義為一轉換係數CF(S322)。在校正完畢後,即可移除先前放置之標準物。In the correction mode M1, an image capturing device 210 is used to select an image of a region of interest (ROI) from the image for correction, hereinafter referred to as an ROI image. In the calibration mode M1, the measurement distance must be determined, the camera position must be fixed, and then a standard object of known height, such as the aforementioned scale glass plate, is placed at the measurement target to obtain the actual liquid level information Ha. The arithmetic unit 230 uses its pixel interpretation module 236 to obtain a corrected pixel value Pc from the ROI image (S320). The pixel conversion module 238 then obtains the ratio conversion information of the two based on the ratio of the corrected pixel value Pc and the actual liquid level information Ha, and defines the ratio conversion information as a conversion coefficient CF (S322). After calibration, the previously placed standards can be removed.

在基準值設置模式M2下,將校正用的影像與一預設的輸送軌道圖進行比對(S330),以得到輸送軌道110的資訊,例如:輸送軌道110的高度、位置,或輸送軌道110與焊料槽140的間隔距離等。藉由輸送軌道110的資訊制定出一液面高度基準值HR(S332),此液面高度基準值HR可視為一理想液面高度。設定液面高度基準值HR之目的是為了讓使用者得知當前液面與該理想液面高度的差距。In the reference value setting mode M2, the correction image is compared with a preset conveying track map (S330) to obtain information of the conveying track 110, such as the height and position of the conveying track 110, or the conveying track 110 The distance from the solder bath 140 is equal. Based on the information of the conveying track 110, a liquid level reference value HR is established (S332). This liquid level reference value HR can be regarded as an ideal liquid level height. The purpose of setting the liquid level reference value HR is to let the user know the difference between the current liquid level and the ideal liquid level.

在一實施例中,可藉由尺度不變特徵轉換(Scale-Invariant Feature Transform, SIFT)演算法來將校正用的影像與輸送軌道圖進行比對。SIFT演算法是一種機器視覺的演算法,用來偵測與描述影像中的局部性特徵。它在空間尺度中尋找極值點,並提取出其位置、尺度、旋轉不變數。對於光線、雜訊、些微視角改變的容忍度也相當高。基於這些特性,SIFT演算法很容易辨識物體且鮮有誤認。In one embodiment, a scale-invariant feature transform (SIFT) algorithm can be used to compare the correction image with the transport track map. The SIFT algorithm is a machine vision algorithm used to detect and describe local features in an image. It looks for extreme points in the spatial scale and extracts its position, scale, and rotation invariant numbers. Tolerance for light, noise, and slight viewing angle changes is also quite high. Based on these characteristics, the SIFT algorithm is easy to identify objects with few misidentifications.

在離開校正模式M1或基準值設置模式M2之後,可繼續判斷是否要選擇其他功能模式(S340)。若不再選擇其他功能模式,則判斷是否要開始進行液面高度偵測 (S350)。若是,則先進入一判斷流程(Start 2)。After leaving the correction mode M1 or the reference value setting mode M2, it may continue to determine whether to select another function mode (S340). If no other function mode is selected, it is judged whether to start liquid level detection (S350). If yes, first enter a judgment process (Start 2).

圖4為本發明之一實施例的液面高度偵測方法之判斷流程示意圖。此判斷流程用以判斷該待測影像的亮度及環境光色,並據以從複數量測流程中選擇其一進行後續處理。開始判斷時 (Start 2),先對該待測影像進行一影像前置處理,該影像前置處理包括步驟S400至S420:FIG. 4 is a schematic flowchart of a method for detecting a liquid surface height according to an embodiment of the present invention. This judging process is used to judge the brightness and the ambient light color of the image to be tested, and then one of them is selected from the complex measurement process for subsequent processing. When the judgment is started (Start 2), an image pre-processing is performed on the image to be tested, and the image pre-processing includes steps S400 to S420:

首先,以影像擷取裝置210從焊料槽140的側面擷取一待測影像(S400);再從該待測影像中選取一ROI影像,ROI影像中包含從焊料槽140湧起之錫波側視圖;利用影像處理單元220取得ROI影像之一亮度資料及一環境光色;再對該ROI影像進行亮度及環境光色的判斷。First, an image capture device 210 is used to capture an image to be tested from the side of the solder tank 140 (S400); then a ROI image is selected from the image to be tested, and the ROI image includes the tin wave side rising from the solder tank 140 View; use the image processing unit 220 to obtain brightness data and an ambient light color of the ROI image; and then judge the brightness and ambient light color of the ROI image.

由於原始ROI影像為一RGB格式的影像,故先將其轉換為YUV格式的影像(S420),其中Y、U、V分別為明亮度(Y,Luma)、色度(U, Chrominance)、濃度(V, Chroma)。接著對該YUV格式的影像進行第一判斷式(S430)。在YUV格式的影像中,Y值過低則代表該影像之明亮度很低。若Y值平均低於一亮度參考值,例如:亮度參考值可設為35,則亮度判斷模組232控制光源250對焊料波的液面進行照光,再以影像擷取裝置210擷取一照光影像以取代前一待測影像(S440)。若Y值平均大於或等於亮度參考值,則直接跳至第二判斷式(S450)。Since the original ROI image is an RGB format image, it is first converted into a YUV format image (S420), where Y, U, and V are the brightness (Y, Luma), chrominance (U, Chrominance), and density, respectively. (V, Chroma). Then, a first judgment formula is performed on the YUV format image (S430). In a YUV format image, if the Y value is too low, the brightness of the image is very low. If the average Y value is lower than a brightness reference value, for example, the brightness reference value can be set to 35, the brightness judgment module 232 controls the light source 250 to illuminate the liquid surface of the solder wave, and then captures a light with the image capturing device 210 The image replaces the previous image under test (S440). If the Y value is greater than or equal to the brightness reference value on average, it directly jumps to the second judgment formula (S450).

第二判斷式是對RGB格式的原始ROI影像進行環境光色的判斷(S450)。一個像素的光色可以用一色度座標來表示,色度座標包括一紅色值R、一綠色值G及一藍色值B,分別代表紅光、綠光、藍光的亮度。將紅色值B、綠色值G及藍色值B的總和稱為一總色度值。原始ROI影像中,若色調平均時,理想狀況下R、G、B三個數值應各自佔33%。若R、G、B其中一個值較高,則代表影像中該色調較重。在第二判斷式中,若原始ROI影像中所有像素的R值總和佔所有像素的R、G、B三種色度值總和的比例大於一色度比例值,例如:色度比例值設為35%,即判斷為有紅光背景,則採用量測流程A;若否,則進行量測流程B。The second judgment formula is to judge the ambient light color of the original ROI image in the RGB format (S450). The light color of a pixel can be represented by a chromaticity coordinate. The chromaticity coordinate includes a red value R, a green value G, and a blue value B, which represent the brightness of red light, green light, and blue light, respectively. The sum of the red value B, the green value G, and the blue value B is called a total chromaticity value. In the original ROI image, if the tones are averaged, ideally, the three values of R, G, and B should each account for 33%. If one of the R, G, and B values is higher, it means that the tone is heavier in the image. In the second judgment formula, if the ratio of the sum of the R values of all pixels in the original ROI image to the sum of the three chromaticity values of R, G, and B of all pixels is greater than a chromaticity ratio value, for example, the chromaticity ratio value is set to 35% That is, if it is determined that there is a red light background, the measurement process A is adopted; if not, the measurement process B is performed.

上述的A、B兩種量測流程可預先內建於運算單元230中。運算單元230執行所選擇的量測流程,其像素判讀模組236取得ROI影像的一像素值Pm,像素值Pm代表待測影像中的液面高度;接著像素轉換模組238利用轉換係數CF將像素值Pm轉換為波焊現場的一現實高度量測值Hm;之後再通過使用者介面240顯示現實高度量測值Hm。The above-mentioned two measurement processes of A and B can be built in the arithmetic unit 230 in advance. The arithmetic unit 230 executes the selected measurement process. The pixel interpretation module 236 obtains a pixel value Pm of the ROI image. The pixel value Pm represents the liquid level in the image to be measured. Then the pixel conversion module 238 uses the conversion coefficient CF to convert The pixel value Pm is converted into a real height measurement value Hm at the wave welding site; the real height measurement value Hm is then displayed through the user interface 240.

圖5為本實施例的液面高度偵測方法之量測流程A示意圖。量測流程A依序對ROI影像進行一濾波處理(S500)、一幀差運算(S511~S513以及S521~S522)、一二值化處理(S531~S532)、一AND運算(S540)、一形態學處理(S550)及一邊緣化處理(S560)。FIG. 5 is a schematic diagram of a measurement process A of a liquid level detection method according to this embodiment. The measurement process A sequentially performs a filtering process (S500), a frame difference operation (S511 ~ S513 and S521 ~ S522), a binarization process (S531 ~ S532), an AND operation (S540), a Morphological processing (S550) and a marginalization processing (S560).

首先,對ROI影像進行一濾波處理(S500),能得出一濾波影像。濾波處理是用來消除ROI影像中的雜訊,使ROI影像更加平滑。First, a filtering process is performed on the ROI image (S500) to obtain a filtered image. The filtering process is used to eliminate noise in the ROI image and make the ROI image smoother.

接著,對該濾波影像進行三幀差法(Three-frame-difference Method)的運算。先取出第N、N-1、N-2幀 (S511至S513),再將第N幀影像與第N-1幀影像相減(S521),得出一差分圖像Diff1;第N-1幀影像與第N-2幀影像相減(S522),得出一差分圖像Diff2。此運算能藉由每個幀數的相減找出物體的運動軌跡。Then, a three-frame-difference method is performed on the filtered image. First take out the Nth, N-1, and N-2 frames (S511 to S513), and then subtract the Nth frame image from the N-1th frame image (S521) to obtain a difference image Diff1; the N-1th The frame image is subtracted from the N-2 frame image (S522) to obtain a differential image Diff2. This operation can find the trajectory of an object by subtracting the number of each frame.

接著,對該差分圖像Diff1與差分圖像Diff2進行二值化,能得到一Diff1二值化影像(S531)與一Diff2二值化影像(S532)。其中,二值化可以把灰階圖像轉換成二值圖像。把大於某個臨界灰階值的一像素灰階設為一灰階極大值,把小於這個值的一像素灰階設為一灰階極小值,從而實現二值化。在本實施例中,該第一顏色為黑色,而第二顏色則為白色。由於二值化影像中只剩下黑白圖像,可以大量減少影像運算量,以增加影像處理單元220運算執行時的效率與節省記憶體空間的浪費。Next, the difference image Diff1 and the difference image Diff2 are binarized to obtain a Diff1 binarized image (S531) and a Diff2 binarized image (S532). Among them, binarization can convert a grayscale image into a binary image. A pixel gray level greater than a certain threshold gray level value is set to a gray level maximum value, and a pixel gray level less than this value is set to a gray level minimum value, thereby achieving binarization. In this embodiment, the first color is black, and the second color is white. Since only the black-and-white image is left in the binarized image, the amount of image calculation can be greatly reduced, so as to increase the efficiency of the image processing unit 220 when the operation is performed and save the waste of memory space.

接著再對Diff1二值化影像與Diff2二值化影像進行AND運算,得出一AND影像(S540)。因二值化後,圖像只剩下1與0,在AND運算中,兩者為1,輸出即為1;其餘狀況皆為0,可以藉此得出兩幀影像中的重疊部分,以減少誤判。Then, an AND operation is performed on the Diff1 binary image and the Diff2 binary image to obtain an AND image (S540). Because after binarization, the image has only 1 and 0. In the AND operation, the two are 1, and the output is 1. The remaining conditions are 0. This can be used to obtain the overlapping part of the two frames. Reduce misjudgments.

對該AND影像進行形態學處理,得出一形態學影像(S550)。形態學處理應用得當的話,可使目標物更加明顯。Morphological processing is performed on the AND image to obtain a morphological image (S550). If the morphological treatment is applied properly, the target can be made more obvious.

接著再對該形態學影像進行邊緣處理,得出一邊緣化影像(S560)。進行邊緣偵測處理的目的是為了找出錫波與背景的分界,偵測邊緣多半是利用影像中鄰近像素上的灰階值上的差距來決定,若灰階值落差很大則為邊緣位置,反之則否。然而,在很多情況下,邊緣位置並不會剛好只位在一個像素,而是會由數個像素所構成,而真正的邊緣位置就在這些像素當中。Next, edge processing is performed on the morphological image to obtain an edged image (S560). The purpose of edge detection processing is to find the boundary between the tin wave and the background. The detection of edges is mostly determined by the difference in the grayscale values of adjacent pixels in the image. If the grayscale value varies greatly, it is the edge position. And vice versa. However, in many cases, the edge position will not be located at just one pixel, but will be composed of several pixels, and the true edge position is among these pixels.

得到此邊緣化影像後,將整張ROI影像視為一矩陣,利用二值化非0即1的特性,來取得ROI影像中代表錫波液面上多個不同位置之液面高度的多個像素參考值Pn (S570)。在一較佳實施例中,可再透過曲線擬合避免多點的偏移來去除這些像素參考值Pn當中的極端值(S580),以得到所需的像素值Pm,並減少誤差值。本實施例中,曲線擬合是指用連續曲線近似地刻畫或比擬平面上離散點組所表示的坐標之間的函數關係。After obtaining this marginalized image, the entire ROI image is regarded as a matrix, and the characteristics of binarization non-zero or 1 are used to obtain a plurality of liquid surface heights representing a plurality of different positions of the tin wave liquid surface in the ROI image. Pixel reference value Pn (S570). In a preferred embodiment, the extreme values of these pixel reference values Pn can be removed by curve fitting to avoid multi-point offset (S580) to obtain the required pixel value Pm and reduce the error value. In this embodiment, curve fitting refers to using a continuous curve to roughly describe or compare the functional relationship between the coordinates represented by the discrete point groups on the plane.

再將此像素值Pm按照先前校正流程所得到的轉換係數CF進行一像素值轉換過程,即可將量測所得之像素值Pm轉換為現實高度量測值Hm,其單位為mm,此現實高度量測值Hm代表當前的錫波液面高度(S590)。最後再將此現實高度量測值Hm與預定的液面高度基準值HR進行減法運算,即可得到當前液面與理想液面的高度差。值得一提的是,本發明的方法可將先前步驟S570所得的多個像素參考值Pn進行像素值轉換,即可得到整個錫波液面上多個不同點位的水平高度值,進而將錫波整體液面的波動變化顯示於圖2A的GUI介面240中,此為習知技術所不具備的功能。This pixel value Pm is then subjected to a pixel value conversion process according to the conversion coefficient CF obtained in the previous calibration process, and the measured pixel value Pm can be converted into a real height measurement value Hm, the unit of which is mm, and this real height The measured value Hm represents the current tin wave level (S590). Finally, the actual height measurement value Hm is subtracted from the predetermined liquid level reference value HR to obtain the height difference between the current liquid level and the ideal liquid level. It is worth mentioning that the method of the present invention can convert the pixel reference values Pn obtained in the previous step S570 into pixel values, and then obtain the height values of multiple different points on the entire surface of the tin wave. The fluctuation of the overall liquid level of the wave is shown in the GUI interface 240 in FIG. 2A, which is a function not available in the conventional technology.

圖6為本實施例的液面高度偵測方法之量測流程B示意圖。因焊料槽140內部之光影問題,錫波會有部分受到反光,而使錫波有不同的顏色。本實施例分別對ROI影像的反光部分及未反光部分進行兩種不同的處理,最後再透過一公式去算出所量測的錫波高度。FIG. 6 is a schematic diagram of a measurement process B of the liquid level detection method according to this embodiment. Due to the problem of light and shadow inside the solder bath 140, the tin wave may be partially reflected, so that the tin wave has a different color. In this embodiment, two different processes are performed on the reflective part and the non-reflective part of the ROI image, and finally a formula is used to calculate the measured tin wave height.

圖6之左半部(S610至S615)是為了處理反光部分的錫波,此部分錫波是屬於淡色的。首先,對ROI影像進行對比加強,得出一對比加強影像,以突顯一反光部分 (S610)。對比加強的步驟是將特定像素提高亮度,目的是為了突顯反光部分的錫波與背景之差異,來減少後續影像處理造成錯誤的影響程度。The left half (S610 to S615) of Fig. 6 is to deal with the tin wave in the reflective part, which tin light belongs to the light color. First, the ROI image is contrast-enhanced to obtain a contrast-enhanced image to highlight a reflective portion (S610). The step of contrast enhancement is to increase the brightness of a specific pixel. The purpose is to highlight the difference between the tin wave in the reflective part and the background, so as to reduce the degree of error caused by subsequent image processing.

其次,對該反光部分之對比加強影像進行一灰階轉換處理,得出一反光之灰階影像(S611)。這是因為彩色影像具有相當多的不同資訊,為了有效降低影像的資訊量與圖形所代表的複雜度,通常會進行灰階轉換處理。Secondly, a gray-scale conversion process is performed on the contrast-enhanced image of the reflective portion to obtain a reflective gray-scale image (S611). This is because color images have quite a lot of different information. In order to effectively reduce the amount of information in the image and the complexity represented by the graphics, grayscale conversion processing is usually performed.

再來,對該反光之灰階影像進行二值化處理,得出一反光之二值化影像(S612)。接著,對該反光之二值化影像進行一侵蝕膨脹處理 (S613)。侵蝕膨脹處理是屬於消除雜訊的一種方式,需先設定一遮罩。侵蝕的運算結果會使影像看起來收縮,可以利用適當的結構元素將不必要的元素去除掉。而膨脹的運算結果會使影像看起來擴大,可以利用適當的結構元素將間隙填補起來。Then, the reflective grayscale image is binarized to obtain a reflective binary image (S612). Then, the reflective binarized image is subjected to an erosion expansion process (S613). Erosion and swelling is a way to eliminate noise, and you need to set a mask first. The result of erosion calculation will make the image look shrunk, and unnecessary elements can be removed by using appropriate structural elements. The result of the expansion calculation will make the image look larger, and the gap can be filled with appropriate structural elements.

接著,再將侵蝕膨脹處理後的影像進行一邊緣偵測處理,得出一反光邊緣強化影像(S614)。將整張反光邊緣強化影像視為一矩陣,利用二值化非0即1的特性,來取得多個反光像素參考值PR1(S615),其代表反光部分之錫波液面上多個不同位置之液面高度。在一較佳實施例中,可再透過前述的曲線擬合來避免多點的偏移,以減少誤差值。Then, an edge detection process is performed on the image after the erosion and expansion process to obtain a reflective edge enhanced image (S614). The entire reflective edge-enhanced image is regarded as a matrix, and a plurality of reflective pixel reference values PR1 (S615) are obtained by binarizing non-zero or one (S615), which represent multiple different positions on the tin wave liquid surface of the reflective portion Liquid level. In a preferred embodiment, the aforementioned curve fitting can be used to avoid multi-point offsets to reduce the error value.

圖6之右半部(S620至S626),係屬於未反光的部分,此部分的錫波是黑色的。The right half (S620 to S626) of Fig. 6 belongs to the non-reflective part. The tin wave in this part is black.

首先,對ROI影像進行對比淡化,得出一對比淡化影像,以突顯一未反光部分 (S620)。此方法是因為圖像背景有過於黯淡,為使後續二值化能有效分辨出未反光部分的錫波與其背景。接著將此對比淡化影像進行一負片處理,將黑、白像素的顏色互換,在本實施例是將原本的白色像素轉變為黑色像素,而得到一未反光部分之負片影像(S621)。First, contrast-fading the ROI image to obtain a contrast-fading image to highlight an unreflected portion (S620). This method is because the background of the image is too dim, so that the subsequent binarization can effectively distinguish the tin wave from its unreflected part and its background. Then, the contrast-faded image is subjected to a negative film processing, and the colors of the black and white pixels are interchanged. In this embodiment, the original white pixels are converted into black pixels to obtain a negative image of the unreflected portion (S621).

接著,將此未反光部分的負片影像進行直方圖均衡,得到一未反光之均衡化影像(S622)。圖像的灰階值所出現的機率並不相等,而直方圖均衡是將圖像的灰階值進行變換,使得變化後的灰階值出現的機率是相同的,主要目的是使圖像的細節信息能夠更加突出。Then, the negative image of the unreflected part is subjected to histogram equalization to obtain an unreflected equalized image (S622). The probability of the grayscale values of the image is not equal, and the histogram equalization is to transform the grayscale value of the image, so that the probability of the grayscale value after the change is the same, the main purpose is to make the image Detailed information can be more prominent.

接著,將此未反光之均衡化影像進行一灰階轉換處理,得出一未反光之灰階影像。再對該未反光的灰階影像進行一二值化處理,得出一未反光之二值化影像(S623)。Then, a grayscale conversion process is performed on the unreflected equalized image to obtain an unreflected grayscale image. Then a binarization process is performed on the unreflected grayscale image to obtain an unreflected binarized image (S623).

對該未反光之二值化影像進行一侵蝕膨脹處理(S624),得出一未反光之侵蝕膨脹處理影像。與反光部分的侵蝕膨脹處理過程不同的是,先前因反光的緣故,焊料槽140內部的背景會與錫波特徵融合在一起,使錫波辨識造成困難,故在反光部分的處理需設置遮罩來對垂直線段進行調整。而後續的侵蝕與膨脹的運算則是與反光部分相同。An erosion and expansion process is performed on the unreflected binary image (S624) to obtain an unreflected erosion and expansion image. Different from the process of erosion and expansion of the reflective part, the background inside the solder bath 140 will be fused with the characteristics of tin waves due to the reflection, which makes the identification of tin waves difficult. Therefore, a mask must be provided for the processing of the reflective part. To adjust the vertical segments. The subsequent calculation of erosion and expansion is the same as that of the reflective part.

後續將此未反光之侵蝕膨脹處理影像進行一邊緣偵測處理,得出一未反光邊緣強化影像(S625),辨識出0與1來找出錫波液面高度(S626)。將整張未反光邊緣強化影像視為一矩陣,利用二值化非0即1的特性,來取得多個未反光像素參考值PR2,其代表未反光部分之錫波液面上多個不同位置之液面高度。在一較佳實施例中,可再透過前述的曲線擬合來避免多點的偏移,以減少誤差值。Subsequently, an edge detection process is performed on the unreflected erosion and expansion processed image to obtain an unreflected edge enhanced image (S625), and 0 and 1 are identified to find the tin wave liquid level height (S626). The entire unreflected edge-enhanced image is regarded as a matrix, and the non-reflective pixel reference value PR2 is obtained by binarizing non-zero or 1, which represents a plurality of different positions on the tin wave surface of the unreflected portion. Liquid level. In a preferred embodiment, the aforementioned curve fitting can be used to avoid multi-point offsets to reduce the error value.

再將兩種處理方式所得到之多個反光像素參考值PR1及多個未反光像素參考值PR2進行比較(S630),得到多個像素參考值Pn。藉由消除過低與過高的像素參考值Pn而得到所需的像素值Pm (S640),再將此像素值Pm按照先前校正流程所得之轉換係數CF進行像素值轉換(S650),即可將像素值Pm轉換為現實高度量測值Hm,其單位為mm。此現實高度量測值Hm即為當前的錫波液面高度。最後,再將此現實高度量測值Hm與液面高度基準值HR進行減法運算,即可得到兩者的高度差Hd,代表當前液面與預設的理想液面的差距 (S660)。Then, the plurality of reflective pixel reference values PR1 and the plurality of non-reflective pixel reference values PR2 obtained by the two processing methods are compared (S630) to obtain a plurality of pixel reference values Pn. The required pixel value Pm is obtained by eliminating the pixel reference value Pn that is too low and too high (S640), and then the pixel value is converted according to the conversion coefficient CF obtained in the previous calibration process (S650), The pixel value Pm is converted into the actual height measurement value Hm, and the unit is mm. This actual height measurement Hm is the current tin wave level. Finally, the actual height measurement value Hm is subtracted from the liquid level reference value HR to obtain the height difference Hd between the two, which represents the difference between the current liquid level and the preset ideal liquid level (S660).

綜上所述,本發明提供一種利用影像偵測液面高度的方法,透過一具有鏡頭之影像設備,對動/靜態液面進行拍攝,以側面的方式擷取影像畫面,針對畫面中之取得特定範圍進行影像處理,以減少不必要之運算量,使用影像處理技術偵測出液面邊緣,取得液面變化波動之大小平均值,可精確地測量出代表液面高度之像素值,並去除極大或極小的像素值,之後透過等比例之線性回歸,轉換成波焊現場的液面高度。To sum up, the present invention provides a method for detecting the height of a liquid surface by using an image. Through an imaging device with a lens, the dynamic / static liquid surface is photographed, and an image frame is captured in a side manner. Perform image processing in a specific range to reduce unnecessary calculations. Use image processing technology to detect the edge of the liquid surface and obtain the average value of the fluctuation of the liquid surface. The pixel value representing the height of the liquid surface can be accurately measured and removed. The maximum or minimum pixel value is then converted into the liquid surface height of the wave welding site through linear regression of equal proportions.

此外,本發明將攝影機所擷取到之錫波高度即時進行影像處理,讓使用者可於監視器中看見當前波焊現場的錫波高度變化狀況,使工廠在管理維護上能迅速掌握正確資訊,進而提升印刷電路板焊接品質。此產品無須限制特定攝影鏡頭,可搭配一般消費型攝影設備使用。特別是在高溫環境的工廠中,更能突顯本方法的優點。In addition, the invention performs real-time image processing on the tin wave height captured by the camera, so that the user can see the tin wave height change status of the current wave welding site on the monitor, so that the factory can quickly grasp the correct information in management and maintenance , Which in turn improves the soldering quality of printed circuit boards. This product does not need to restrict specific photographic lenses, and can be used with general consumer photography equipment. Especially in factories with high temperature environment, the advantages of this method can be more prominent.

惟以上所述者,僅為本發明之較佳實施例而已,當不能以此限定本發明實施之範圍,即大凡依本發明申請專利範圍及發明說明內容所作之簡單的等效變化與修飾,皆仍屬本發明專利涵蓋之範圍內。另外本發明的任一實施例或申請專利範圍不須達成本發明所揭露之全部目的或優點或特點。此外,摘要部分和標題僅是用來輔助專利文件搜尋之用,並非用來限制本發明之權利範圍。However, the above are only the preferred embodiments of the present invention. When the scope of implementation of the present invention cannot be limited by this, that is, the simple equivalent changes and modifications made according to the scope of the patent application and the description of the invention, All are still within the scope of the invention patent. In addition, any embodiment of the present invention or the scope of patent application does not need to achieve all the purposes or advantages or features disclosed by the invention. In addition, the abstract and the title are only used to assist the search of patent documents, and are not intended to limit the scope of rights of the present invention.

100‧‧‧習知的波焊系統100‧‧‧The conventional wave welding system

110‧‧‧輸送軌道110‧‧‧Conveyor track

120‧‧‧助焊劑噴嘴120‧‧‧Flux Nozzle

130‧‧‧預熱器130‧‧‧preheater

140‧‧‧焊料槽140‧‧‧solder bath

150‧‧‧風扇150‧‧‧fan

160‧‧‧中央控制器160‧‧‧ Central controller

170‧‧‧印刷電路板170‧‧‧printed circuit board

172‧‧‧雙列直插封裝元件172‧‧‧Dual In-line Package Components

180‧‧‧非接觸感測器180‧‧‧ Non-contact sensor

200‧‧‧液面高度偵測系統200‧‧‧Liquid level detection system

210‧‧‧影像擷取裝置210‧‧‧Image capture device

220‧‧‧影像處理單元220‧‧‧Image Processing Unit

230‧‧‧運算單元230‧‧‧ Computing Unit

232‧‧‧亮度判斷模組232‧‧‧Brightness judgment module

234‧‧‧色度判斷模組234‧‧‧Chroma Judgment Module

236‧‧‧像素判讀模組236‧‧‧Pixel Interpretation Module

238‧‧‧像素轉換模組238‧‧‧pixel conversion module

240‧‧‧使用者介面(GUI介面)240‧‧‧user interface (GUI interface)

241、242、243‧‧‧顯示區241, 242, 243‧‧‧ display area

250‧‧‧光源250‧‧‧ light source

S300~S350‧‧‧畫面校正及液面高度基準值設定流程S300 ~ S350‧‧‧Screen calibration and liquid level reference value setting process

M1‧‧‧校正模式M1‧‧‧ Calibration mode

M2‧‧‧基準值設置模式M2‧‧‧reference value setting mode

Ha‧‧‧實際液面高度資訊Ha‧‧‧ Actual Level Information

Pc‧‧‧校正像素值Pc‧‧‧corrected pixel value

CF‧‧‧轉換係數CF‧‧‧ Conversion Factor

HR‧‧‧液面高度基準值HR‧‧‧Basic level height reference value

S400~S450‧‧‧判斷流程S400 ~ S450‧‧‧Judging process

(S500~S590)‧‧‧量測流程A(S500 ~ S590) ‧‧‧Measurement process A

(S610~S660)‧‧‧量測流程B(S610 ~ S660) ‧‧‧Measurement Process B

ROI‧‧‧感興趣區域ROI‧‧‧ Area of Interest

R‧‧‧紅色值R‧‧‧ red value

G‧‧‧綠色值G‧‧‧Green value

B‧‧‧藍色值B‧‧‧ blue value

Y‧‧‧明亮度Y‧‧‧Brightness

U‧‧‧色度U‧‧‧ Chroma

V‧‧‧濃度V‧‧‧ concentration

Diff1、Diff2‧‧‧差分圖像Diff1, Diff2‧‧‧ Differential images

PR1‧‧‧反光像素參考值PR1‧‧‧reflective pixel reference value

PR2‧‧‧未反光像素參考值PR2‧‧‧unreflected pixel reference value

Pn‧‧‧像素參考值Pn‧‧‧pixel reference value

Pm‧‧‧像素值Pm‧‧‧pixel value

Hd‧‧‧高度差Hd‧‧‧height difference

Hm‧‧‧現實高度量測值Hm‧‧‧Real height measurement

圖1為習知的波焊系統示意圖。FIG. 1 is a schematic diagram of a conventional wave welding system.

圖2為本發明之一實施例的液面高度偵測系統示意圖。FIG. 2 is a schematic diagram of a liquid level detection system according to an embodiment of the present invention.

圖2A為本發明之一實施例的使用者介面示意圖。FIG. 2A is a schematic diagram of a user interface according to an embodiment of the present invention.

圖3為本發明之一實施例的畫面校正及液面高度基準值設定流程示意圖。FIG. 3 is a schematic diagram of a screen correction and a liquid level reference setting process according to an embodiment of the present invention.

圖4為本發明之一實施例的液面高度偵測方法之判斷流程示意圖。FIG. 4 is a schematic flowchart of a method for detecting a liquid surface height according to an embodiment of the present invention.

圖5為本發明之一實施例的量測流程A示意圖。FIG. 5 is a schematic diagram of a measurement process A according to an embodiment of the present invention.

圖6為本發明之一實施例的量測流程B示意圖。FIG. 6 is a schematic diagram of a measurement process B according to an embodiment of the present invention.

no

no

Claims (10)

一種液面高度偵測方法,適用於偵測從一焊料槽內部向上湧起之一焊料波的一液面高度,該方法包括: 以一影像擷取裝置從該焊料槽的側面擷取一待測影像; 從該待測影像中選取一感興趣區域; 利用一影像處理單元取得該感興趣區域之一亮度資料及一環境光色; 以一運算單元提供複數量測流程,並且根據該亮度資料及該環境光色,從該複數量測流程中選擇其一; 該運算單元執行所選擇的該量測流程,以取得該感興趣區域的一像素值,係為該待測影像中代表該液面高度的像素數目; 該運算單元提供一轉換係數,並以該轉換係數將該像素值轉換為一現實高度量測值;以及 利用一使用者介面,顯示該現實高度量測值。A liquid surface height detection method is suitable for detecting a liquid surface height of a solder wave rising upwardly from the inside of a solder tank. The method includes: using an image capturing device to capture an image from a side of the solder tank to be Measuring an image; selecting an area of interest from the image to be measured; using an image processing unit to obtain brightness data and an ambient light color of the area of interest; providing a quantitative measurement process with an arithmetic unit, and according to the brightness data And the ambient light color, select one of the plurality of measurement processes; the arithmetic unit executes the selected measurement process to obtain a pixel value of the region of interest, which represents the liquid in the image to be measured The number of pixels of the surface height; the operation unit provides a conversion coefficient, and uses the conversion coefficient to convert the pixel value into a real height measurement value; and uses a user interface to display the real height measurement value. 如申請專利範圍第1項所述的液面高度偵測方法,其中提供該轉換係數的步驟包括: 以該影像擷取裝置從該焊料槽的側面擷取一校正用的影像; 從該校正用的影像中取得一校正像素值與一實際液面高度資訊;以及 該運算單元根據該校正像素值與該實際液面高度資訊,求得該兩者的一比例轉換資訊,並將該比例轉換資訊定義為該轉換係數。The liquid level detection method according to item 1 of the scope of the patent application, wherein the step of providing the conversion coefficient includes: using the image capturing device to capture an image for calibration from the side of the solder bath; Obtain a corrected pixel value and an actual liquid surface height information from the image; and the arithmetic unit obtains a ratio conversion information of the two based on the corrected pixel value and the actual liquid surface height information, and converts the ratio conversion information Defined as the conversion factor. 如申請專利範圍第1項所述的液面高度偵測方法,其中該環境光色具有一色度座標,該色度座標包括一紅色值、一綠色值及一藍色值,其中該紅色值、該綠色值及該藍色值的總和為一總色度值,並且該複數量測流程包括一第一量測流程及一第二量測流程,其中從該複數量測流程中選擇其一的步驟包括: 提供一亮度參考值及一色度比例值; 利用該運算單元判斷該亮度資料是否小於該亮度參考值; 若該亮度資料大於該亮度參考值,則再判斷該紅色值佔該總色度值的比例是否大於該色度比例值;以及 若該紅色值佔該總色度值的比例大於該色度比例值,則執行該第一量測流程,否則執行該第二量測流程,以取得該像素值。The method for detecting the height of a liquid surface according to item 1 of the scope of patent application, wherein the ambient light color has a chromaticity coordinate, and the chromaticity coordinate includes a red value, a green value, and a blue value, wherein the red value, The sum of the green value and the blue value is a total chromaticity value, and the complex measurement process includes a first measurement process and a second measurement process, and one of the plurality of measurement processes is selected from the plurality of measurement processes. The steps include: providing a brightness reference value and a chromaticity ratio value; using the arithmetic unit to determine whether the brightness data is smaller than the brightness reference value; and if the brightness data is greater than the brightness reference value, determining whether the red value accounts for the total chromaticity Whether the value ratio is greater than the chroma ratio value; and if the ratio of the red value to the total chroma value is greater than the chroma ratio value, the first measurement process is performed, otherwise the second measurement process is performed to Get the pixel value. 如申請專利範圍第3項所述的液面高度偵測方法,其中若該亮度資料小於該亮度參考值,則提供一光源對該焊料波的液面進行照光,再以該影像擷取裝置擷取一照光影像以取代該待測影像。The liquid surface height detection method according to item 3 of the scope of patent application, wherein if the brightness data is less than the brightness reference value, a light source is provided to illuminate the liquid surface of the solder wave, and then the image capture device is used to capture Take a light image to replace the test image. 如申請專利範圍第3項所述的液面高度偵測方法,其中該感興趣區域包含該焊料波之一側視圖,該第一量測流程包括: 辨識該焊料波的一邊緣位置;以及 根據該邊緣位置,取得該像素值。The liquid level detection method according to item 3 of the patent application scope, wherein the region of interest includes a side view of the solder wave, and the first measurement process includes: identifying an edge position of the solder wave; and The edge position obtains the pixel value. 如申請專利範圍第5項所述的液面高度偵測方法,其中該第一量測流程包括: 在辨識該邊緣位置之前,依序對該感興趣區域進行一幀差運算、一二值化處理及一形態學處理。The liquid level detection method according to item 5 of the scope of patent application, wherein the first measurement process includes: before identifying the edge position, sequentially performing a frame difference operation and a binarization on the region of interest Treatment and a morphological treatment. 如申請專利範圍第3項所述的液面高度偵測方法,其中該第二量測流程包括: 對該感興趣區域進行對比加強,得出一對比加強影像,以突顯一反光部分; 從該對比加強影像中取得該反光部分之一反光像素參考值; 對該感興趣區域進行對比淡化,得出一對比淡化影像,以突顯一未反光部分; 將該對比淡化影像進行一負片處理,得出該未反光部分的一負片影像; 從該負片影像中取得該未反光部分之一未反光像素參考值;以及 比較該反光像素參考值及該未反光像素參考值,以得到該像素值。The liquid level detection method according to item 3 of the scope of patent application, wherein the second measurement process includes: contrast-enhancing the region of interest to obtain a contrast-enhanced image to highlight a reflective portion; A reference value for one reflective pixel of the reflective portion is obtained in the contrast-enhanced image; a contrast-fading image is obtained for the region of interest to highlight a non-reflective portion; A negative image of the unreflected portion; obtaining an unreflected pixel reference value of the unreflected portion from the negative image; and comparing the reflected pixel reference value and the unreflected pixel reference value to obtain the pixel value. 如申請專利範圍第7項所述的液面高度偵測方法,其中該第二量測流程包括: 將該對比加強影像依序進行一灰階轉換處理、一二值化處理、一侵蝕膨脤處理及一邊緣偵測處理;以及 將該負片影像依序進行一均衡化處理、一二值化處理、一侵蝕膨脤處理及一邊緣偵測處理。The liquid level detection method according to item 7 of the scope of the patent application, wherein the second measurement process includes: sequentially performing a gray-scale conversion process on the contrast-enhanced image, a binarization process, and an erosion expansion Processing and an edge detection process; and sequentially performing an equalization process, a binarization process, an erosion and expansion process, and an edge detection process on the negative image. 如申請專利範圍第1項所述的液面高度偵測方法,更包括: 定義一液面高度基準值;以及 將該現實高度量測值與該液面高度基準值進行比較,以得到一高度差。The method for detecting the liquid level according to item 1 of the patent application scope further includes: defining a reference value for the liquid level; and comparing the measured value of the actual height with the reference value for the liquid level to obtain a height difference. 如申請專利範圍第1項所述的液面高度偵測方法,其中該感興趣區域包括該焊料波的整體液面,該方法更包括: 該運算單元由該感興趣區域中取得複數像素參考值,其中該複數像素參考值代表該焊料波的整體液面上複數不同位置之液面高度; 利用該轉換係數將該等像素參考值轉換為複數水平高度值,以形成一液面波動曲線;以及 將該液面波動曲線顯示於該使用者介面中。The liquid surface height detection method according to item 1 of the patent application scope, wherein the region of interest includes the entire liquid surface of the solder wave, and the method further includes: the arithmetic unit obtains a reference value of a plurality of pixels from the region of interest Wherein the reference value of the plurality of pixels represents the height of the liquid surface at a plurality of different positions on the entire liquid surface of the solder wave; using the conversion coefficient to convert the reference values of the pixels to a plurality of horizontal height values to form a liquid level wave curve; and The liquid level wave curve is displayed in the user interface.
TW107138035A 2018-10-26 2018-10-26 Liquid level detecting method TWI666426B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW107138035A TWI666426B (en) 2018-10-26 2018-10-26 Liquid level detecting method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW107138035A TWI666426B (en) 2018-10-26 2018-10-26 Liquid level detecting method

Publications (2)

Publication Number Publication Date
TWI666426B true TWI666426B (en) 2019-07-21
TW202016512A TW202016512A (en) 2020-05-01

Family

ID=68049691

Family Applications (1)

Application Number Title Priority Date Filing Date
TW107138035A TWI666426B (en) 2018-10-26 2018-10-26 Liquid level detecting method

Country Status (1)

Country Link
TW (1) TWI666426B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102032872A (en) * 2010-11-03 2011-04-27 中南大学 Shadow method-based high-density BGA solder ball height measuring system and method
US8508591B2 (en) * 2010-02-05 2013-08-13 Applied Vision Corporation System and method for estimating the height of an object using tomosynthesis-like techniques
TW201332788A (en) * 2011-11-07 2013-08-16 Ulvac Inc Ink-jet apparatus and droplet measuring method
TWI502269B (en) * 2009-07-31 2015-10-01 Holografika Hologrameloallito Fejleszto Es Forgalmazo Kft Method and apparatus for displaying 3d images
CN108633304A (en) * 2015-09-14 2018-10-09 艾森利克斯公司 Collection analysis steam condensation, the especially device of expiratory air condensation and system and application method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI502269B (en) * 2009-07-31 2015-10-01 Holografika Hologrameloallito Fejleszto Es Forgalmazo Kft Method and apparatus for displaying 3d images
US8508591B2 (en) * 2010-02-05 2013-08-13 Applied Vision Corporation System and method for estimating the height of an object using tomosynthesis-like techniques
CN102032872A (en) * 2010-11-03 2011-04-27 中南大学 Shadow method-based high-density BGA solder ball height measuring system and method
TW201332788A (en) * 2011-11-07 2013-08-16 Ulvac Inc Ink-jet apparatus and droplet measuring method
CN108633304A (en) * 2015-09-14 2018-10-09 艾森利克斯公司 Collection analysis steam condensation, the especially device of expiratory air condensation and system and application method

Also Published As

Publication number Publication date
TW202016512A (en) 2020-05-01

Similar Documents

Publication Publication Date Title
WO2020253827A1 (en) Method and apparatus for evaluating image acquisition accuracy, and electronic device and storage medium
US7978903B2 (en) Defect detecting method and defect detecting device
WO2017067342A1 (en) Board card position detection method and apparatus
WO2017020829A1 (en) Resolution testing method and resolution testing device
CN109472271B (en) Printed circuit board image contour extraction method and device
TW201350835A (en) Method of inspecting a wetting-up state of solder, automatic appearance inspecting device and substrate inspecting system using such a method
JP6115012B2 (en) Inspection device, inspection method, and inspection program
JP2018179698A (en) Sheet inspection device
TWI673686B (en) Video type water ruler scale detecting and identifying system and method
CN114266743A (en) FPC defect detection method, system and storage medium based on HSV and CNN
JP2019168388A (en) Image inspection method and image inspection device
TWI666426B (en) Liquid level detecting method
JP2005345290A (en) Streak-like flaw detecting method and streak-like flaw detector
KR20140073259A (en) Apparatus and Method for Detection MURA in Display Device
KR20060130109A (en) Substrate inspection device
CN112669272A (en) AOI rapid detection method and rapid detection system
JP2012007952A (en) Visual inspection device
JP2002310618A (en) Size measurement device, size measurement method and inspection device for electronic component
JP2009017158A (en) Camera inspection device
JP4821647B2 (en) Electronic component terminal position detection method
JP2007285868A (en) Luminance gradient detection method, flaw detection method, luminance gradient detector and flaw detector
KR20120036145A (en) Feature point detecting method of welding joint using laser vision system
JP4967132B2 (en) Defect inspection method for object surface
JP4491922B2 (en) Surface defect inspection method
JP3454162B2 (en) Inspection system for flat plate with holes