TWI788838B - Method for coordinate transformation from spherical to polar - Google Patents

Method for coordinate transformation from spherical to polar Download PDF

Info

Publication number
TWI788838B
TWI788838B TW110116564A TW110116564A TWI788838B TW I788838 B TWI788838 B TW I788838B TW 110116564 A TW110116564 A TW 110116564A TW 110116564 A TW110116564 A TW 110116564A TW I788838 B TWI788838 B TW I788838B
Authority
TW
Taiwan
Prior art keywords
order coefficient
angle
factor
dimensional image
value
Prior art date
Application number
TW110116564A
Other languages
Chinese (zh)
Other versions
TW202244752A (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 TW110116564A priority Critical patent/TWI788838B/en
Publication of TW202244752A publication Critical patent/TW202244752A/en
Application granted granted Critical
Publication of TWI788838B publication Critical patent/TWI788838B/en

Links

Images

Landscapes

  • Electron Beam Exposure (AREA)
  • Lenses (AREA)
  • Testing Of Optical Devices Or Fibers (AREA)
  • Investigating Or Analysing Materials By Optical Means (AREA)
  • Investigating, Analyzing Materials By Fluorescence Or Luminescence (AREA)

Abstract

This invention is a method for coordinate conversion performed by a processor or a device, possibly a computer-based device. At least one great orientation and one great position individually represented by spherical coordinates (θoo) and by polar coordinates (roo) on two-dimensional plane, and the effective focal length f of a lens set are used to determine a first-order coefficient k1 and a third-order coefficient k2 which make the radius r in polar coordinates be converted by the colatitude θ and its cube. The first-order coefficient k1 is proved as the effective focal length f and the third-order coefficient k2 is proved between -0.166f and 0.410f.

Description

球座標至極座標轉換方法 Spherical coordinates to polar coordinates conversion method

本創作係關於一種座標轉換方法;特別關於一種使用簡易數學公式之座標轉換方法,特別在於它的高適應性。 This creation is about a coordinate conversion method; especially about a coordinate conversion method using simple mathematical formulas, especially because of its high adaptability.

隨著消費性電子產品的蓬勃發展,相關攝像裝置亦日趨微型化,例如:原先需多顆鏡頭才能完成全景(panoramic)拼貼的攝像設備,也在魚眼鏡頭(fisheye camera)與數位訊號處理器(Digital Signal Processor,DSP)的搭配下,成功將全景攝像裝置縮小至掌上型的尺寸。 With the vigorous development of consumer electronics products, related camera devices are becoming increasingly miniaturized. For example, the camera equipment that originally required multiple lenses to complete a panoramic (panoramic) collage is also used in fisheye cameras and digital signal processing. With the combination of Digital Signal Processor (DSP), the panoramic camera device has been successfully reduced to the size of a palm.

理論上,透過鏡頭立體角(solid angle)與二維影像感測器像素(pixel)座標間的幾何關係,各角度的影像皆可透過三角函數的運算轉換出來。在2006年即有J.Kannala & S.S.Brandt揭示的魚眼鏡頭轉換公式(DOI:10.1109/TPAMI.2006.153)。如「第1圖」所示,立體角的方向係以球座標(spherical coordinate)的餘緯角(colatitude)θ以及方位角(azimuth)Φ表示;此方向的入射光經鏡片組LS以折射角β聚焦於二維影像感測器PX上,其極座標(polar coordinate)上的半徑r=f.tan(β),其中,f為該鏡片組LS的有效焦距。 Theoretically, through the geometric relationship between the solid angle of the lens and the pixel coordinates of the two-dimensional image sensor, the images at various angles can be converted through the operation of trigonometric functions. In 2006, there was a fisheye lens conversion formula disclosed by J.Kannala & S.S.Brandt (DOI: 10.1109/TPAMI.2006.153). As shown in "Figure 1", the direction of the solid angle is represented by the colatitude θ and the azimuth Φ in spherical coordinates; the incident light in this direction passes through the lens group LS at a refraction angle β is focused on the two-dimensional image sensor PX, and its radius on the polar coordinate (polar coordinate) r=f. tan(β), where f is the effective focal length of the lens set LS.

因應不同的拍攝需求,所述餘緯角θ與該半徑r的關係大致可分為三種模型,其中,第I型為正交投影(orthogonal projection)r=f.sinθ;第II型為平射投影(stereographic projection)r=f.2.tan(θ/2);以及第III型為等立體 角投影(equisolid angle projection)r=f.2.sin(θ/2)。 According to different shooting requirements, the relationship between the colatitude angle θ and the radius r can be roughly divided into three models, among which, type I is an orthogonal projection (orthogonal projection) r=f. sinθ; Type II is stereographic projection (stereographic projection) r=f. 2. tan(θ/2); and type III is isosteric Angle projection (equisolid angle projection) r=f. 2. sin(θ/2).

若鏡頭前兩倍f處放置一方格紙,其上有41×41條的正交直線(間隔為f),依序套用所述第I、II、III型的投影關係後,於該二維影像感測器PX上即呈現如「第2圖」由左至右的圖形。一般手機附加的魚眼鏡頭多為第I型(最左圖),雖能在不同角度呈現正交的影像,但是邊緣畫質被嚴重壓縮,不足以一般解析度還原;視訊會議或全景影像常用的魚眼鏡頭多為第II型(中圖),透過組合高差異性鏡片,雖犧牲一些鏡頭正前方的畫質,但可提升邊緣的解析度;另外,也有在鏡頭前方±60°內(i.e. field angle 120°)盡可能地呈現等大小的第III型(最右圖)。 If a square of graph paper is placed twice f in front of the lens, and there are 41×41 orthogonal straight lines on it (the interval is f), after sequentially applying the above-mentioned projection relationships of types I, II, and III, the two-dimensional The image sensor PX presents the graphics from left to right as shown in "Fig. 2". Most of the fisheye lenses attached to mobile phones are type I (the leftmost picture). Although they can present orthogonal images from different angles, the edge quality is severely compressed and cannot be restored with normal resolution; it is commonly used for video conferencing or panoramic images. Most of the fisheye lenses are Type II (middle picture). Through the combination of high-variance lenses, although the image quality directly in front of the lens is sacrificed, the resolution of the edge can be improved; in addition, there are also lenses within ±60° in front of the lens ( i.e. field angle 120°) as much as possible to present isometric type III (far right image).

魚眼鏡頭拍攝的二維影像,一般會經過DSP處理成後級設備能讀取的全景影像格式;或是直接將像素數據送至終端機(例如:個人電腦等計算機設備),再轉換成各種角度的影像。不論是前期的硬體處理還是後期的軟體處理,都需要將二維影像座標轉換成入射光的方向,或者是反過來,將外部要求的立體角所對應的二維影像切割下來,而其中最為重要且所含誤差最大的就是該半徑r與所述餘緯角θ間的轉換。 The two-dimensional images captured by the fisheye lens are generally processed by DSP into a panoramic image format that can be read by subsequent equipment; angled images. Whether it is the hardware processing in the early stage or the software processing in the later stage, it is necessary to convert the two-dimensional image coordinates into the direction of the incident light, or vice versa, to cut out the two-dimensional image corresponding to the externally required solid angle, and the most What is important and contains the largest error is the conversion between the radius r and the co-latitude angle θ.

根據J.Kannala & S.S.Brandt所揭示的多項式(polynomial)轉換法,顯示至少需到九階才能將該半徑r從小角度到大角度完整轉換r(θ)

Figure 110116564-A0101-12-0002-7
k1.θ+k2.θ3+k3.θ5+k4.θ7+k5.θ9。這五個轉換參數k1,k2,...,k5,加上光軸偏移與球面偏差的兩個校正參數,一共有七個變數要與實際結果作比對,以找出二維影像座標至所述餘緯角θ以及所述方位角Φ的轉換矩陣(matrix)。 According to the polynomial conversion method revealed by J.Kannala & SSBrandt, it is shown that at least nine orders are required to completely convert the radius r from a small angle to a large angle r(θ)
Figure 110116564-A0101-12-0002-7
k 1 . θ+k 2 . θ 3 +k 3 . θ 5 +k 4 . θ 7 +k 5 . θ 9 . The five transformation parameters k 1 , k 2 ,...,k 5 , plus the two correction parameters of optical axis offset and spherical deviation, have a total of seven variables to be compared with the actual results to find out the two A transformation matrix (matrix) from the dimensional image coordinates to the colatitude angle θ and the azimuth angle Φ.

然而實際應用時,七個變數極難取得穩定數值解(numerical solution),因此J.Kannala & S.S.Brandt最後建議使用三階近似法,r(θ)

Figure 110116564-A0101-12-0002-9
k1.θ+ k2.θ3,降低不確定性。雖然三階近似法較能得到穩定的數值解,但高階項次造成的過度配適(overfitting),如何影響座標轉換的還原情形,J.Kannala & S.S.Brandt並沒有多加詳述。 However, in practical applications, it is extremely difficult to obtain a stable numerical solution (numerical solution) for seven variables, so J.Kannala & SSBrandt finally suggested using the third-order approximation method, r(θ)
Figure 110116564-A0101-12-0002-9
k 1 . θ+ k 2 . θ 3 , reducing uncertainty. Although the third-order approximation method can obtain a stable numerical solution, J.Kannala & SSBrandt did not elaborate on how the overfitting caused by high-order terms affects the restoration of the coordinate transformation.

一種座標轉換方法,由一處理器或由一配備電腦之裝置實施,至少藉球座標之一大定向、二維座標之一大定位以及一鏡片組之有效焦距f,決定一一階係數k1以及一三階係數k2,使該二維座標之半徑(radius)r得由該球座標之餘緯角(colatitude)θ之一階項次與三階項次轉換而來,其係包含:決定該大定向之餘緯角θo以及對應的該大定位之半徑ro;設定該一階係數k1=f,並根據f、θo以及ro計算該三階係數k2;以及使該二維座標之半徑r=k1.θ+k2.θ3,且ro落於該二維座標轉換空間內最大半徑的0.7倍至1.2倍間。其中,該三階係數k2係介於-0.166f至0.410f間。 A coordinate conversion method implemented by a processor or a device equipped with a computer to determine a first-order coefficient k 1 at least by means of a large orientation of spherical coordinates, a large orientation of two-dimensional coordinates, and an effective focal length f of a lens group And a third-order coefficient k 2 , so that the radius r of the two-dimensional coordinate can be converted from the first-order item and the third-order item of the colatitude θ of the spherical coordinate, which includes: Determine the latitude angle θ o of the large orientation and the corresponding radius r o of the large orientation; set the first-order coefficient k 1 =f, and calculate the third-order coefficient k 2 according to f, θ o and r o ; and use The radius of the two-dimensional coordinate r=k 1 . θ+k 2 . θ 3 , and r o falls between 0.7 and 1.2 times the maximum radius in the two-dimensional coordinate transformation space. Wherein, the third-order coefficient k 2 is between -0.166f and 0.410f.

在其一實施例中,所述計算該三階係數k2之意義,係指k2=(ro-f.θo)/θo 3。在另一實施例中,所述計算該三階係數k2之意義,係指在ro=f.θo時,決定k2為-0.166/42到0.334/152之數值;反之,先決定一角度因子n為最接近

Figure 110116564-A0101-12-0003-10
[(s.f.θo 3)/(ro-f.θo)]之正整數,其中,在ro>f.θo時,s得從0.334至0.410中選擇,而在ro<f.θo時,s得從-0.166至-0.150中選擇,接著決定k2=f.s/n2。 In one embodiment, the meaning of calculating the third-order coefficient k 2 refers to k 2 =(r o -f.θ o )/θ o 3 . In another embodiment, the meaning of calculating the third-order coefficient k 2 refers to r o =f. When θ o , determine that k 2 is a value from -0.166/4 2 to 0.334/15 2 ; otherwise, first determine an angle factor n as the closest
Figure 110116564-A0101-12-0003-10
A positive integer of [(s.f.θ o 3 )/(r o -f.θ o )], where r o >f. When θ o , s has to be selected from 0.334 to 0.410, and in r o <f. When θ o , s has to be selected from -0.166 to -0.150, and then determine k 2 =f. s/n 2 .

為調適實際上因安裝該鏡片組所造成的差異,在每該球座標之方位角(azimuth)Φ皆有其對應之該三階係數k2,且所述決定該大定向之餘緯角θo以及對應的該大定位之半徑ro之意義,係指利用兩個或更多所述方位角的該大定位之半徑ro,找出以該大定向之餘緯角θo為圓錐角之圓錐截痕(conic section),例如:橢圓方程式;以及根據該圓錐截痕推測出每個所述 方位角上的該大定位之半徑ro(Φ)。 In order to adapt to the difference actually caused by installing the lens group, there is a corresponding third-order coefficient k 2 for each azimuth Φ of the spherical coordinates, and the latitude angle θ that determines the large orientation The significance of o and the corresponding radius r o of the large orientation refers to the use of the radius r o of the large orientation of two or more azimuth angles to find out that the remaining latitude angle θ o of the large orientation is the cone angle The conic section (conic section), such as: elliptic equation; and according to the conic section, the radius r o (Φ) of the large location on each of the azimuth angles is deduced.

又,一種座標轉換方法,由一處理器或由一配備電腦之裝置實施,藉球座標之一小定向與一大定向以及二維座標之一小定位與一大定位,決定一一階係數k1以及一三階係數k2,使該二維座標之半徑(radius)r得由該球座標之餘緯角(colatitude)θ之一階項次與三階項次轉換而來,其係包含:決定該小定向與該大定向之餘緯角θf、θo以及對應的該小定位與該大定位之半徑rf、ro,其中,該小定向之餘緯角θf係小於0.75(單位:弧度);計算k1=rff與k2=(ro-k1.θo)/θo 3;以及使該二維座標之半徑r=k1.θ+k2.θ3,且ro落於該二維座標轉換空間內最大半徑的0.7倍至1.2倍間。 In addition, a coordinate conversion method is implemented by a processor or a device equipped with a computer, by means of the small orientation and large orientation of spherical coordinates and the small orientation and large orientation of two-dimensional coordinates to determine a first-order coefficient k 1 and a third-order coefficient k 2 , so that the radius r of the two-dimensional coordinate can be converted from the first-order term and the third-order term of the colatitude θ of the spherical coordinate, which includes : Determine the residual latitude angle θ f and θ o between the small orientation and the large orientation and the corresponding radius r f and r o between the small orientation and the large orientation, wherein the residual latitude angle θ f of the small orientation is less than 0.75 (unit: radian); calculate k 1 =r ff and k 2 =(r o -k 1o )/θ o 3 ; and make the radius of the two-dimensional coordinate r=k 1 . θ+k 2 . θ 3 , and r o falls between 0.7 and 1.2 times the maximum radius in the two-dimensional coordinate transformation space.

為提升該一階係數k1之精度,其中,該小定向之餘緯角θf係小於0.23(單位:弧度)。特別適合未知的該有效焦距或是校正該有效焦距用。 In order to improve the accuracy of the first-order coefficient k 1 , the residual latitude angle θ f of the small orientation is smaller than 0.23 (unit: radian). It is especially suitable for the unknown effective focal length or for correcting the effective focal length.

更進一步地,一種座標轉換方法,由一處理器或由一配備電腦之裝置實施,藉球座標之複數個定向以及二維座標之複數個定位,決定一一階係數k1以及一三階係數k2,使該二維座標之半徑(radius)r得由該球座標之餘緯角(colatitude)θ之一階項次與三階項次轉換而來,其係包含:決定該複數個定向之餘緯角θi以及對應的該複數個定位之半徑ri;根據θi以及ri,決定該一階係數k1以及該三階係數k2;以及使該二維座標之半徑r=k1.θ+k2.θ3,且ri至少其一落於該二維座標轉換空間內最大半徑的0.7倍至1.2倍間。 Furthermore, a coordinate conversion method is implemented by a processor or a device equipped with a computer, and determines a first-order coefficient k 1 and a third-order coefficient by means of a plurality of orientations of spherical coordinates and a plurality of positioning of two-dimensional coordinates k 2 , so that the radius r of the two-dimensional coordinate can be converted from the first-order item and the third-order item of the colatitude θ of the spherical coordinate, which includes: determining the plurality of orientations The remaining latitude angle θ i and the corresponding radius r i of the plurality of locations; according to θ i and r i , determine the first-order coefficient k 1 and the third-order coefficient k 2 ; and make the radius r of the two-dimensional coordinates = k 1 . θ+k 2 . θ 3 , and at least one of r i falls between 0.7 times and 1.2 times the maximum radius in the two-dimensional coordinate transformation space.

所述決定該一階係數k1以及該三階係數k2之意義,係指初始化該一階係數k1以及該三階係數k2,以執行一雙搜索程序,藉由疊代或遞迴方式,去提供複數個參數值替代該一階係數k1以及該三階係數k2、執行一計分程序以得到一差異度為關係式[ri-(k1.θi+k2.θi 3)]2之總和並比較出最小的該 差異度與其代表的k1與k2The meaning of determining the first-order coefficient k 1 and the third-order coefficient k 2 refers to initializing the first-order coefficient k 1 and the third-order coefficient k 2 to perform a double search procedure by iterative or recursive way, to provide a complex number of parameter values to replace the first-order coefficient k 1 and the third-order coefficient k 2 , execute a scoring procedure to obtain a degree of difference as the relationship [r i -(k 1i +k 2 . θ i 3 )] 2 and compare the smallest degree of difference with its representative k 1 and k 2 .

所述決定該一階係數k1以及該三階係數k2之意義,係指設定該一階係數k1為一鏡片組之有效焦距f以及初始化該三階係數k2,以執行一單搜索程序,藉由疊代或遞迴方式,去提供複數個參數值替代該三階係數k2、執行一計分程序以得到一差異度為關係式[ri-(k1.θi+k2.θi 3)]2之總和並比較出最小的該差異度與其代表k2The meaning of determining the first-order coefficient k 1 and the third-order coefficient k 2 refers to setting the first-order coefficient k 1 as the effective focal length f of a lens group and initializing the third-order coefficient k 2 to perform a single search The program provides a complex number of parameter values to replace the third-order coefficient k 2 by an iterative or recursive method, and executes a scoring procedure to obtain a difference degree as a relation [r i -(k 1i +k 2. The sum of θ i 3 )] 2 and compare the minimum degree of difference with its representative k 2 .

所述決定該一階係數k1以及該三階係數k2之意義,係指計算複數個第一軸資料Xii 2與複數個第二軸資料Yi=rii,並決定該二階係數k2i[(Xi-<Xi>).(Yi-<Yi>)]/Σi(Xi-<Xi>)2以及該一階係數k1=<Yi>-k2.<Xi>,其中,<Xi>、<Yi>分別為該複數個第一軸資料與該複數個第二軸資料之算術平均值。 The meaning of determining the first-order coefficient k 1 and the third-order coefficient k 2 refers to calculating a plurality of first-axis data X ii 2 and a plurality of second-axis data Y i =r ii , And determine the second-order coefficient k 2i [(X i -<X i >). (Y i -<Y i >)]/Σ i (X i -<X i >) 2 and the first-order coefficient k 1 =<Y i >-k 2 . <X i >, wherein <X i > and <Y i > are the arithmetic mean of the plurality of first-axis data and the plurality of second-axis data respectively.

D:變形因子 D: deformation factor

DN:下方橫線 DN: horizontal line below

E:升率 E: Rising rate

f:鏡片組有效焦距 f: effective focal length of the lens group

k1:一階項次係數 k 1 : first-order item coefficient

k2:三階項次係數 k 2 : Third-order term coefficient

k3:五階項次係數 k 3 : fifth-order item coefficient

k4:七階項次係數 k 4 : Seventh-order item coefficient

k5:九階項次係數 k 5 : Ninth order term coefficient

LS:鏡片組 LS: lens group

n:角度因子 n: angle factor

OP:光軸 OP: optical axis

PX:二維影像感測器 PX: Two-dimensional image sensor

q:半係數 q: half coefficient

R:歸一化半徑 R: normalized radius

r:半徑 r: radius

rf:小定位之半徑 r f : Radius of small positioning

ri:複數個定位之半徑 r i : the radius of multiple positioning

r(θmax):極大值 r(θ max ): maximum value

r(θmin):極小值 r(θ min ): minimum value

ro:大定位之半徑 r o : the radius of the largest positioning

ST:測試器 ST: Tester

S:最佳化結果 S: Optimizing results

s:線性因子 s: linear factor

T:歸一化餘緯角 T: Normalized co-latitude angle

UP:上方橫線 UP: upper horizontal line

Xi:第一軸資料 X i : first axis data

Yi:第二軸資料 Y i : second axis data

<Xi>:第一軸資料之算術平均值 <X i >: Arithmetic mean of the data on the first axis

<Yi>:第二軸資料之算術平均值 <Y i >: Arithmetic mean of the second axis data

α:餘緯角除以角度因子 α: the co-latitude angle divided by the angle factor

β:折射角 β: Refraction angle

Φ:方位角 Φ: azimuth

θ:餘緯角 θ: co-latitude angle

θf:小定向之餘緯角 θ f : Minor orientation residual latitude angle

θi:複數個定向之餘緯角 θ i : Complementary latitude angles of multiple orientations

θmax:極大角 θ max : maximum angle

θmin:極小角 θ min : minimum angle

θo:大定向之餘緯角 θ o : the latitude angle of the maximum orientation

4:(3-1)等號右側之曲線 4: (3-1) The curve on the right side of the equal sign

63:(3-2)等號右側之曲線 63: (3-2) The curve on the right side of the equal sign

490:(3-3)等號右側之曲線 490: (3-3) The curve on the right side of the equal sign

11:sin2(θ/16)

Figure 110116564-A0101-12-0013-34
2/162)之曲線 11: sin 2 (θ/16)
Figure 110116564-A0101-12-0013-34
2 /16 2 ) curve

168:sin2(θ/8)

Figure 110116564-A0101-12-0013-35
2/82)之曲線 168: sin 2 (θ/8)
Figure 110116564-A0101-12-0013-35
2 /8 2 ) curve

749:sin2(θ/4)

Figure 110116564-A0101-12-0013-36
0.96(θ2/42)之曲線 749: sin 2 (θ/4)
Figure 110116564-A0101-12-0013-36
0.96(θ 2 /4 2 ) curve

163:2f.sin(θ/2)因應公式(11)之配適曲線 163:2f. The fitting curve of sin(θ/2) in response to formula (11)

165:3f.sin(θ/3)因應公式(11)之配適曲線 165:3f. The fitting curve of sin(θ/3) in response to formula (11)

166:4f.sin(θ/4)因應公式(11)之配適曲線 166:4f. The fitting curve of sin(θ/4) in response to formula (11)

41:2f.tan(θ/2)因應公式(11)之配適曲線 41:2f. Fitting curve of tan(θ/2) in response to formula (11)

36:3f.tan(θ/3)因應公式(11)之配適曲線 36:3f. Fitting curve of tan(θ/3) in response to formula (11)

35:4f.tan(θ/4)因應公式(11)之配適曲線 35:4f. Fitting curve of tan(θ/4) in response to formula (11)

