Skip to Main Content
Mathematica 錦囊妙計
book

Mathematica 錦囊妙計

by Sal Mangano
April 2014
Beginner to intermediate content levelBeginner to intermediate
830 pages
15h 21m
Chinese
GoTop Information, Inc.
Content preview from Mathematica 錦囊妙計
8.4 使用直方圖規格化(Histogram Specification)處理影像
|
347
1. 以訣竅 8.3 的方式,將輸入影像轉換為均勻分布。
2. 將目標影像均衡化轉換的反轉換,作用於步驟 1 的輸出。
這個做法的關鍵在於找出反轉換,因為在離散數學的領域進行數學運算,也許無法找出
精確的反轉換,但可以下列方式取得近似反轉換:將
targetMap
的索引址與元素進行翻
轉互換,取最小的獨特元素值作為索引址,若有缺漏值則使用下一個最接近的數值。
以下的
inverseEqualizationMap
函數可從輸入的影像建立反轉換,但如果你仔細檢查
histogramSpecication
的程式碼,會發現為了效率考量,並未建立反轉換,而是直接
從輸入與目標影像的均衡化轉換,使用規格化映射函數
specicationMap
計算反轉換。
350]
使用
histogramSpecicationPlot
指令可繪出輸入及目標均衡化轉換、目標均衡化反轉
換及最終的直方圖規格化轉換,藉此獲得更進一步的理解,這些圖形顯示輸入灰階影像
如何映射至輸出。如果你還沒有被說服
specicationMap
即為所需轉換,試著將上圖的
specMap
的圖形取代為
inverseMap[#]&/@inputMap
,仍可輸出完全相同的圖形。
計算目標影像的直方圖映射
計算輸入影像的直方圖映射
計算
targetMap 反映射
mathemaca 6 以前的版本才需載入此套件
ch08.indd 347 2014/4/7 下午 12:29:39 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Ubuntu for Non-Geeks, 4th Edition

Ubuntu for Non-Geeks, 4th Edition

Rickford Grant, Phil Bull

Publisher Resources

ISBN: 9789863470106