寫的又回去了,因為我發現我理解不夠透徹,反正想到啥寫啥,盡量保證內容質量好簡潔易懂
2D平行束投影公式
p ( s , θ ) = ∫ ∫ f ( x , y ) δ ( x c o s θ + y s i n θ ? s ) d x d y p(s,\theta)=\int \int f(x,y)\delta(x cos\theta + ysin\theta - s) dxdy p(s,θ)=∫∫f(x,y)δ(xcosθ+ysinθ?s)dxdy式1
p ( s , θ ) = ∫ f ( s c o s θ ? t s i n θ , s s i n θ + t c o s θ ) d t p(s,\theta)=\int f(scos\theta - tsin\theta,s sin\theta + t cos\theta)dt p(s,θ)=∫f(scosθ?tsinθ,ssinθ+tcosθ)dt式2
p ( s , θ ) = ∫ f ( s θ ? + t θ ? ) d t p(s,\theta) = \int f(s\vec \theta + t \vec \theta)dt p(s,θ)=∫f(sθ+tθ)dt式3
p ( s , θ ) = ∫ f θ ( s , t ) d t p(s,\theta)=\int f_\theta(s,t)dt p(s,θ)=∫fθ?(s,t)dt式4
這些公式來自醫學圖像重建1.5節
,這些都是2D平行束投影公式(我偷懶沒寫積分的上下限)。
s s s表示探測器像素單元的坐標, θ \theta θ表示投影角度。
f ( x , y ) f(x,y) f(x,y)為物體截面的線衰減系數。
x c o s θ + y s i n θ = s x cos\theta + ysin\theta = s xcosθ+ysinθ=s是平面直線方程的一種寫法(Hesse Normal Form,見https://leslielee.blog.csdn.net/article/details/145670396
),表示投影角度為 θ \theta θ投影至探測器坐標 s s s處的射線。
式1
δ ( z ) \delta(z) δ(z)是一個廣義函數,具有篩選的性質(見https://leslielee.blog.csdn.net/article/details/144859730
,但由于我的數學水平不夠,這篇寫的比較差勁)
給定 s , θ s,\theta s,θ后,若固定 y y y,則式1
中位于里面的積分可寫作:
∫ f ( x , y ˉ ) δ ( x c o s θ ˉ + y ˉ s i n θ ˉ ? s ˉ ) d x = f ( x ~ , y ˉ ) \int f(x,\bar y)\delta(x cos \bar \theta + \bar ysin \bar \theta - \bar s) dx = f(\tilde x,\bar y) ∫f(x,yˉ?)δ(xcosθˉ+yˉ?sinθˉ?sˉ)dx=f(x~,yˉ?)
其中, x ~ c o s θ ˉ + y ˉ s i n θ ˉ = s ˉ \tilde x cos \bar \theta + \bar ysin \bar \theta = \bar s x~cosθˉ+yˉ?sinθˉ=sˉ,即 ( x ~ , y ˉ ) (\tilde x, \bar y) (x~,yˉ?)在直線 x c o s θ ˉ + y s i n θ ˉ = s ˉ x cos \bar \theta + ysin \bar \theta = \bar s xcosθˉ+ysinθˉ=sˉ上。
給定 s , θ s,\theta s,θ后,遍歷所有的 y y y(式1
中位于外面積分的作用),便可實現將位于直線 x c o s θ ˉ + y s i n θ ˉ = s ˉ x cos \bar \theta + ysin \bar \theta = \bar s xcosθˉ+ysinθˉ=sˉ上的 f ( x , y ) f(x,y) f(x,y)進行求和。
因此,式1
得到的是位于直線 x c o s θ + y s i n θ = s x cos \theta + ysin \theta = s xcosθ+ysinθ=s上的 f ( x , y ) f(x,y) f(x,y)的和。
若令 θ ? = ( c o s θ , s i n θ ) \vec \theta = (cos \theta, sin \theta) θ=(cosθ,sinθ), x ? = ( x , y ) \vec x = (x,y) x=(x,y),則式1
可得到向量寫法:
p ( s , θ ) = ∫ ∫ f ( x , y ) δ ( x ? ? θ ? ? s ) d x d y p(s,\theta)=\int \int f(x,y)\delta(\vec x \cdot \vec \theta - s) dxdy p(s,θ)=∫∫f(x,y)δ(x?θ?s)dxdy
式2
( x , y ) (x,y) (x,y)要位于直線 x c o s θ + y s i n θ = s x cos\theta + ysin\theta = s xcosθ+ysinθ=s上才可計算線積分。因此, x = s c o s θ ? t s i n θ , y = s s i n θ + t c o s θ x = s cos\theta - t sin\theta, y=s sin\theta + t cos \theta x=scosθ?tsinθ,y=ssinθ+tcosθ必然已經將 ( x , y ) (x,y) (x,y)約束至直線 x c o s θ + y s i n θ = s x cos\theta + ysin\theta = s xcosθ+ysinθ=s上。
定義 t t t,令 x = s c o s θ ? t s i n θ , y = s s i n θ + t c o s θ x = s cos\theta - t sin\theta, y=s sin\theta + t cos \theta x=scosθ?tsinθ,y=ssinθ+tcosθ,將 x , y x,y x,y帶入直線方程中得到:
( s c o s θ ? t s i n θ ) c o s θ + ( s s i n θ + t c o s θ ) s i n θ = s (s cos\theta - t sin\theta) cos\theta + (s sin\theta + t cos \theta) sin\theta = s (scosθ?tsinθ)cosθ+(ssinθ+tcosθ)sinθ=s
進一步化簡可得:
s = s s=s s=s
因此, x = s c o s θ ? t s i n θ , y = s s i n θ + t c o s θ x = s cos\theta - t sin\theta, y=s sin\theta + t cos \theta x=scosθ?tsinθ,y=ssinθ+tcosθ 等效于 x c o s θ + y s i n θ = s x cos\theta + ysin\theta = s xcosθ+ysinθ=s,即將 ( x , y ) (x,y) (x,y)約束至直線 x c o s θ + y s i n θ = s x cos\theta + ysin\theta = s xcosθ+ysinθ=s上。
(那是如何才能想到這么表示 x , y x,y x,y呢,對此我咨詢了元寶
,元寶
告我跟旋轉矩陣相關。)
x = s c o s θ ? t s i n θ , y = s s i n θ + t c o s θ x = s cos\theta - t sin\theta, y=s sin\theta + t cos \theta x=scosθ?tsinθ,y=ssinθ+tcosθ 可寫成向量矩陣形式:
(見https://leslielee.blog.csdn.net/article/details/135566902
)
[ c o s θ ? s i n θ s i n θ c o s θ ] [ s t ] = [ x y ] \begin{bmatrix} cos\theta & -sin\theta \\ sin\theta & cos\theta \end{bmatrix} \begin{bmatrix} s \\ t \end{bmatrix}=\begin{bmatrix} x \\ y \end{bmatrix} [cosθsinθ??sinθcosθ?][st?]=[xy?]
x , y x,y x,y是 s , t s,t s,t逆時針旋轉得到的。
那么, s , t s,t s,t是 x , y x,y x,y順時針旋轉得到的,可得到表達式:
[ c o s θ s i n θ ? s i n θ c o s θ ] [ x y ] = [ s t ] \begin{bmatrix} cos\theta & sin\theta \\ -sin\theta & cos\theta \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix}=\begin{bmatrix} s \\ t \end{bmatrix} [cosθ?sinθ?sinθcosθ?][xy?]=[st?]
這樣我們便可明白, t = ? x s i n θ + y c o s θ t = -xsin\theta + ycos\theta t=?xsinθ+ycosθ,式2
給的 t t t并不是沒有限制的。
直線 ? x s i n θ + y c o s θ = t -xsin\theta + ycos\theta = t ?xsinθ+ycosθ=t與 x c o s θ + y s i n θ = s x cos\theta + ysin\theta = s xcosθ+ysinθ=s垂直,因為 ( ? s i n θ , c o s θ ) ? ( c o s θ , s i n θ ) = 0 (-sin\theta,cos\theta)\cdot (cos\theta,sin\theta) = 0 (?sinθ,cosθ)?(cosθ,sinθ)=0。
給定 s , θ s,\theta s,θ后,遍歷所有 t t t便可取到直線 x c o s θ + y s i n θ = s x cos\theta + ysin\theta = s xcosθ+ysinθ=s上的所有 ( x , y ) (x,y) (x,y)點。
式3
令 θ ? ⊥ = ( ? s i n θ , c o s θ ) \vec \theta^{\perp} = (-sin\theta,cos\theta) θ⊥=(?sinθ,cosθ)
將 s θ ? + t θ ? ⊥ s\vec \theta + t \vec \theta^{\perp} sθ+tθ⊥展開便得到: ( s c o s θ ? t s i n θ , s s i n θ + t c o s θ ) (s cos\theta - t sin\theta, s sin\theta + t cos\theta) (scosθ?tsinθ,ssinθ+tcosθ)
而函數 f f f是一個二元函數,自變量是 x , y x,y x,y,因此有:
s c o s θ ? t s i n θ = x s cos\theta - t sin\theta = x scosθ?tsinθ=x
s s i n θ + t c o s θ = y s sin\theta + t cos\theta = y ssinθ+tcosθ=y
這不就是表示 ( x , y ) (x,y) (x,y)是由 ( s , t ) (s,t) (s,t)逆時針旋轉 θ \theta θ得到的。
因此,式3
是式2
的向量寫法。
式4
令 f θ ( s , t ) = f ( s c o s θ ? t s i n θ , s s i n θ + t c o s θ ) f_\theta (s,t) = f(scos\theta - tsin\theta,s sin\theta + t cos\theta) fθ?(s,t)=f(scosθ?tsinθ,ssinθ+tcosθ),便得到式4
。
式1
表示射線源與探測器同時逆時針旋轉(射線旋轉),物體不動。式2
表示物體順時針旋轉,射線不動。