831:3f.tan(θ/3)因應公式(11)之配適曲線 831:3f. Fitting curve of tan(θ/3) in response to formula (11)

5138:0.5.f.sin(θ)+0.5.f.tan(θ/2)因應公式(11)之配適曲線 5138:0.5. f. sin(θ)+0.5. f. Fitting curve of tan(θ/2) in response to formula (11)

2992:0.5.f.sin(θ)+0.71.f.sin(θ/2)因應公式(11)之配適曲線 2992:0.5. f. sin(θ)+0.71. f. The fitting curve of sin(θ/2) in response to formula (11)

第1圖係座標轉換之立體示意圖 Figure 1 is a three-dimensional schematic diagram of coordinate conversion

第2圖係習知立體座標至二維座標三種投影模型示意圖 Figure 2 is a schematic diagram of three projection models from three-dimensional coordinates to two-dimensional coordinates

第3圖係本創作之公式(3)在θ/4、θ/8與θ/16之關係圖 Figure 3 is the relationship diagram of formula (3) in this creation in θ/4, θ/8 and θ/16

第4圖係本創作之公式(11)在θ/2、θ/3與θ/4之關係圖 Figure 4 is the relationship between θ/2, θ/3 and θ/4 of the formula (11) in this creation

第5圖係本創作之第二實施例示意圖 Fig. 5 is a schematic diagram of the second embodiment of this creation

第6圖係本創作之第三實施例結果示範圖 Figure 6 is a demonstration figure of the results of the third embodiment of this creation

本說明書係以J.Kannala & S.S.Brandt(2006)所揭示的三階近似公式舉例,並以獨特方法求得三階近似的係數;但,不限定使用於三 階近似,使用同樣規則也能推至更高階的近似。 This manual uses the third-order approximation formula disclosed by J.Kannala & S.S.Brandt (2006) as an example, and obtains the coefficients of the third-order approximation with a unique method; however, it is not limited to the third-order approximation order approximation, using the same rules can also be deduced to a higher order approximation.

首先,利用倍角公式(double-angle formula)可以得到sin(θ/2)=8.sin(θ/16).cos(θ/4).cos(θ/8).cos(θ/16)...(1);由於在θ

Figure 110116564-A0101-12-0006-11
90°的範圍內θ/16<0.1,故8.sin(θ/16)可近似於θ/2(θ的單位在此說明書中為弧度)。利用此一近似項,將(1)改寫為sin(θ/2)
Figure 110116564-A0101-12-0006-12
(θ/2).cos(θ/4).cos(θ/8).cos(θ/16)...(2)。接著,因為cos2α+sin2α=1,且在α<20°的範圍內,(1/4).sin4α<<1-sin2α,故可延伸出一通式(general formula)cos2α
Figure 110116564-A0101-12-0006-13
1-sin2α+(1/4)sin4α=(1-0.5sin2α)2...(3)。 First, use the double-angle formula to get sin(θ/2)=8. sin(θ/16). cos(θ/4). cos(θ/8). cos(θ/16)...(1); since in θ
Figure 110116564-A0101-12-0006-11
θ/16<0.1 in the range of 90°, so 8. sin(θ/16) can be approximated to θ/2 (the unit of θ is radian in this specification). Using this approximation, rewrite (1) as sin(θ/2)
Figure 110116564-A0101-12-0006-12
(θ/2). cos(θ/4). cos(θ/8). cos(θ/16)...(2). Then, because cos 2 α+sin 2 α=1, and in the range of α<20°, (1/4). sin 4 α<<1-sin 2 α, so a general formula (general formula) cos 2 α can be extended
Figure 110116564-A0101-12-0006-13
1-sin 2 α+(1/4)sin 4 α=(1-0.5sin 2 α) 2 ... (3).

請參照「第3圖」,點線由上至下分別為cos(θ/16)、cos(θ/8)與cos(θ/4)隨所述餘緯角θ的關係,而虛線4、63、490則依(3)得出之曲線。也就是,cos(θ/16)

Figure 110116564-A0101-12-0006-14
1-0.5sin2(θ/16)...(3-1)、cos(θ/8)
Figure 110116564-A0101-12-0006-15
1-0.5sin2(θ/8)...(3-2)以及cos(θ/4)
Figure 110116564-A0101-12-0006-16
1-0.52sin2(θ/4)...(3-3);其中,cos(θ/4)函數有部分角度大於20°,故其係數由0.5調整為0.52。「第3圖」中點線與虛線間變異數(variance)開根號後,為百萬分之4、63與490,顯見其近似程度相當高。 Please refer to "Figure 3", the dotted lines from top to bottom are the relationship of cos(θ/16), cos(θ/8) and cos(θ/4) with the co-latitude angle θ, and the dotted lines 4, 63 and 490 are the curves obtained according to (3). That is, cos(θ/16)
Figure 110116564-A0101-12-0006-14
1-0.5sin 2 (θ/16)...(3-1), cos(θ/8)
Figure 110116564-A0101-12-0006-15
1-0.5sin 2 (θ/8)...(3-2) and cos(θ/4)
Figure 110116564-A0101-12-0006-16
1-0.52sin 2 (θ/4)...(3-3); Among them, the cos(θ/4) function has some angles greater than 20°, so its coefficient is adjusted from 0.5 to 0.52. After taking the square root of the variance between the dotted line and the dotted line in "Figure 3", it is 4, 63, and 490 parts per million, which shows that the degree of approximation is quite high.

因此,我們將(3)代入,並改寫(2)為sin(θ/2)

Figure 110116564-A0101-12-0006-17
(θ/2).[1-0.52sin2(θ/4)].[1-0.5sin2(θ/8)].[1-0.5sin2(θ/16)]...(4),或是sin(θ/2)
Figure 110116564-A0101-12-0006-18
(θ/2).{1-θ2.[(0.5/42)+(0.5/82)+(0.5/162)]}...(5);而後者,係(4)代入正弦函數的平方近似其角度的平方之關係。請參閱「第3圖」插圖,點線為正弦函數的平方而虛線為其角度的平方11、168、749,也就是sin2(θ/16)
Figure 110116564-A0101-12-0006-19
2/162)、sin2(θ/8)
Figure 110116564-A0101-12-0006-20
2/82)與sin2(θ/4)
Figure 110116564-A0101-12-0006-21
0.96(θ2/42)。「第3圖」插圖中點線與虛線間變異數開根號,為百萬分之11、168與749。最後,將(5)所有項次乘開即得到sin(θ/2)
Figure 110116564-A0101-12-0006-22
(θ/2).[1-0.16.(θ/2)2]...(6)。雖然sin2(θ/4)
Figure 110116564-A0101-12-0006-23
0.96(θ2/42) 間的變異數開根號為百萬分之749;但因合併cos(θ/4).cos(θ/8).cos(θ/16)的關係,最後(6)之正弦函數與其三階近似值間變異數開根號後,為百萬分之413。 Therefore, we substitute (3) and rewrite (2) as sin(θ/2)
Figure 110116564-A0101-12-0006-17
(θ/2). [1-0.52sin 2 (θ/4)]. [1-0.5sin 2 (θ/8)]. [1-0.5sin 2 (θ/16)]...(4), or sin(θ/2)
Figure 110116564-A0101-12-0006-18
(θ/2). {1-θ 2 . [(0.5/4 2 )+(0.5/8 2 )+(0.5/16 2 )]}...(5); and the latter is the relationship between (4) substituting the square of the sine function to approximate the square of its angle. Please refer to the illustration of "Figure 3", the dotted line is the square of the sine function and the dashed line is the square of the angle 11, 168, 749, which is sin 2 (θ/16)
Figure 110116564-A0101-12-0006-19
2 /16 2 ), sin 2 (θ/8)
Figure 110116564-A0101-12-0006-20
2 /8 2 ) and sin 2 (θ/4)
Figure 110116564-A0101-12-0006-21
0.96(θ 2 /4 2 ). The square root of the variance between the dotted line and the dashed line in the illustration of "Figure 3" is 11, 168, and 749 parts per million. Finally, multiply all terms in (5) to get sin(θ/2)
Figure 110116564-A0101-12-0006-22
(θ/2). [1-0.16. (θ/2) 2 ]...(6). Although sin 2 (θ/4)
Figure 110116564-A0101-12-0006-23
The root sign of the variance between 0.96(θ 2 /4 2 ) is 749 parts per million; but due to the combination of cos(θ/4). cos(θ/8). The relationship between cos(θ/16), the variance between the last (6) sine function and its third-order approximation is 413 parts per million.

