TWI806780B - System and method for detecting and compensating depth - Google Patents

System and method for detecting and compensating depth Download PDF

Info

Publication number
TWI806780B
TWI806780B TW111136766A TW111136766A TWI806780B TW I806780 B TWI806780 B TW I806780B TW 111136766 A TW111136766 A TW 111136766A TW 111136766 A TW111136766 A TW 111136766A TW I806780 B TWI806780 B TW I806780B
Authority
TW
Taiwan
Prior art keywords
depth
rectangular
deviation
sliding window
depth image
Prior art date
Application number
TW111136766A
Other languages
Chinese (zh)
Other versions
TW202412960A (en
Inventor
李境嚴
Original Assignee
中國鋼鐵股份有限公司
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 中國鋼鐵股份有限公司 filed Critical 中國鋼鐵股份有限公司
Priority to TW111136766A priority Critical patent/TWI806780B/en
Application granted granted Critical
Publication of TWI806780B publication Critical patent/TWI806780B/en
Publication of TW202412960A publication Critical patent/TW202412960A/en

Links

Images

Abstract

A system includes an object to be tested, multiple rotation modules, a depth sensing module and a computing module. The rotation modules rotate the object around an axis. The depth sensing module is arranged on one side of the object to obtain a rectangular depth image having a sampling direction and a rotation direction. The computing module applies a sliding window on the rectangular depth image, and the sliding window moves along the sampling direction to obtain multiple depth values. The computing module determines whether there is a deviation in the rectangular depth image according to the depth values, and compensates the deviation if so.

Description

深度檢測與補償系統與方法Depth detection and compensation system and method

本揭露是有關於旋轉待測物並掃描待測物側面深度的檢測系統與方法,特別是可補償旋轉時所造成的偏差。The present disclosure relates to a detection system and method for rotating a test object and scanning the depth of the side surface of the test object, especially to compensate for deviation caused by rotation.

在鋼廠中,鋼帶在經過冷軋以後的厚度較薄,容易產生邊裂或鋸齒邊缺陷,為了避免有邊緣缺陷的鋼帶進入後續的製程產生問題,必須依照檢測系統來檢查鋼帶的邊緣是否有缺陷。一種做法是將鋼帶盤捲為鋼卷以後利用攝影機來拍攝鋼卷的側面,但由於鋼卷的半徑相當大,攝影機難以涵蓋整個鋼卷的範圍。In the steel mill, the thickness of the steel strip after cold rolling is relatively thin, which is prone to edge cracks or jagged edge defects. In order to avoid problems caused by the steel strip with edge defects entering the subsequent process, the steel strip must be inspected according to the inspection system. Whether the edge is flawed. One method is to use a camera to shoot the side of the steel coil after the steel strip is coiled into a steel coil, but because the radius of the steel coil is quite large, it is difficult for the camera to cover the entire range of the steel coil.

本揭露的實施例提出一種深度檢測與補償系統,包括待測物、多個旋轉模組、深度感測模組與計算模組。旋轉模組用以將待測物繞著軸線旋轉,待測物從軸線視之的輪廓為圓形。深度感測模組設置在待測物的一側,用以取得矩形深度影像,其中矩形深度影像具有取樣方向與旋轉方向,深度感測模組的掃瞄範圍小於圓形的直徑。計算模組通訊連接至旋轉模組與深度感測模組,用以套用滑動視窗在矩形深度影像上,滑動視窗沿著取樣方向移動以得到多個深度值。計算模組用以根據深度值判斷矩形深度影像是否有偏差,若有的話補償偏差。Embodiments of the present disclosure provide a depth detection and compensation system, including an object to be measured, a plurality of rotating modules, a depth sensing module, and a computing module. The rotating module is used to rotate the object to be tested around the axis, and the outline of the object to be tested is circular when viewed from the axis. The depth sensing module is arranged on one side of the object to be measured to obtain a rectangular depth image, wherein the rectangular depth image has a sampling direction and a rotation direction, and the scanning range of the depth sensing module is smaller than the diameter of a circle. The calculation module is connected to the rotation module and the depth sensing module in communication, and is used to apply the sliding window on the rectangular depth image, and the sliding window moves along the sampling direction to obtain multiple depth values. The calculation module is used to judge whether there is a deviation in the rectangular depth image according to the depth value, and to compensate the deviation if there is.

在一些實施例中,滑動視窗在取樣方向上的長度大於1,滑動視窗在旋轉方向上的長度等於矩形深度影像在旋轉方向上的長度。計算模組用以根據滑動視窗執行一移動平均演算法,滑動視窗的每一個位置對應至一個深度值。In some embodiments, the length of the sliding window in the sampling direction is greater than 1, and the length of the sliding window in the rotation direction is equal to the length of the rectangular depth image in the rotation direction. The computing module is used to execute a moving average algorithm according to the sliding window, and each position of the sliding window corresponds to a depth value.

在一些實施例中,計算模組還用以計算每兩個相鄰的深度值之間的斜率,並根據斜率是否超出範圍來判斷矩形深度影像是否具有線性偏差或是非線性偏差。In some embodiments, the calculation module is also used to calculate the slope between every two adjacent depth values, and judge whether the rectangular depth image has a linear deviation or a nonlinear deviation according to whether the slope is out of range.

在一些實施例中,計算模組還用以根據深度值執行線性迴歸演算法,並根據線性迴歸演算法的結果來判斷矩形深度影像是否具有線性偏差或是非線性偏差。In some embodiments, the calculation module is also used to execute a linear regression algorithm according to the depth value, and determine whether the rectangular depth image has a linear deviation or a nonlinear deviation according to the result of the linear regression algorithm.

在一些實施例中,待測物為圓筒狀的鋼卷。In some embodiments, the object to be tested is a cylindrical steel coil.

以另一個角度來說,本揭露的實施例提出一種深度檢測與補償方法,適用於電腦系統。此深度檢測與補償方法包括:透過多個旋轉模組將待測物繞著軸線旋轉,其中待測物從軸線視之的輪廓為圓形;透過深度感測模組取得矩形深度影像,其中深度感測模組設置在待測物的一側,矩形深度影像具有取樣方向與旋轉方向,深度感測模組的掃瞄範圍小於圓形的直徑;套用滑動視窗在矩形深度影像上,滑動視窗沿著取樣方向移動以得到多個深度值;以及根據深度值判斷矩形深度影像是否有偏差,若有的話補償偏差。From another point of view, the embodiments of the present disclosure provide a depth detection and compensation method suitable for computer systems. The depth detection and compensation method includes: rotating the object to be measured around the axis through a plurality of rotation modules, wherein the outline of the object to be measured viewed from the axis is a circle; obtaining a rectangular depth image through the depth sensing module, wherein the depth The sensing module is set on one side of the object to be tested. The rectangular depth image has a sampling direction and a rotation direction. The scanning range of the depth sensing module is smaller than the diameter of a circle; apply a sliding window to the rectangular depth image, and slide the window along the moving along the sampling direction to obtain multiple depth values; and judging whether there is a deviation in the rectangular depth image according to the depth value, and compensating for the deviation if there is.

在一些實施例中,滑動視窗在取樣方向上的長度大於1,滑動視窗在旋轉方向上的長度等於矩形深度影像在旋轉方向上的長度。深度檢測與補償方法還包括:根據滑動視窗執行移動平均演算法,滑動視窗的每一個位置對應至其中一個深度值。In some embodiments, the length of the sliding window in the sampling direction is greater than 1, and the length of the sliding window in the rotation direction is equal to the length of the rectangular depth image in the rotation direction. The depth detection and compensation method further includes: performing a moving average algorithm according to the sliding window, and each position of the sliding window corresponds to one of the depth values.

在一些實施例中,深度檢測與補償方法還包括:計算兩個相鄰的深度值之間的斜率,並根據斜率是否超出範圍來判斷矩形深度影像是否具有線性偏差或是非線性偏差。In some embodiments, the depth detection and compensation method further includes: calculating a slope between two adjacent depth values, and judging whether the rectangular depth image has a linear deviation or a nonlinear deviation according to whether the slope is out of range.

在一些實施例中,深度檢測與補償方法還包括:根據深度值執行線性迴歸演算法,並根據線性迴歸演算法的結果來判斷矩形深度影像是否具有線性偏差或是非線性偏差。In some embodiments, the depth detection and compensation method further includes: performing a linear regression algorithm according to the depth value, and judging whether the rectangular depth image has a linear deviation or a nonlinear deviation according to the result of the linear regression algorithm.

為讓本發明的上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。In order to make the above-mentioned features and advantages of the present invention more comprehensible, the following specific embodiments are described in detail together with the accompanying drawings.

關於本文中所使用之「第一」、「第二」等,並非特別指次序或順位的意思,其僅為了區別以相同技術用語描述的元件或操作。The terms "first", "second" and the like used herein do not specifically refer to a sequence or sequence, but are only used to distinguish elements or operations described with the same technical terms.

圖1是根據一實施例繪示檢測系統的示意圖。請參照圖1,深度檢測與補償系統100包括了待測物110、多個旋轉模組121~122、深度感測模組130與計算模組140。待測物110例如為圓筒狀的鋼卷,但本揭露並不限於此,在其他實施例中待測物110也可以是圓柱狀或圓盤狀,待測物110的材料可以包含任意金屬、有機物、金屬化合物等材質。旋轉模組121~122可包括滾子以及馬達,用以將待測物110繞著軸線150旋轉。FIG. 1 is a schematic diagram illustrating a detection system according to an embodiment. Referring to FIG. 1 , the depth detection and compensation system 100 includes an object under test 110 , a plurality of rotating modules 121 - 122 , a depth sensing module 130 and a computing module 140 . The object to be tested 110 is, for example, a cylindrical steel coil, but the present disclosure is not limited thereto. In other embodiments, the object to be tested 110 may also be cylindrical or disc-shaped, and the material of the object to be tested 110 may include any metal , organic matter, metal compounds and other materials. The rotation modules 121 - 122 may include rollers and motors for rotating the object under test 110 around the axis 150 .

深度感測模組130可包含結構光模組、紅外光模組、雙攝影機模組、雷射距離感測器、或任意可以感測場景深度的模組。待測物110在軸線150上有兩側,從任何一側來觀察,待測物110的輪廓(最外圍的形狀)為圓形,深度感測模組130設置在其中一側,用以拍攝待測物110的側面。在一些實施例中,深度感測模組130為線掃描器,當待測物110旋轉時深度感測模組130持續掃描,所拍攝到的影像稱為矩形深度影像,特別的是深度感測模組130的掃瞄範圍小於上述圓形的直徑,例如只需要大於等於圓形的半徑。The depth sensing module 130 may include a structured light module, an infrared light module, a dual camera module, a laser distance sensor, or any module capable of sensing scene depth. The object to be tested 110 has two sides on the axis 150. Viewed from any side, the outline (the outermost shape) of the object to be tested 110 is a circle, and the depth sensing module 130 is arranged on one side for photographing The side surface of the object under test 110 . In some embodiments, the depth sensing module 130 is a line scanner. When the object 110 rotates, the depth sensing module 130 continuously scans, and the captured image is called a rectangular depth image, especially a depth sensing The scanning range of the module 130 is smaller than the diameter of the above-mentioned circle, for example, it only needs to be greater than or equal to the radius of the circle.

計算模組140通訊連接至深度感測模組130與旋轉模組121~122,此通訊連接可以用任意的有線或無線通訊手段來達成。計算模組140例如為中央控制器、處理器、電腦系統、伺服器、或任意有計算能力的電子裝置。計算模組140會控制旋轉模組121~122,藉此決定待測物110旋轉的角速度,計算模組140也會從深度感測模組130接收矩形深度影像。The computing module 140 is communicatively connected to the depth sensing module 130 and the rotating modules 121 - 122 , and this communication connection can be achieved by any wired or wireless communication means. The computing module 140 is, for example, a central controller, a processor, a computer system, a server, or any electronic device with computing capabilities. The calculation module 140 controls the rotation modules 121 - 122 to determine the rotational angular velocity of the object under test 110 , and the calculation module 140 also receives a rectangular depth image from the depth sensing module 130 .

待測物110在轉動時可能會有一些位移,這些位移會導致所感測的矩形深度影像有偏差。舉例來說,軸線160與軸線150垂直,待測物110可能會沿著軸線160旋轉一角度,造成待測物110有一部份會較靠近深度感測模組130,另一部分較遠離深度感測模組130,這使得所感測到的矩形深度影像有線性的偏差。此外,待測物110的旋轉速度可能不一致,這樣不定速的旋轉會使得感測到的矩形深度影像有非線性的偏差。計算模組140會執行一個深度檢測與補償方法,用以偵測矩形深度影像是否有偏差,若有的話會補償此偏差,以下將說明此方法。The object under test 110 may have some displacements when rotating, and these displacements will cause deviations in the sensed rectangular depth image. For example, the axis 160 is perpendicular to the axis 150, and the object under test 110 may be rotated at an angle along the axis 160, so that a part of the object under test 110 will be closer to the depth sensing module 130, and another part will be farther away from the depth sensing module 130. module 130, which makes the sensed rectangular depth image have a linear deviation. In addition, the rotation speed of the object under test 110 may be inconsistent, such that the rotation at an irregular speed will cause a non-linear deviation in the sensed rectangular depth image. The calculation module 140 will implement a depth detection and compensation method to detect whether there is a deviation in the rectangular depth image, and compensate the deviation if any. The method will be described below.

圖2是根據一實施例繪示深度檢測與補償方法的流程圖。圖3是根據一實施例繪示偵測偏差的示意圖。請參照圖2與圖3,在步驟201,透過深度感測模組取得矩形深度影像300,此矩形深度影像300具有取樣方向301與旋轉方向302。取樣方向301也是線掃描器的掃描方向,而旋轉方向302是待測物110的旋轉方向,線掃描器每掃描一次可以產生一列(row)的像素,每個像素的灰階代表深度,而隨著待測物110旋轉,在下個取樣時間線掃描器會取得下一列的像素。FIG. 2 is a flowchart illustrating a depth detection and compensation method according to an embodiment. FIG. 3 is a schematic diagram illustrating a detection deviation according to an embodiment. Referring to FIG. 2 and FIG. 3 , in step 201 , a rectangular depth image 300 is obtained through the depth sensing module. The rectangular depth image 300 has a sampling direction 301 and a rotation direction 302 . The sampling direction 301 is also the scanning direction of the line scanner, and the rotation direction 302 is the rotation direction of the object under test 110. The line scanner can generate a row of pixels per scan, and the gray scale of each pixel represents the depth. As the object under test 110 rotates, the line scanner will obtain the next row of pixels at the next sampling time.

在步驟202,判斷矩形深度影像300是否有偏差,如果有偏差,則在步驟203進一步判斷偏差種類。具體來說,可先套用一個滑動視窗(sliding window)310在矩形深度影像300上,此滑動視窗310在取樣方向301上的長度大於1(例如為3),滑動視窗310在旋轉方向302上的長度例如等於矩形深度影像300在旋轉方向302上的長度。滑動視窗310是用以執行移動平均演算法(moving average),也就是計算滑動視窗310內所有像素的平均。滑動視窗310是沿著取樣方向301移動,例如每次移動一或多個像素,在移動的過程中每一個位置都可計算出一個平均值。在一些實施例中,不同位置的滑動視窗310的範圍可彼此重疊。In step 202 , it is determined whether the rectangular depth image 300 has deviation, and if there is deviation, then in step 203 it is further determined the type of deviation. Specifically, a sliding window (sliding window) 310 can be applied on the rectangular depth image 300 first, the length of the sliding window 310 in the sampling direction 301 is greater than 1 (for example, 3), and the length of the sliding window 310 in the rotation direction 302 The length is, for example, equal to the length of the rectangular depth image 300 in the rotation direction 302 . The sliding window 310 is used to implement a moving average algorithm (moving average), that is, to calculate the average of all pixels within the sliding window 310 . The sliding window 310 moves along the sampling direction 301 , for example, one or more pixels each time, and an average value can be calculated for each position during the moving process. In some embodiments, the ranges of the sliding window 310 at different positions may overlap with each other.

為了說明起見,以下將利用移動平均演算法所計算出的平均稱為深度值,接下來根據這些深度值判斷矩形深度影像300是否有偏差。在沒有偏差的理想狀況,深度值的分佈類似於圖表320所示,其中橫軸為取樣方向,縱軸為深度值的大小,圖表320中的每一個點321都代表深度值,為了簡化起見在此並未標示所有的深度值321。此外,直線322代表這些深度值321的趨勢,理想狀況下直線322的斜率應該趨近於0。For the sake of illustration, the average calculated by using the moving average algorithm is referred to as the depth value hereinafter, and then it is determined whether the rectangular depth image 300 has a deviation according to these depth values. In an ideal situation without deviation, the distribution of depth values is similar to that shown in chart 320, wherein the horizontal axis is the sampling direction, and the vertical axis is the size of the depth value. Each point 321 in the chart 320 represents a depth value. For the sake of simplicity Not all depth values 321 are indicated here. In addition, the straight line 322 represents the trend of these depth values 321 , and ideally the slope of the straight line 322 should approach zero.

如上所述,當待測物110沿著垂直的軸線160旋轉一角度時會有線性偏差,此時深度值的分佈會類似於圖表330,這些深度值331會逐漸下降,因此代表趨勢的直線332的斜率會小於0;或者深度值331逐漸上升,代表趨勢的直線斜率大於0。當有非線性偏差時會形成圖表340,深度值341也是逐漸下降,但在不同的片段341~344中下降的速度不相同,也就是說片段342的斜率會大於片段343的斜率,片段343的斜率會大於片段344的斜率。或者,深度值341可逐漸上升,但在不同片段中的斜率不相同。在此可以利用斜率或是線性迴歸演算法來判斷是屬於哪一種偏差。As mentioned above, when the test object 110 is rotated along the vertical axis 160, there will be a linear deviation. At this time, the distribution of depth values will be similar to the graph 330. These depth values 331 will gradually decrease, so the straight line 332 representing the trend The slope of will be less than 0; or the depth value 331 will rise gradually, which means the slope of the straight line of the trend is greater than 0. When there is a non-linear deviation, a chart 340 will be formed, and the depth value 341 will also gradually decrease, but the speed of decline in different segments 341~344 is different, that is to say, the slope of segment 342 will be greater than that of segment 343, and the slope of segment 343 The slope will be greater than the slope of segment 344 . Alternatively, the depth value 341 may rise gradually, but with different slopes in different segments. Here, the slope or linear regression algorithm can be used to determine which kind of deviation it belongs to.

首先說明斜率的作法,首先從左至右(沿著取樣方向301)計算每兩個相鄰的深度值之間的斜率,

Figure 02_image001
表示第i個斜率,i為正整數。接下來設定一個範圍,表示為-R~+R,其中R為正整數。此外也設定一個基準值T,其初始值設定為0。對於每一個深度值
Figure 02_image001
,如果
Figure 02_image003
成立,則產生一個新的片段,並且設定新的基準值
Figure 02_image005
,否則處理下一個深度值。在處理所有的深度值以後,判斷片段的個數,如果片段的個數為0,則表示沒有偏差。如果片段的個數為1,則有可能是有個轉折點或是線性偏差,因此可以進一步判斷所有斜率
Figure 02_image001
的標準差,如果標準差在某個臨界值以下,則判斷為線性偏差。如果片段的個數大於1則表示非線性偏差。在圖表340的實施例中會產生片段342~344,這是因為片段交界處的斜率超出了上述的範圍。 Firstly, the method of slope is described. Firstly, the slope between every two adjacent depth values is calculated from left to right (along the sampling direction 301),
Figure 02_image001
Indicates the ith slope, where i is a positive integer. Next, set a range, expressed as -R~+R, where R is a positive integer. In addition, a reference value T is also set, and its initial value is set to 0. For each depth value
Figure 02_image001
,if
Figure 02_image003
is established, a new segment is generated and a new benchmark value is set
Figure 02_image005
, otherwise process the next depth value. After processing all the depth values, judge the number of fragments, if the number of fragments is 0, it means there is no deviation. If the number of fragments is 1, there may be a turning point or a linear deviation, so all slopes can be further judged
Figure 02_image001
The standard deviation of , if the standard deviation is below a certain critical value, it is judged as a linear deviation. A non-linear deviation is indicated if the number of fragments is greater than 1. In the embodiment of graph 340, segments 342-344 are generated because the slopes at the segment boundaries exceed the above-mentioned range.

接下來說明線性迴歸演算法,可以用一個線性函數來逼近所有的深度值,以下用

Figure 02_image007
表示第i個深度值。線性迴歸演算法是要執行以下數學式1的最佳化演算法。 [數學式1]
Figure 02_image009
Next, the linear regression algorithm is described. A linear function can be used to approximate all depth values. The following uses
Figure 02_image007
Indicates the i-th depth value. The linear regression algorithm is an optimization algorithm that executes the following Mathematical Expression 1. [mathematical formula 1]
Figure 02_image009

其中

Figure 02_image011
為深度值
Figure 02_image007
所對應在取樣方向上的位置,
Figure 02_image013
代表一個線性方程式,
Figure 02_image015
為變數,數學式1的目的是要找到一條直線來逼近這些深度值,變數
Figure 02_image017
代表直線的斜率。如果數學式1所計算出的誤差小於一臨界值且變數
Figure 02_image017
在範圍-R~+R之內,則表示矩形深度影像300沒有偏差。如果數學式1計算出的誤差小於臨界值但變數
Figure 02_image017
在範圍-R~+R之外,則表示為線性偏差。如果數學式1計算出的誤差大於等於臨界值,則表示為非線性偏差。當判斷為非線性偏差以後,可以再進一步判斷出片段,例如執行以下的最佳化演算法。 [數學式2]
Figure 02_image019
in
Figure 02_image011
is the depth value
Figure 02_image007
corresponding to the position in the sampling direction,
Figure 02_image013
represents a linear equation,
Figure 02_image015
is a variable, the purpose of Mathematical Formula 1 is to find a straight line to approximate these depth values, the variable
Figure 02_image017
represents the slope of the line. If the error calculated by Mathematical Formula 1 is less than a critical value and the variable
Figure 02_image017
Within the range −R˜+R, it means that the rectangular depth image 300 has no deviation. If the error calculated by Mathematical Formula 1 is less than the critical value but the variable
Figure 02_image017
Outside the range -R~+R, it is expressed as a linear deviation. If the error calculated by Mathematical Formula 1 is greater than or equal to the critical value, it is expressed as a nonlinear deviation. After the non-linear deviation is judged, the segment can be further judged, for example, the following optimization algorithm is executed. [mathematical formula 2]
Figure 02_image019

其中k為正整數,代表兩個片段的交界。線性方程式

Figure 02_image021
是用以逼近第一個片段內的深度值,而線性方程式
Figure 02_image023
是用以逼近第二個片段內的深度值。數學式2是要找到正整數k以及兩個線性方程式中的變數
Figure 02_image025
,使得數學式2的目標函數有最小的誤差。如果數學式2所計算出的誤差大於一第二臨界值,則表示有多於2個片段,可以新增一個片段重複類似的最佳化演算法,直到誤差小於第二臨界值為止。換言之,根據線性迴歸演算法的結果可判斷矩形深度影像300是否具有線性偏差或是非線性偏差。 Where k is a positive integer, representing the junction of two segments. linear equation
Figure 02_image021
is used to approximate the depth value in the first fragment, while the linear equation
Figure 02_image023
is used to approximate the depth value in the second fragment. Mathematical formula 2 is to find the positive integer k and the variables in the two linear equations
Figure 02_image025
, so that the objective function of Mathematical Formula 2 has the minimum error. If the error calculated by the mathematical formula 2 is greater than a second critical value, it means that there are more than 2 segments, and a similar optimization algorithm can be repeated until the error is smaller than the second critical value. In other words, according to the results of the linear regression algorithm, it can be determined whether the rectangular depth image 300 has a linear deviation or a nonlinear deviation.

除了上述斜率與線性迴歸的做法,本領域具有通常知識者當可採用任意的演算法來判斷深度值是否可近似為水平直線(無偏差)、斜直線(線性偏差)或多個片段(非線性偏差),本揭露並不限於上述做法。In addition to the above slope and linear regression methods, those skilled in the art can use any algorithm to determine whether the depth value can be approximated by a horizontal line (no bias), a sloped line (linear deviation) or multiple segments (non-linear Deviation), the present disclosure is not limited to the above-mentioned practice.

在偵測偏差以後,可以根據是否有偏差進行補償,如果沒有偏差則在步驟350不進行補償。如果是線性偏差,則可以在步驟204進行線性補償。具體來說,在上述做法中可以找到線性方程式的變數

Figure 02_image015
,對深度值
Figure 02_image007
的補償可以寫為
Figure 02_image027
。如果是採用斜率方法,則可以計算所有斜率
Figure 02_image001
的平均當作是斜率
Figure 02_image029
。如此一來,補償後的深度值會接近圖表320所示的水平直線。由於深度值
Figure 02_image007
代表矩形深度影像300多個像素的平均,因此可對所有對應像素都執行上述的補償。如果是非線性偏差,則可以在步驟205進行非線性補償。具體來說,在第一個片段中的補償類似於線性補償,寫為
Figure 02_image031
;在第二個片段中的補償寫為
Figure 02_image033
,如果有更多片段則以此類推。補償以後的深度值會接近圖表320所示的水平直線。類似的,由於深度值
Figure 02_image007
代表矩形深度影像300多個像素的平均,因此可對所有對應像素都執行上述的補償。 After the deviation is detected, compensation can be performed according to whether there is a deviation, and if there is no deviation, no compensation is performed in step 350 . If it is a linear deviation, linear compensation can be performed in step 204 . Specifically, the variable of the linear equation can be found in the above practice
Figure 02_image015
, for the depth value
Figure 02_image007
The compensation can be written as
Figure 02_image027
. In the case of the slope method, all slopes can be calculated
Figure 02_image001
The average of is taken as the slope
Figure 02_image029
. In this way, the compensated depth value will be close to the horizontal straight line shown in the graph 320 . Due to the depth value
Figure 02_image007
Represents the average of more than 300 pixels in the rectangular depth image, so the compensation described above can be performed on all corresponding pixels. If it is a nonlinear deviation, nonlinear compensation can be performed in step 205 . Specifically, the compensation in the first fragment is similar to the linear compensation, written as
Figure 02_image031
; the compensation in the second snippet is written as
Figure 02_image033
, and so on if there are more fragments. The compensated depth value will be close to the horizontal line shown in the graph 320 . Similarly, since the depth value
Figure 02_image007
Represents the average of more than 300 pixels in the rectangular depth image, so the compensation described above can be performed on all corresponding pixels.

請回到圖2,如果步驟202的結果為否或者是經過步驟204、205的補償,在步驟206中可以得到理想資料型態(類似於圖表320)。在步驟207,可以對補償後的矩形深度影像300進行後處理,例如將矩形影像的直角座標轉換為極座標,變成符合鋼捲形狀的圓形影像。Please return to FIG. 2 , if the result of step 202 is negative or after compensation in steps 204 and 205 , in step 206 an ideal data type (similar to the diagram 320 ) can be obtained. In step 207, post-processing may be performed on the compensated rectangular depth image 300, for example, converting the rectangular coordinates of the rectangular image into polar coordinates to become a circular image conforming to the shape of the steel coil.

在上述的深度檢測與補償系統中,藉由讓待測物旋轉,深度感測模組130的掃瞄範圍可以不用涵蓋整個待測物,可以降低深度感測模組130的硬體需求或是提升掃描精確度。此外,由於待測物可能會沿著垂直的軸線旋轉或是速度不固定導致感測的深度有偏差,在此也提出偵測並補償偏差的辦法。In the above-mentioned depth detection and compensation system, by rotating the object to be measured, the scanning range of the depth sensing module 130 does not need to cover the entire object to be measured, which can reduce the hardware requirements of the depth sensing module 130 or Improve scanning accuracy. In addition, since the object under test may rotate along the vertical axis or the speed is not fixed, the sensed depth may deviate, and a method for detecting and compensating the deviation is also proposed here.

雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明的精神和範圍內,當可作些許的更動與潤飾,故本發明的保護範圍當視後附的申請專利範圍所界定者為準。Although the present invention has been disclosed above with the embodiments, it is not intended to limit the present invention. Anyone with ordinary knowledge in the technical field may make some changes and modifications without departing from the spirit and scope of the present invention. The scope of protection of the present invention should be defined by the scope of the appended patent application.

100:深度檢測與補償系統 110:待測物 121,122:旋轉模組 130:深度感測模組 140:計算模組 150,160:軸線 201~207:步驟 300:矩形深度影像 301:取樣方向 302:旋轉方向 310:滑動視窗 320,330,340:圖表 321,331,341:深度值 322,332:直線 342~344:片段 350:步驟 100: Depth detection and compensation system 110: The object to be tested 121,122:Rotary module 130: Depth sensing module 140: Calculation module 150,160: axis 201~207: Steps 300: rectangular depth image 301: sampling direction 302: Rotation direction 310:Sliding window 320, 330, 340: Charts 321,331,341: Depth value 322,332: straight line 342~344: Fragment 350: step

圖1是根據一實施例繪示檢測系統的示意圖。 圖2是根據一實施例繪示深度檢測與補償方法的流程圖。 圖3是根據一實施例繪示偵測偏差的示意圖。 FIG. 1 is a schematic diagram illustrating a detection system according to an embodiment. FIG. 2 is a flowchart illustrating a depth detection and compensation method according to an embodiment. FIG. 3 is a schematic diagram illustrating a detection deviation according to an embodiment.

201~207:步驟 201~207: Steps

Claims (8)

一種深度檢測與補償系統,包括:一待測物;多個旋轉模組,用以將該待測物繞著一軸線旋轉,其中該待測物從該軸線視之的輪廓為圓形;一深度感測模組,設置在該待測物的一側,用以取得矩形深度影像,其中該矩形深度影像具有一取樣方向與一旋轉方向,該深度感測模組的掃瞄範圍小於該圓形的直徑;以及一計算模組,通訊連接至該些旋轉模組與該深度感測模組,用以套用一滑動視窗在該矩形深度影像上,其中該滑動視窗在該取樣方向上的長度大於1,該滑動視窗在該旋轉方向上的長度等於該矩形深度影像在該旋轉方向上的長度,其中該計算模組用以根據該滑動視窗執行一移動平均演算法,該滑動視窗沿著該取樣方向移動以得到多個深度值,該滑動視窗的每一位置對應至該些深度值的其中之一,其中該計算模組用以根據該些深度值判斷該矩形深度影像是否有偏差,若有的話補償該偏差。 A depth detection and compensation system, comprising: an object to be measured; a plurality of rotating modules for rotating the object to be measured around an axis, wherein the outline of the object to be measured viewed from the axis is circular; The depth sensing module is arranged on one side of the object to be measured to obtain a rectangular depth image, wherein the rectangular depth image has a sampling direction and a rotation direction, and the scanning range of the depth sensing module is smaller than the circle the diameter of the shape; and a calculation module, connected to the rotation modules and the depth sensing module in communication, for applying a sliding window on the rectangular depth image, wherein the length of the sliding window in the sampling direction greater than 1, the length of the sliding window in the rotation direction is equal to the length of the rectangular depth image in the rotation direction, wherein the calculation module is used to perform a moving average algorithm according to the sliding window, and the sliding window is along the The sampling direction is moved to obtain a plurality of depth values, and each position of the sliding window corresponds to one of the depth values, wherein the calculation module is used to judge whether the rectangular depth image has deviation according to the depth values, if Compensate for this deviation, if any. 如請求項1所述之深度檢測與補償系統,其中該計算模組還用以計算該些深度值中每兩個相鄰的該些深度值之間的斜率,並根據該斜率是否超出一範圍來判斷該矩形深度影像是否具有線性偏差或是非線性偏差。 The depth detection and compensation system as described in Claim 1, wherein the calculation module is also used to calculate the slope between every two adjacent depth values in the depth values, and according to whether the slope exceeds a range to determine whether the rectangular depth image has a linear deviation or a nonlinear deviation. 如請求項1所述之深度檢測與補償系統,其中該計算模組還用以根據該些深度值執行一線性迴歸演算法,並根據該線性迴歸演算法的結果來判斷該矩形深度影像是否具有線性偏差或是非線性偏差。 The depth detection and compensation system as described in Claim 1, wherein the calculation module is also used to execute a linear regression algorithm according to the depth values, and judge whether the rectangular depth image has Linear deviation or non-linear deviation. 如請求項1所述之深度檢測與補償系統,其中該待測物為圓筒狀的鋼卷。 The depth detection and compensation system according to Claim 1, wherein the object to be measured is a cylindrical steel coil. 一種深度檢測與補償方法,適用於一電腦系統,該深度檢測與補償方法包括:透過多個旋轉模組將一待測物繞著一軸線旋轉,其中該待測物從該軸線視之的輪廓為圓形;透過一深度感測模組取得一矩形深度影像,其中該深度感測模組設置在該待測物的一側,該矩形深度影像具有一取樣方向與一旋轉方向,該深度感測模組的掃瞄範圍小於該圓形的直徑;套用一滑動視窗在該矩形深度影像上,其中該滑動視窗在該取樣方向上的長度大於1,該滑動視窗在該旋轉方向上的長度等於該矩形深度影像在該旋轉方向上的長度;根據該滑動視窗執行一移動平均演算法,該滑動視窗沿著該取樣方向移動以得到多個深度值,該滑動視窗的每一位置對應至該些深度值的其中之一;以及根據該些深度值判斷該矩形深度影像是否有偏差,若有 的話補償該偏差。 A depth detection and compensation method suitable for a computer system, the depth detection and compensation method includes: rotating an object to be measured around an axis through a plurality of rotating modules, wherein the contour of the object to be measured viewed from the axis It is circular; a rectangular depth image is obtained through a depth sensing module, wherein the depth sensing module is arranged on one side of the object to be measured, the rectangular depth image has a sampling direction and a rotation direction, the depth sensing The scanning range of the measurement module is smaller than the diameter of the circle; a sliding window is applied on the rectangular depth image, wherein the length of the sliding window in the sampling direction is greater than 1, and the length of the sliding window in the rotation direction is equal to The length of the rectangular depth image in the rotation direction; perform a moving average algorithm according to the sliding window, the sliding window moves along the sampling direction to obtain a plurality of depth values, each position of the sliding window corresponds to these One of the depth values; and judging whether the rectangular depth image has deviation according to these depth values, if so Compensate for this deviation. 如請求項5所述之深度檢測與補償方法,還包括:計算該些深度值中每兩個相鄰的該些深度值之間的斜率,並根據該斜率是否超出一範圍來判斷該矩形深度影像是否具有線性偏差或是非線性偏差。 The depth detection and compensation method as described in claim 5, further comprising: calculating the slope between every two adjacent depth values among the depth values, and judging the depth of the rectangle according to whether the slope exceeds a range Whether the image has a linear bias or a non-linear bias. 如請求項5所述之深度檢測與補償方法,還包括:根據該些深度值執行一線性迴歸演算法,並根據該線性迴歸演算法的結果來判斷該矩形深度影像是否具有線性偏差或是非線性偏差。 The depth detection and compensation method as described in Claim 5, further comprising: performing a linear regression algorithm according to the depth values, and judging whether the rectangular depth image has a linear deviation or a nonlinearity according to the result of the linear regression algorithm deviation. 如請求項5所述之深度檢測與補償方法,其中該待測物為圓筒狀的鋼卷。 The depth detection and compensation method as described in Claim 5, wherein the object to be measured is a cylindrical steel coil.
TW111136766A 2022-09-28 2022-09-28 System and method for detecting and compensating depth TWI806780B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW111136766A TWI806780B (en) 2022-09-28 2022-09-28 System and method for detecting and compensating depth

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW111136766A TWI806780B (en) 2022-09-28 2022-09-28 System and method for detecting and compensating depth

Publications (2)

Publication Number Publication Date
TWI806780B true TWI806780B (en) 2023-06-21
TW202412960A TW202412960A (en) 2024-04-01

Family

ID=87803278

Family Applications (1)

Application Number Title Priority Date Filing Date
TW111136766A TWI806780B (en) 2022-09-28 2022-09-28 System and method for detecting and compensating depth

Country Status (1)

Country Link
TW (1) TWI806780B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05312528A (en) * 1992-05-14 1993-11-22 Nisshin Steel Co Ltd Method and apparatus for detecting winding profile of coil side face
KR20040020358A (en) * 2002-08-30 2004-03-09 주식회사 포스코 Device and method for telescope measurement for steel coil
CN101846504A (en) * 2009-03-26 2010-09-29 有进Instec株式会社 The shape inspection method and the testing fixture of sheet material volume
US8982337B2 (en) * 2009-07-31 2015-03-17 The Mill Steel Co. Apparatus for determining gauge profile for flat rolled material with laser-based lap counter
CN112654833A (en) * 2018-08-29 2021-04-13 Posco公司 Tower-shaped measuring device for rolled plate
CN113465511A (en) * 2021-06-19 2021-10-01 精锐视觉智能科技(上海)有限公司 Online measurement and omnibearing end surface defect online detection method for steel coil size
CN113701652A (en) * 2021-09-23 2021-11-26 安徽工业大学 Intelligent high-precision detection and defect diagnosis system for inner diameter of steel coil

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05312528A (en) * 1992-05-14 1993-11-22 Nisshin Steel Co Ltd Method and apparatus for detecting winding profile of coil side face
KR20040020358A (en) * 2002-08-30 2004-03-09 주식회사 포스코 Device and method for telescope measurement for steel coil
CN101846504A (en) * 2009-03-26 2010-09-29 有进Instec株式会社 The shape inspection method and the testing fixture of sheet material volume
US8982337B2 (en) * 2009-07-31 2015-03-17 The Mill Steel Co. Apparatus for determining gauge profile for flat rolled material with laser-based lap counter
CN112654833A (en) * 2018-08-29 2021-04-13 Posco公司 Tower-shaped measuring device for rolled plate
CN113465511A (en) * 2021-06-19 2021-10-01 精锐视觉智能科技(上海)有限公司 Online measurement and omnibearing end surface defect online detection method for steel coil size
CN113701652A (en) * 2021-09-23 2021-11-26 安徽工业大学 Intelligent high-precision detection and defect diagnosis system for inner diameter of steel coil

Similar Documents

Publication Publication Date Title
US8107064B2 (en) Disc wafer inspecting device and inspecting method
US20060070417A1 (en) Flatness monitor
CN110906875B (en) Visual processing method for aperture measurement
JP6314798B2 (en) Surface defect detection method and surface defect detection apparatus
WO2010084920A1 (en) Pantograph height measuring device and calibration method therefor
Che et al. Real-time monitoring of workpiece diameter during turning by vision method
TWI806780B (en) System and method for detecting and compensating depth
CN117649404A (en) Medicine packaging box quality detection method and system based on image data analysis
CN116630327B (en) Boiler state abnormity monitoring system based on thermodynamic diagram
TW202412960A (en) System and method for detecting and compensating depth
JP2019056671A (en) Wall surface damage inspection device
CN115791830A (en) Steel plate detection system, steel plate detection method and electronic equipment
CN115096202A (en) Method for detecting deformation defect of cylindrical surface to-be-detected body
JP2009079915A (en) Method and device for measuring micro-dimension
Zhang et al. The defects recognition of wheel tread based on linear CCD
JP2003254719A (en) Method of inspecting coating area
JP2009025078A (en) Luminance nonuniformity measurement method for uniform light source
JP5403653B2 (en) Disc-shaped substrate inspection equipment
Duan et al. Measuring of train wheel surface defect based on linear CCD imaging
JP5087165B1 (en) Adjustment device for outputting data for adjusting surface inspection device, adjustment data output method and program
TWI838193B (en) Method and device for measuring degree of bending of steel
JP5494303B2 (en) TFT array inspection apparatus and defect strength calculation method
TWI662251B (en) Three-dimensional linear detection method and system
Marcotuli et al. A Vision-based Measurement System for Semi-Finished Cylindrical Geometries
Chen et al. A novel method for real-time wafer positioning during transfer process