matlab 度分秒转换成度_如何利用matlab统一处理照片亮度对比度
第一:下軟件MATLAB,和插件SHINEtoolbox。安裝路徑最好不要有中文。
將插件復制到文件夾下見圖片
注意:不用學習matlab的具體應用,會使用插件就行了,插件是已經做好的編程,僅需把插件的參數修改即可。
第二,加載插件,
進入matlab主頁,點擊設置路徑。將路徑設置為SHINE文件夾。設置路徑后,記得點保存,才算加載成功。
在你在matlab命令窗口輸入SHINE,當出現“SHINE options [1=default, 2=custom]: “
就說明調用成功(當然安裝就成功了)。如果報錯就不對。
第三,插件信息的修改。插件有很多函數,但是僅需要修改SHINE.m,需要你打開SHINE.m(雙擊即可)去手動設置。
具體修改的地方有
1.改為你處理的圖片類型。如“png”
2.修改你要到處理圖片的位置。
3.選用WholeIm=3時,要需要保證SHINE-INPUT和SHINE-TEMPLATE圖片數量、格式、大小一致,否則報錯。將處理的圖片分別復制到兩個文件夾下即可。
具體處理過程和參數設置
第四,處理圖片
處理步驟:進入Matlab,加載“SHINEtoolbox”插件對圖片的亮度、對比度和尺寸進行統一標準化批處理。
關鍵操作:輸入SHINE→按Enter→輸入1→按Enter。
圖片處理成功會顯示,圖片會保存到SHINE-OUTPUT
附上圖片庫的處理參數設置:
【統一標準化批處理】
使用中國人面孔表情圖片系統(羅躍嘉)的男正2.bmp圖片作為模板(中國人面孔表情圖片系統bmp格式正性male2.bmp)。
處理步驟:進入Matlab,加載“SHINEtoolbox”插件對圖片的亮度、對比度和尺寸進行統一標準化批處理。
關鍵操作:輸入SHINE→按Enter→輸入1→按Enter。
>> SHINE
SHINE options [1=default, 2=custom]: 1
Number of images: 689
Option: Mean luminance matching separately for the foregrounds and backgrounds (background = all regions of lum 34)
Progress: lumMatch successful
RMSE: 2.327847e+01
SSIM: 8.104382e-01
默認模式(default)關鍵參數:圖像背景分割(wholeIm = 3)+亮度匹配(mode = 1),程序代碼如下:
% If desired, the default values can be changed here:
it = 1; % number of iterations (default = 1)
wholeIm = 3; % 1 = whole image (default)
% 2 = figure-ground separated (input images as templates)
% 3 = figure-ground separated (based on templates: 中國人面孔表情圖片系統bmp格式正性male2.bmp)
mode = 1; % 1 = lumMatch only (no SSIM optimization)(原版嬰兒圖庫的處理)
% 2 = histMatch only(整體過亮)
% 3 = sfMatch only (比7稍微暗)
% 4 = specMatch only (有霧氣)
% 5 = histMatch & sfMatch (比7局部過亮)
% 6 = histMatch & specMatch (有霧氣+雪花)
% 7 = sfMatch & histMatch (整體較暗)
% 8 = specMatch & histMatch (default)(有霧氣+雪花)
background = 300; % background lum of template, or 300=automatic (default)
% (automatically, the luminance that occurs most
% frequently in the image is used as background lum);
% basically, all regions of that lum are treated as
% background
rescaling = 1; % 0 = no rescaling
% 1 = rescale absolute values (default)
% 2 = rescale average values
optim = 1; % 0 = no SSIM optimization
% 1 = SSIM optimization (Avanaki, 2009; to change the
% number if iterations (default = 10) and adjust step
% size (default = 67), see histMatch.m)
【背景處理】
完成統一標準化批處理后,先將圖片位深度調為24,然后在畫圖工具中對非面孔區域的背景進行黑色(RGB:0, 0, 0)填充,最后使用SHINEtoolbox對每張圖片逐張標準化處理。
處理步驟:進入Matlab,加載“SHINEtoolbox”插件逐張對圖片的亮度、對比度和尺寸進行標準化處理。
關鍵操作:輸入SHINE→按Enter→輸入1→按Enter。
>> SHINE
SHINE options [1=default, 2=custom]: 1
Number of images: 1
Option: Mean luminance matching on the whole images
Progress: lumMatch successful
RMSE: 0
SSIM: 1
默認模式(default)關鍵參數:圖像背景分割(wholeIm = 1)+亮度匹配(mode = 1),程序代碼如下:
% If desired, the default values can be changed here:
it = 1; % number of iterations (default = 1)
wholeIm = 1; % 1 = whole image (default)
% 2 = figure-ground separated (input images as templates)
% 3 = figure-ground separated (based on templates)
mode = 1; % 1 = lumMatch only (no SSIM optimization)
% 2 = histMatch only
% 3 = sfMatch only
% 4 = specMatch only
% 5 = histMatch & sfMatch
% 6 = histMatch & specMatch
% 7 = sfMatch & histMatch
% 8 = specMatch & histMatch (default)
background = 300; % background lum of template, or 300=automatic (default)
% (automatically, the luminance that occurs most
% frequently in the image is used as background lum);
% basically, all regions of that lum are treated as
% background
rescaling = 1; % 0 = no rescaling
% 1 = rescale absolute values (default)
% 2 = rescale average values
optim = 1; % 0 = no SSIM optimization
% 1 = SSIM optimization (Avanaki, 2009; to change the
% number if iterations (default = 10) and adjust step
% size (default = 67), see histMatch.m)
【統一標準化批處理】
使用中國人面孔表情圖片系統(羅躍嘉)的男正2.bmp圖片作為模板(中國人面孔表情圖片系統bmp格式正性male2.bmp)。
處理步驟:進入Matlab,加載“SHINEtoolbox”插件對圖片的亮度、對比度和尺寸進行統一標準化批處理。
關鍵操作:輸入SHINE→按Enter→輸入1→按Enter。
>> SHINE
SHINE options [1=default, 2=custom]: 1
Number of images: 689
Option: Mean luminance matching separately for the foregrounds and backgrounds (background = all regions of lum 34)
Progress: lumMatch successful
RMSE: 2.327847e+01
SSIM: 8.104382e-01
默認模式(default)關鍵參數:圖像背景分割(wholeIm = 3)+亮度匹配(mode = 1),程序代碼如下:
% If desired, the default values can be changed here:
it = 1; % number of iterations (default = 1)
wholeIm = 3; % 1 = whole image (default)
% 2 = figure-ground separated (input images as templates)
% 3 = figure-ground separated (based on templates: 中國人面孔表情圖片系統bmp格式正性male2.bmp)
mode = 1; % 1 = lumMatch only (no SSIM optimization)(原版嬰兒圖庫的處理)
% 2 = histMatch only(整體過亮)
% 3 = sfMatch only (比7稍微暗)
% 4 = specMatch only (有霧氣)
% 5 = histMatch & sfMatch (比7局部過亮)
% 6 = histMatch & specMatch (有霧氣+雪花)
% 7 = sfMatch & histMatch (整體較暗)
% 8 = specMatch & histMatch (default)(有霧氣+雪花)
background = 300; % background lum of template, or 300=automatic (default)
% (automatically, the luminance that occurs most
% frequently in the image is used as background lum);
% basically, all regions of that lum are treated as
% background
rescaling = 1; % 0 = no rescaling
% 1 = rescale absolute values (default)
% 2 = rescale average values
optim = 1; % 0 = no SSIM optimization
% 1 = SSIM optimization (Avanaki, 2009; to change the
% number if iterations (default = 10) and adjust step
% size (default = 67), see histMatch.m)
【背景處理】
完成統一標準化批處理后,先將圖片位深度調為24,然后在畫圖工具中對非面孔區域的背景進行黑色(RGB:0, 0, 0)填充,最后使用SHINEtoolbox對每張圖片逐張標準化處理。
處理步驟:進入Matlab,加載“SHINEtoolbox”插件逐張對圖片的亮度、對比度和尺寸進行標準化處理。
關鍵操作:輸入SHINE→按Enter→輸入1→按Enter。
>> SHINE
SHINE options [1=default, 2=custom]: 1
Number of images: 1
Option: Mean luminance matching on the whole images
Progress: lumMatch successful
RMSE: 0
SSIM: 1
默認模式(default)關鍵參數:圖像背景分割(wholeIm = 1)+亮度匹配(mode = 1),程序代碼如下:
% If desired, the default values can be changed here:
it = 1; % number of iterations (default = 1)
wholeIm = 1; % 1 = whole image (default)
% 2 = figure-ground separated (input images as templates)
% 3 = figure-ground separated (based on templates)
mode = 1; % 1 = lumMatch only (no SSIM optimization)
% 2 = histMatch only
% 3 = sfMatch only
% 4 = specMatch only
% 5 = histMatch & sfMatch
% 6 = histMatch & specMatch
% 7 = sfMatch & histMatch
% 8 = specMatch & histMatch (default)
background = 300; % background lum of template, or 300=automatic (default)
% (automatically, the luminance that occurs most
% frequently in the image is used as background lum);
% basically, all regions of that lum are treated as
% background
rescaling = 1; % 0 = no rescaling
% 1 = rescale absolute values (default)
% 2 = rescale average values
optim = 1; % 0 = no SSIM optimization
% 1 = SSIM optimization (Avanaki, 2009; to change the
% number if iterations (default = 10) and adjust step
% size (default = 67), see histMatch.m)
總結
以上是生活随笔為你收集整理的matlab 度分秒转换成度_如何利用matlab统一处理照片亮度对比度的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql截取最后一个斜杠_在MySQL
- 下一篇: matlab中鼠标光标后面的阴影怎么去除