與傳統上使用線性代數去解轉換矩陣不同,本創作藉由(1)至(6),可以直接得到第III型投影關係的轉換係數。雖然,第I型與第II型投影關係,明顯有較高階項次的依賴,但我們仍試著解析如下。 Different from the traditional use of linear algebra to solve the transformation matrix, this creation can directly obtain the transformation coefficient of the type III projection relationship through (1) to (6). Although the projection relationship between type I and type II obviously depends on higher-order items, we still try to analyze it as follows.

一樣利用倍角公式可以得到sin(θ)=16sin(θ/16).cos(θ/2).cos(θ/4).cos(θ/8).cos(θ/16),再假設cos(θ/2).cos(θ/4).cos(θ/8).cos(θ/16)

Figure 110116564-A0101-12-0007-24
{1-θ2.[(q/22)+(0.5/42)+(0.5/82)+(0.5/162)]}...(7),以及對半係數q作0.5附近的掃描,從最小變異數得到該半係數q應為0.44。最後,第I型投影關係的三階近似sin(θ)
Figure 110116564-A0101-12-0007-25
θ.(1-0.15.θ2)...(8),且正弦函數與其變異數開根號,為百萬分之5038,屬於可接受的近似結果。至於tan(θ/2),則利用恆等式tan(θ/2)=0.5.sinθ.[1+tan2(θ/2)],套用(8)得到tan(θ/2)
Figure 110116564-A0101-12-0007-27
(θ/2).[1+0.39.(θ/2)2]...(9),且正切函數與其變異數開根號為百萬分之5510,也屬於可接受的近似結果。 Also use the double angle formula to get sin(θ)=16sin(θ/16). cos(θ/2). cos(θ/4). cos(θ/8). cos(θ/16), and then assume cos(θ/2). cos(θ/4). cos(θ/8). cos(θ/16)
Figure 110116564-A0101-12-0007-24
{1-θ 2 . [(q/2 2 )+(0.5/4 2 )+(0.5/8 2 )+(0.5/16 2 )]}...(7), and scan the half coefficient q around 0.5, from the minimum The coefficient of variation obtained by this semi-coefficient q should be 0.44. Finally, the third-order approximation sin(θ) of the type I projection relation
Figure 110116564-A0101-12-0007-25
θ. (1-0.15.θ 2 )...(8), and the square root of the sine function and its variance is 5038 parts per million, which is an acceptable approximate result. As for tan(θ/2), use the identity tan(θ/2)=0.5. sin θ. [1+tan 2 (θ/2)], apply (8) to get tan(θ/2)
Figure 110116564-A0101-12-0007-27
(θ/2). [1+0.39. (θ/2) 2 ]...(9), and the root sign of the tangent function and its variance is 5510 parts per million, which is also an acceptable approximate result.

據此,我們設定一投影關係通式r(θ/n)=f.θ.[1+s.(θ/n)2]...(10),或是將所述餘緯角θ與該半徑r(θ)分別除一極大角θmax與一極大值r(θmax)後,以歸一化餘緯角T與歸一化半徑R(T)重新表示(10),也就是R(T)/T=D.[1+s.(θmax/n)2.T2]=D.(1+E.T2)...(11),其中,變形因子D=f.θmax/r(θmax),角度因子n為正整數1、2、3、...,以及線性因子s從-0.17到0.41與升率E。以下舉例,係以該二維影像感測器PX能感測到最大的角度以及最遠的距離附近為該極大角θmax與該極大值r(θmax),例如:該極大角 θmax=90°以及該極大值r(θmax)=1000像素。該極大角θmax並不代表該鏡片組LS所能收集光線的最大角度,且該極大值r(θmax)也不代表該二維影像感測器PX能感測到最遠距離,不能以本說明書之舉例限定本創作之實施範圍。 Accordingly, we set a projection relation general formula r(θ/n)=f. θ. [1+s. (θ/n) 2 ]...(10), or after dividing the co-latitude angle θ and the radius r(θ) respectively by a maximum angle θ max and a maximum value r(θ max ), the normalized The normalized co-latitude angle T and the normalized radius R(T) represent (10) again, that is, R(T)/T=D. [1+s. (θ max /n) 2 . T 2 ]=D. (1+E.T 2 )...(11), wherein, deformation factor D=f. θ max /r(θ max ), the angle factor n is a positive integer 1, 2, 3, ..., and the linear factor s from -0.17 to 0.41 and the rate of rise E. In the following example, the maximum angle and the farthest distance that the two-dimensional image sensor PX can sense are the maximum angle θ max and the maximum value r(θ max ), for example: the maximum angle θ max = 90° and the maximum r(θ max )=1000 pixels. The maximum angle θ max does not represent the maximum angle at which the lens group LS can collect light, and the maximum value r(θ max ) does not represent the maximum distance that the two-dimensional image sensor PX can sense. The examples in this specification limit the implementation scope of this creation.

請參照「第4圖」,上方三圖點線由左至右分別為r(θ)=2f.sin(θ/2)、3f.sin(θ/3)與4f.sin(θ/4)時,R(T)/T隨該歸一化餘緯角平方T2的關係;下方三圖點線由左至右為r(θ)=2f.tan(θ/2)、3f.tan(θ/3)與4f.tan(θ/4)時,R(T)/T隨該歸一化餘緯角平方T2的關係。透過(11)的歸一化投影關係通式,我們可以使用最小變異數的配適法去找出該線性因子,對應至r(θ)=2f.sin(θ/2)、3f.sin(θ/3)與4f.sin(θ/4)時,s分別為-0.163、-0.165及-0.166,且其配適結果分別為上方三圖虛線163、165、166;以及對應至r(θ)=2f.tan(θ/2)、3f.tan(θ/3)與4f.tan(θ/4)時,s分別為0.41、0.36及0.35,且其配適結果分別為下方三圖虛線41、36、35。當該變形因子D

Figure 110116564-A0101-12-0008-28
1且該角度因子n
Figure 110116564-A0101-12-0008-29
4,該線性因子s趨近於一固定值-0.166;反之,當該變形因子D<1且該角度因子n
Figure 110116564-A0101-12-0008-30
15,該線性因子s趨近於一固定值0.334。 Please refer to "Figure 4", the dotted lines in the upper three figures from left to right are r(θ)=2f. sin(θ/2), 3f. sin(θ/3) and 4f. When sin(θ/4), the relationship between R(T)/T and the square T 2 of the normalized colatitude angle; the dotted lines in the three figures below are r(θ)=2f from left to right. tan(θ/2), 3f. tan(θ/3) and 4f. When tan(θ/4), the relationship between R(T)/T and the square T 2 of the normalized colatitude angle. Through the general formula of normalized projection relation in (11), we can use the fitting method of minimum variation to find out the linear factor, which corresponds to r(θ)=2f. sin(θ/2), 3f. sin(θ/3) and 4f. When sin(θ/4), s are -0.163, -0.165 and -0.166 respectively, and the fitting results are the dotted lines 163, 165 and 166 in the three figures above; and correspond to r(θ)=2f. tan(θ/2), 3f. tan(θ/3) and 4f. When tan(θ/4), s are 0.41, 0.36, and 0.35 respectively, and the fitting results are the dotted lines 41, 36, and 35 in the three figures below. When the deformation factor D
Figure 110116564-A0101-12-0008-28
1 and the angle factor n
Figure 110116564-A0101-12-0008-29
4. The linear factor s tends to a fixed value -0.166; on the contrary, when the deformation factor D<1 and the angle factor n
Figure 110116564-A0101-12-0008-30
15, the linear factor s tends to a fixed value of 0.334.

