像素之間的基本關系


🎯Some basic relationship between pixels——像素之間的基本關系

Neighbors and Connectivity——領域與聯通

Neighbors of a pixel——像素的領域

4-neighbor——4領域,即\(N_{4}(p)\)

Diagonal neighbors——對角領域,即\(N_{D}(p)\)

8-neighbor——8領域,即\(N_{8}(p)\)

Connectivity——連通

相鄰僅考慮像素間的空間關系

連通:空間上相鄰且像素灰度值相似

兩個像素是否連通:

  • 是否接觸(相鄰)
  • 灰度值是否滿足某個特定的相似准則:灰度值相等或同在一個灰度值集合中
三種連通

假設V為灰度值集合,V ={1}:

  • 4-連通: 2個像素 p 和 r 在V 中取值且 r 在\(N_{4}(p)\)
  • 8-連通:2個像素 p 和 r 在V 中取值且 r 在\(N_{8}(p)\)
  • m-連通(混合連通):2個像素 p 和 r 在V 中取值,且滿足下列條件之一
    ① r 在\(N_{4}(p)\)
    ② r 在\(N_{D}(p)\)中且集合\(N_{4}(p)\)\(N_{4}(r)\)是空集

Path——通路

 像素\(p(x, y)\)到像素\(q(s, t)\)的一條通路由一系列具有坐標\((x_0, y_0)\), \((x_1, y_1)\) ,…,\((x_i , y_i)\) ,…,\((x_n , y_n)\)的獨立像素組成。這里 \((x, y)\)= \((x_0, y_0)\), \((x_n , y_n)\)= \((s, t)\),且 \((x_i , y_i)\)\((x_{i-1}, y_{i-1})\)連通。其中\(1≤i≤n\)\(n\)為通路長度。

通路種類:4-通路(4-path);8-通路(8-path);m-通路(m-path)

例題:

Distance Measures——距離度量

Definition:For pixels \(p, q, z\), with coordinates \((x, y), (s, t), (v, w)\) ,respectively, if

給出三個像素\(p, q, z\),坐標分別為\((x, y), (s, t), (v, w)\),則

  • \(D(p, q)≥0\) [\(D(p, q)= 0\), 當且僅當 p=q]
  • \(D(p, q)=D(q, p)\)
  • \(D(p, z)≤D(p, q) + D(q, z)\)

then D is a distance function or metric.

如過D滿足以上三個條件,則稱D為距離函數或距離度量

⚠️D距離與像素的點坐標相關
⚠️D距離與像素間的連通性無關

🎯Euclidean distance De——歐式距離(默認使用的距離函數)

Definition:

已知\(p(x,y)\),\(q(s,t)\)

\[D_e(p,q)=\left((x-s)^2+(y-t)^2\right)^{\frac{1}{2}} \]

For this distance measure, the pixels having a distance less than or equal to some value \(r\) from \((x,y)\) are the points contained in a disk of radius \(r\) centered at \((x,y)\).

距離點\((x,y)\)\(r\)距離的點組成一個圓

\(D_4\) distance (also called city-block distance)——\(D_4\)距離,即街區距離

\[D_4(p,q) = |x-s| + |y-t| \]

The pixels having a \(D_4\) distance from \((x, y)\) less than or equal to some value r form a diamond centered at \((x, y)\) .

The Pixels with \(D_4=1\) are the \(N_4\) of \((x, y)\).

\(D_8\) distance (chessboard distance)——\(D_8\)距離,即棋盤距離

\[D_8(p,q) = max(|x-s|,|y-t|) \]

The pixels with \(D_8\) distance from\((x, y)\) less than or equal to some value r form a square centered at \((x, y)\).

The pixels with \(D_8=1\) are the N8 of \((x, y)\).

下一篇:顏色基礎與顏色模型


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM