1 / 16

多媒體安全 Macros Examples Gamma.txt

多媒體安全 Macros Examples Gamma.txt. 指導教授:黃文楨 博士. 報告學生: 碩 專 2A 王朝鵬 (9624713). 何謂 Gamma Value ?.

aron
Download Presentation

多媒體安全 Macros Examples Gamma.txt

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 多媒體安全 Macros Examples Gamma.txt 指導教授:黃文楨 博士 報告學生:碩專2A 王朝鵬(9624713)

  2. 何謂 Gamma Value ? 簡單來說,Gamma 是對比的度量工具,亦即中間色調數值的亮度,由如電腦螢幕等的裝置產生,或者產生於拍攝的影像中。較高的 Gamma 值會產生整體上較暗的影像。Windows 系統使用的 Gamma 值 (通常是 2.2) 比 Mac OS 系統為高 (通常是 1.8),結果相同的影像在 Windows 系統上看來就明顯地比在 Mac OS 系統上暗。 所謂的Gamma是指亮度的變化曲線其數學關係為 L=X^r,類似底片的特性曲線,提高gamma會讓提高整體影像的反差。

  3. Garma.txt 巨集 – 亮度調整 • 包含三個巨集: • Gamma • Reset Gamma • Show LUT 變數宣告: var gamma = 1;

  4. (1)Gamma • macro “Gamma [F1]” { • getLut(r, g, b); • gamma = getNumber(“Gamma (0.1-5.0):”, gamma); • for (i=0; i<256; i++) { • r[i] = pow(r[i]/255, gamma)*255; • } • setLut(r, r, r); • } 定義F1快速鍵 讀取圖片的LUT表 顯示輸入視窗並取得所輸入的Gamma值,預設是1 計算新的的Gamma值 重新以R陣列的值設定整個LUT表

  5. (2)Reset Gamma macro "Reset Gamma [F2]" { getLut(r, g, b); for (i=0; i<256; i++) { r[i]=i; } setLut(r, r, r); } 定義F2快速鍵 讀取圖片的LUT表 計算新的的Gamma值 重新以R陣列的值設定整個LUT表

  6. (3)Show LUT macro "Show LUT" { run("Show LUT"); } 呼叫內建功能顯示檢視表

  7. Function – getLut() 用法:getLut(reds, greens, blues) 說明: Returns three arrays containing the red, green and blue intensity values from the current lookup table.

  8. Function – getNumber() 用法: getNumber(“prompt”,defaultValue) 說明: Displays a dialog box and returns the number entered by the user. The first argument is the prompting message and the second is the value initially displayed in the dialog. Exits the macro if the user clicks on "Cancel" in the dialog. Returns defaultValue if the user enters an invalid number.

  9. Function – setLut() 用法:setLut(reds, greens, blues) 說明: Creates a new lookup table and assigns it to the current image. Three input arrays are required, each containing 256 intensity values.

  10. 執行過程

  11. 執行過程 轉換圖片格式為32Bit的灰階圖片

  12. 執行過程

  13. 執行過程

  14. 執行過程

  15. 執行過程

  16. The End. Thank you …

More Related