因此,本創作之第一實施例係先找出該二維影像感測器PX之該極大值r(θmax)以及其對應的該極大角θmax,根據所使用的該鏡片組LS之有效焦距f,計算出該變形因子D=f.θmax/r(θmax);再透過(11)在T=R=1時的關係,s.(θmax/n)2=E=(1-D)/D,得到(10)或(11)中的係數。由於第一實施例係利用較大的該半徑,故該升率E有可能偏高,但若對轉換後的座標位置要求不是太高,此仍不失為一快速取得該轉換矩陣的好方法。 Therefore, the first embodiment of the present invention first finds the maximum value r(θ max ) of the two-dimensional image sensor PX and the corresponding maximum angle θ max , according to the effective Focal length f, calculate the deformation factor D = f. θ max /r(θ max ); then through the relationship of (11) at T=R=1, s. (θ max /n) 2 =E=(1-D)/D, get the coefficient in (10) or (11). Since the first embodiment uses a relatively large radius, the rate of increase E may be relatively high. However, if the requirements for the converted coordinate position are not too high, this is still a good method to quickly obtain the conversion matrix.

請參照「第5圖」,本創作之第二實施例係先決定除零以外最小的所述餘緯角以及其對應的該半徑為一極小角θmin與一極小值r(θmin),以 及該極大角θmax與該極大值r(θmax)。實施時,在該鏡片組LS前方放置一測試器ST,例如:能投射橫向、格狀光源或是具橫向、格狀之圖案板,並於光軸OP附近上下移動,以在該二維影像感測器PX產生出一對稱的上方橫線UP以及一下方橫線DN;從該光軸OP附近移動的距離以及該測試器ST與該鏡片組LS的距離,即可推算出θmin與r(θmin)。另外,也能在該鏡片組LS對稱之兩側各放上一個該測試器ST,如此θmax可設為90°而r(θmax)也能從該二維影像感測器PX得到。據此計算出f=r(θmin)/θmin、D=f.θmax/r(θmax)以及E=(1-D)/D。由於第二實施例係利用最接近該光軸的θmin與r(θmin),故該升率E有可能偏低,但若對轉換後的座標位置要求不是太高,且該有效焦距f不可得,此仍不失為一快速取得該轉換矩陣的好方法。 Please refer to "Fig. 5", the second embodiment of the invention is to first determine the minimum colatitude angle other than zero and its corresponding radius as a minimum angle θ min and a minimum value r(θ min ), And the maximum angle θ max and the maximum value r(θ max ). During implementation, a tester ST is placed in front of the lens group LS, for example: it can project a horizontal or grid-shaped light source or a horizontal or grid-shaped pattern plate, and move up and down near the optical axis OP to test the two-dimensional image The sensor PX produces a symmetrical upper horizontal line UP and a lower horizontal line DN; from the moving distance near the optical axis OP and the distance between the tester ST and the lens group LS, θ min and r can be calculated (θ min ). In addition, one tester ST can also be placed on both symmetrical sides of the lens group LS, so that θ max can be set to 90° and r(θ max ) can also be obtained from the two-dimensional image sensor PX. Based on this, f=r(θ min )/θ min and D=f are calculated. θ max /r(θ max ) and E=(1-D)/D. Since the second embodiment utilizes θ min and r(θ min ) which are closest to the optical axis, the rate of increase E may be low, but if the requirements for the converted coordinate position are not too high, and the effective focal length f Unavailable, this is still a good way to quickly obtain the transformation matrix.

本創作之第三實施例係以複數個該歸一化餘緯角T以及其對應的該歸一化半徑R(T)來配適(11),配適結果可以選擇最小變異數時的係數或者是選擇變異數對該升率E微分為零時的係數;其中,前者係藉由疊代或遞迴方式將係數測試出來,而後者係藉由最小平方法(least square)的斜率及截距公式得出,兩者皆為常用線性迴歸(linear regression)之方法,故本說明書不再贅述。除此之外,由於(11)裡的D=f.θmax/r(θmax)差異性通常不大,故可以採用鏡頭廠所提供的該有效焦距f的數據,搭配θmax以及r(θmax)直接固定該一階係數k1;如此,便僅需掃描測試該三階係數k2即可。 The third embodiment of the present creation is to fit (11) with a plurality of the normalized colatitude angles T and the corresponding normalized radius R(T), and the fitting result can choose the coefficient of the minimum variation Or select the coefficient when the variation is zero for the differential of the rate E; the former is to test the coefficient by iterative or recursive methods, and the latter is to use the slope and cutoff of the least square method (least square) According to the distance formula, both are commonly used linear regression methods, so this manual will not repeat them. Besides, since D=f in (11). The difference of θ max /r(θ max ) is usually not large, so the data of the effective focal length f provided by the lens manufacturer can be used, and the first-order coefficient k 1 can be fixed directly with θ max and r(θ max ); thus, It is only necessary to scan and test the third-order coefficient k 2 .

請參照「第6圖」,由左至右係r(θ)=3f.tan(θ/3)、r(θ)=0.5.f.sin(θ)+0.5.f.tan(θ/2)以及r(θ)=0.5.f.sin(θ)+0.71.f.sin(θ/2)之歸一化投影關係(點線),以及第三實施例藉最小平方法公式得出的配適結果(虛線)831、5138、2992。可以看到,即使是任意搭配出的投影關係,依然適用 於本創作之方法,且「第6圖」中點線與虛線間變異數開根號由左至右,為百萬分之831、5138、2992,近似效果不錯。 Please refer to "Figure 6", from left to right, r(θ)=3f. tan(θ/3), r(θ)=0.5. f. sin(θ)+0.5. f. tan(θ/2) and r(θ)=0.5. f. sin(θ)+0.71. f. The normalized projection relationship (dotted line) of sin(θ/2), and the fitting results (dotted line) 831, 5138, 2992 obtained by the formula of the least square method in the third embodiment. It can be seen that even if the projection relationship is arbitrarily matched, it is still applicable In the method of this creation, and the root sign of the variation between the dotted line and the dotted line in "Figure 6" is from left to right, which are 831, 5138, and 2992 parts per million, and the approximate effect is good.

本創作之第四實施例,係先找出該二維影像感測器PX之該極大值r(θmax)以及該極大角θmax,再根據該有效焦距f,計算出該變形因子D=f.θmax/r(θmax)。由於(11)在T=R=1時,s.D/(1-D)=(n/θmax)2;故設D<1時s=0.334以及在D>1時s=-0.166,以此決定n為最接近θmax

Figure 110116564-A0101-12-0010-31
[s.D/(1-D)]的正整數,但D=1時則令n=15。如此,藉由該有效焦距f以及θmax與其對應的r(θmax)。實施時,亦可在D<1時,藉由疊代或遞迴方式在0.334至0.410間選擇s,最後找出能得到最接近正整數之該角度因子n以及其對應的該線性因子s;同理,在D>1時,藉由疊代或遞迴方式在-0.166至-0.150間選擇s,最後找出能得到最接近正整數之該角度因子n以及其對應的該線性因子s。 In the fourth embodiment of the present invention, the maximum value r(θ max ) and the maximum angle θ max of the two-dimensional image sensor PX are found first, and then the deformation factor D= is calculated according to the effective focal length f f. θ max /r(θ max ). Because (11) when T=R=1, s. D/(1-D)=(n/θ max ) 2 ; so set s=0.334 when D<1 and s=-0.166 when D>1, so as to determine n is the closest to θ max .
Figure 110116564-A0101-12-0010-31
[s. D/(1-D)] is a positive integer, but when D=1, n=15. Thus, by the effective focal length f and θ max and its corresponding r(θ max ). During implementation, it is also possible to select s between 0.334 and 0.410 by iterative or recursive methods when D<1, and finally find out the angle factor n and the corresponding linear factor s that can obtain the closest positive integer; Similarly, when D>1, select s between -0.166 and -0.150 by iterative or recursive methods, and finally find out the angle factor n and the corresponding linear factor s that can get the closest positive integer.

也就是說,藉由調整該線性因子s的數值,找出該鏡片組LS對應的該角度因子n為哪一個正整數。在ro=f.θo時,從-0.166/42到0.334/152間決定該三階係數k2。在ro>f.θo時,初始化一目標值、一最佳化結果S以及該線性因子s,以執行一最佳化程序,藉由疊代或遞迴方式,去掃描0.334至0.410之參數值為該線性因子s、執行一計分程序以得到該角度因子n以及一分數為|n-

Figure 110116564-A0101-12-0010-32
[(s.f.θo 3)/(ro-f.θo)]|並在該分數小於或等於該目標值時做更新。所述更新係重設該最佳化結果S為當下的該線性因子s;以及重設該目標值為該分數。在該最佳化程序結束後,計算f.s/n2為該三階係數k2。反之,在ro<f.θo時,初始化該目標值、該最佳化結果S以及該線性因子s,以執行一最佳化程序,藉由疊代或遞迴方式,去掃描介於-0.166至-0.150之參數值為該線性因子s、執行該計分程序以得到該角度因子n以及該分數為 |n-
Figure 110116564-A0101-12-0011-33
[(s.f.θo 3)/(ro-f.θo)]|並在該分數小於或等於該目標值時做更新。所述更新係重設該最佳化結果S為當下的該線性因子s;以及重設該目標值為該分數。在該最佳化程序結束後,計算f.S/n2為該三階係數k2。 That is to say, by adjusting the value of the linear factor s, it is found out which positive integer the angle factor n corresponding to the lens set LS is. At r o =f. When θ o , the third-order coefficient k 2 is determined from -0.166/4 2 to 0.334/15 2 . At r o >f. When θ o , initialize a target value, an optimization result S and the linear factor s to execute an optimization procedure, and scan the parameter values from 0.334 to 0.410 for the linear factor by iterative or recursive methods s, execute a scoring procedure to obtain the angle factor n and a score of |n-
Figure 110116564-A0101-12-0010-32
[(s.f.θ o 3 )/(r o -f.θ o )]| and update when the score is less than or equal to the target value. The updating is resetting the optimization result S to the current linear factor s; and resetting the target value to the score. After the optimization procedure is finished, calculate f. s/n 2 is the third-order coefficient k 2 . On the contrary, in r o <f. When θ o , initialize the target value, the optimization result S and the linear factor s to execute an optimization procedure, and scan the parameter values between -0.166 and -0.150 by iterative or recursive methods For the linear factor s, execute the scoring procedure to obtain the angular factor n and the score is |n-
Figure 110116564-A0101-12-0011-33
[(s.f.θ o 3 )/(r o -f.θ o )]| and update when the score is less than or equal to the target value. The updating is resetting the optimization result S to the current linear factor s; and resetting the target value to the score. After the optimization procedure is finished, calculate f. S/n 2 is the third-order coefficient k 2 .

本創作透過數學方法將所述餘緯角與該半徑間的投影關係,經由簡單公式計算出來,毋須費時費力進行掃描測試,也不致陷入過度配適的泥淖;特別在於,球座標至極座標轉換的該角度因子,可藉由一定範圍內的該線性因子得出。因此,即使該鏡片組LS與該二維影像感測器PX組裝發生誤差,也能使用本創作之座標轉換方法,做為該轉換矩陣的初始化參數,節省搜尋及運算時間。 This creation uses mathematical methods to calculate the projection relationship between the co-latitude angle and the radius through a simple formula, without the need for time-consuming and laborious scanning tests, and will not fall into the quagmire of over-fitting; especially, the conversion from spherical coordinates to polar coordinates The angle factor can be obtained by the linear factor within a certain range. Therefore, even if there is an error in the assembly of the lens set LS and the two-dimensional image sensor PX, the coordinate transformation method of the present invention can be used as the initialization parameter of the transformation matrix, saving search and calculation time.

綜上所述,本創作之座標轉換方法,確已符合專利申請之要件,爰依法提出專利申請。惟以上所述者,僅為本創作之較佳實施例,當不能以此限定本創作實施之範圍;故,凡依本創作申請專利範圍及說明書內容所作之簡單的等效變化與修飾,皆應仍屬本創作專利涵蓋之範圍內。 To sum up, the coordinate conversion method of this creation has indeed met the requirements for patent application, and a patent application is filed according to law. However, the above is only a preferred embodiment of this creation, and should not limit the scope of implementation of this creation; therefore, all simple equivalent changes and modifications made according to the patent scope of this creation and the content of the specification are all It should still be within the scope covered by this creation patent.

DN:下方橫線 DN: horizontal line below

f:鏡片組有效焦距 f: effective focal length of the lens group

LS:鏡片組 LS: lens group

OP:光軸 OP: optical axis

PX:二維影像感測器 PX: Two-dimensional image sensor

r(θmax):極大值 r(θ max ): maximum value

ST:測試器 ST: Tester

UP:上方橫線 UP: upper horizontal line

θmin:極小角 θ min : minimum angle

Claims (3)

一種座標轉換方法,由一處理器或由一配備電腦之裝置實施,其係包含以下步驟:接收一攝像處理器提供的二維影像以及影像參數,其中,該攝像處理器係基於一二維影像感測器產生的電訊號,處理成該二維影像以及該影像參數;根據該影像參數決定一鏡片組對應的投影關係,其中,該鏡片組係收集一魚眼視角內光線以聚焦於該二維影像感測器、該二維影像感測器係位於該鏡片組之有效焦距f上、該魚眼視角的半角可表示為一大定向之餘緯角θo以及該影像參數係用以決定一大定位之半徑ro;設定一階係數k1=f,並根據f、θo以及ro計算三階係數k2;以及轉換該二維影像,使其以球座標形式展現像素值,且餘緯角(colatitude)、方位角(azimuth)與該二維影像感測器上極座標半徑各自表示為θ、Φ與r,其中,所述轉換係基於r=k1.θ+k2.θ3、所述決定一鏡片組對應的投影關係係以ro與f.θo比例大小決定該投影關係、ro與所述光線聚焦於該二維影像感測器之最大範圍有關並落於f.θo的0.7倍至1.2倍間以及該三階係數k2係介於-0.166f至0.410f間。 A coordinate conversion method implemented by a processor or a device equipped with a computer, which includes the following steps: receiving a two-dimensional image and image parameters provided by a camera processor, wherein the camera processor is based on a two-dimensional image The electrical signal generated by the sensor is processed into the two-dimensional image and the image parameters; according to the image parameters, the corresponding projection relationship of a lens group is determined, wherein the lens group collects light in a fisheye angle of view to focus on the two A three-dimensional image sensor, the two-dimensional image sensor is located on the effective focal length f of the lens group, the half-angle of the fisheye viewing angle can be expressed as a large directional latitude angle θ o , and the image parameters are used to determine A large positioning radius r o ; set the first-order coefficient k 1 =f, and calculate the third-order coefficient k 2 according to f, θ o and r o ; and convert the two-dimensional image to display pixel values in spherical coordinates, And the colatitude, azimuth and polar coordinate radius on the two-dimensional image sensor are expressed as θ, Φ and r respectively, wherein the conversion is based on r=k 1 . θ+k 2 . θ 3 . The projection relationship for determining a lens group is based on r o and f. The ratio of θ o determines the projection relationship, r o is related to the maximum range where the light is focused on the two-dimensional image sensor and falls in f. 0.7 times to 1.2 times of θ o and the third-order coefficient k 2 is between -0.166f to 0.410f. 如請求項1所述之座標轉換方法,其中,所述根據f、θo以及ro計算三階係數k2之意義,係包含:在ro=f.θo時,從-0.01到0.001間決定該三階係數k2;在ro>f.θo時,在0.334至0.410內掃瞄一線性因子s以找出最接近 (s.f.θo 3)/(ro-f.θo)值開根號之正整數為一角度因子n,最後計算f.s/n2為該三階係數k2;以及在ro<f.θo時,在-0.166至-0.150內掃瞄該線性因子s以找出最接近(s.f.θo 3)/(ro-f.θo)值開根號之正整數為該角度因子n,最後計算f.s/n2為該三階係數k2The coordinate conversion method as described in Claim 1, wherein the meaning of calculating the third-order coefficient k 2 according to f, θ o and r o includes: when r o =f. When θ o , the third-order coefficient k 2 is determined from -0.01 to 0.001; in r o >f. When θ o , scan a linear factor s within 0.334 to 0.410 to find the positive integer closest to the square root of the value of (s.f.θ o 3 )/(r o -f.θ o ) as an angle factor n, and finally calculate f. s/n 2 is the third-order coefficient k 2 ; and in r o <f. When θ o , scan the linear factor s from -0.166 to -0.150 to find the positive integer closest to the root sign of the value of (s.f.θ o 3 )/(r o -f.θ o ) Angle factor n, and finally calculate f. s/n 2 is the third-order coefficient k 2 . 如請求項1所述之座標轉換方法,其中,所述根據f、θo以及ro計算三階係數k2之意義,係包含::在ro=f.θo時,從-0.01到0.001間決定該三階係數k2;在ro>f.θo時,初始化一目標值、一最佳化結果S以及一線性因子s,以執行一最佳化程序,藉由疊代或遞迴方式,去提供複數個介於0.334至0.410之參數值以替代該線性因子s、執行一計分程序以得到一角度因子n以及一分數為n減去(s.f.θo 3)/(ro-f.θo)值開根號再取絕對值以及在該分數小於或等於該目標值時更新該最佳化結果S為當下的該線性因子s與重新設定該目標值為該分數,最後計算f.S/n2為該三階係數k2;以及在ro<f.θo時,初始化該目標值、該最佳化結果S以及該線性因子s,以執行一最佳化程序,藉由疊代或遞迴方式,去提供複數個介於-0.166至-0.150之參數值以替代該線性因子s、執行該計分程序以得到該角度因子n以及該分數為n減去(s.f.θo 3)/(ro-f.θo)值開根號再取絕對值以及在該分數小於或等於該目標值時更新該最佳化結果S為當下的該線性因子s與重新設定該目標值為該分數,最後計算f.S/n2為該三階係數k2The coordinate transformation method as described in Claim 1, wherein the meaning of calculating the third-order coefficient k 2 according to f, θ o and r o includes: when r o =f. When θ o , the third-order coefficient k 2 is determined from -0.01 to 0.001; in r o >f. When θ o , initialize an objective value, an optimization result S and a linear factor s to execute an optimization procedure, and provide a plurality of parameter values ranging from 0.334 to 0.410 by iterative or recursive methods To replace the linear factor s, perform a scoring procedure to obtain an angle factor n and a score that is n minus (s.f.θ o 3 )/(r o -f.θ o ) and taking the square root of the value Absolute value and when the score is less than or equal to the target value, update the optimization result S to the current linear factor s and reset the target value to the score, and finally calculate f. S/n 2 is the third-order coefficient k 2 ; and when r o <f. When θ o , initialize the target value, the optimization result S and the linear factor s to perform an optimization procedure, and provide a plurality of values between -0.166 and -0.150 by iterative or recursive methods parameter value to replace the linear factor s, execute the scoring procedure to obtain the angular factor n and the score is the square root of the value of n minus (s.f.θ o 3 )/(r o -f.θ o ) Then take the absolute value and update the optimization result S as the current linear factor s and reset the target value to the score when the score is less than or equal to the target value, and finally calculate f. S/n 2 is the third-order coefficient k 2 .
TW110116564A 2021-05-07 2021-05-07 Method for coordinate transformation from spherical to polar TWI788838B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW110116564A TWI788838B (en) 2021-05-07 2021-05-07 Method for coordinate transformation from spherical to polar

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW110116564A TWI788838B (en) 2021-05-07 2021-05-07 Method for coordinate transformation from spherical to polar

Publications (2)

Publication Number Publication Date
TW202244752A TW202244752A (en) 2022-11-16
TWI788838B true TWI788838B (en) 2023-01-01

Family

ID=85793024

Family Applications (1)

Application Number Title Priority Date Filing Date
TW110116564A TWI788838B (en) 2021-05-07 2021-05-07 Method for coordinate transformation from spherical to polar

Country Status (1)

Country Link
TW (1) TWI788838B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW565735B (en) * 2003-04-18 2003-12-11 Guo-Jen Jan Method for determining the optical parameters of a camera
JP6291748B2 (en) * 2013-08-29 2018-03-14 株式会社リコー Imaging apparatus, imaging method, and program
JP2018201123A (en) * 2017-05-26 2018-12-20 株式会社リコー Image processing device, image processing method, and program
CN111263037A (en) * 2018-11-30 2020-06-09 唯光世股份公司 Image processing device, imaging device, video playback system, method, and program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW565735B (en) * 2003-04-18 2003-12-11 Guo-Jen Jan Method for determining the optical parameters of a camera
JP6291748B2 (en) * 2013-08-29 2018-03-14 株式会社リコー Imaging apparatus, imaging method, and program
JP2018201123A (en) * 2017-05-26 2018-12-20 株式会社リコー Image processing device, image processing method, and program
CN111263037A (en) * 2018-11-30 2020-06-09 唯光世股份公司 Image processing device, imaging device, video playback system, method, and program

Also Published As

Publication number Publication date
TW202244752A (en) 2022-11-16

Similar Documents

Publication Publication Date Title
CN105096329B (en) Method for accurately correcting image distortion of ultra-wide-angle camera
CN107248178B (en) Fisheye camera calibration method based on distortion parameters
WO2017195801A1 (en) Calibration device, calibration method, optical device, imaging device, projection device, measurement system and measurement method
CN106846409B (en) Calibration method and device of fisheye camera
CN104778656B (en) Fisheye image correcting method based on spherical perspective projection
CN109544643B (en) Video camera image correction method and device
CN113920206B (en) Calibration method of perspective tilt-shift camera
JPWO2018235163A1 (en) Calibration apparatus, calibration chart, chart pattern generation apparatus, and calibration method
CN110136207B (en) Fisheye camera calibration system, fisheye camera calibration method, fisheye camera calibration device, electronic equipment and storage medium
CN113920205B (en) Calibration method of non-coaxial camera
CN106886976B (en) Image generation method for correcting fisheye camera based on internal parameters
CN112470192A (en) Dual-camera calibration method, electronic device and computer-readable storage medium
CN112598747A (en) Combined calibration method for monocular camera and projector
Jiang et al. An accurate and flexible technique for camera calibration
CN113793387A (en) Calibration method, device and terminal of monocular speckle structured light system
CN114004890B (en) Attitude determination method and apparatus, electronic device, and storage medium
Rudakova et al. Camera matrix calibration using circular control points and separate correction of the geometric distortion field
TWI788838B (en) Method for coordinate transformation from spherical to polar
CN111353945B (en) Fisheye image correction method, device and storage medium
CN111047651B (en) Method for correcting distorted image
CN117495975A (en) Zoom lens calibration method and device and electronic equipment
CN110163922B (en) Fisheye camera calibration system, fisheye camera calibration method, fisheye camera calibration device, electronic equipment and storage medium
CN115239816A (en) Camera calibration method, system, electronic device and storage medium
WO2018150086A2 (en) Methods and apparatuses for determining positions of multi-directional image capture apparatuses
JP2006338167A (en) Image data creation method