资源简介
本程序源自:, SIGGRAPH 2006 paper
代码片段和文件信息
function [out_impatch_location]=automatic_patch_selector(impatch_sizeweightsat_mask)
% Author: Rob Fergus
% Version: 1.0 distribution code.
% Project: Removing Camera Shake from a Single Image SIGGRAPH 2006 paper
% Copyright 2006 Massachusetts Institute of Technology
SMOOTH_SIGMA = 3;
%% Assume input image is 0:255
%% patch_size is integer (odd)
%% sat_mask is binary & same size as im
%% weight is tuning parameter btw. variance and non-saturated pixels
%%% Get size of input im
[IIJJ] = size(im);
%%% Compute centre weighting mask
[xxyy] = meshgrid([1:JJ]-round(JJ/2)[1:II]-round(II/2));
centre_weight_mask = exp(-weight/(JJ^2)*(xx.^2+yy.^2));
II = II*2; JJ = JJ*2;
%% shift by patch_size
centre_weight_mask = real( ifft2( fft2(centre_weight_maskIIJJ) .* fft2(delta_kernel(patch_size)IIJJ) ) );
%%% Get patch mask
pmask = ones(patch_size)/patch_size.^2;
%%% Find patch with largest variance
ei2 = real( ifft2( fft2(im.^2IIJJ) .* fft2(pmaskIIJJ) ) );
mu2 = real( ifft2( fft2(imIIJJ) .* fft2(pmaskIIJJ) ) ).^2;
w = ei2 - mu2;
%%% Compute convolution with sautration mask
q = real( ifft2( fft2((sat_mask)IIJJ) .* fft2(pmaskIIJJ) ) );
%% q is small if more pixels are available for use
combined = (centre_weight_mask).*w./(q*mean(im(:)).^2+1); %% more variance less saturation
%% now find stable maximum (smooth resonse image)
f = fspecial(‘gaussian‘[8 8]SMOOTH_SIGMA);
combined = real( ifft2( fft2(combinedIIJJ) .* fft2(fIIJJ) ) );
%%% crop to avoid edge effects
combined = combined(patch_size:II/2patch_size:JJ/2);
%%% find max
[tmpmm] = max(combined(:));
[sysx] = ind2sub(size(combined)mm);
%%% get coords for axis
patch_location = [sx sy] -1;
%% chop out patch
out_im = im(sy-1:sy-2+patch_sizesx-1:sx-2+patch_size);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 358 2007-02-22 16:41 blind_deblur(FergusR)\results\delta_kernel.m
文件 6055 2007-02-22 16:42 blind_deblur(FergusR)\results\ian1.m
文件 26656662 2010-05-15 13:00 blind_deblur(FergusR)\results\ian1.mat
文件 254346 2010-05-15 13:00 blind_deblur(FergusR)\results\ian1_blurry.jpg
文件 447159 2010-05-15 13:00 blind_deblur(FergusR)\results\ian1_final.jpg
文件 236278 2010-05-15 14:34 blind_deblur(FergusR)\results\ian1模糊核.bmp
文件 1624 2007-02-22 16:42 blind_deblur(FergusR)\priors\linear_street_4.mat
文件 1624 2007-02-22 16:42 blind_deblur(FergusR)\priors\linear_whiteboard_4.mat
文件 441727 2007-02-22 16:42 blind_deblur(FergusR)\images\ian1.jpg
文件 853977 2007-02-22 16:42 blind_deblur(FergusR)\images\lyndsey2.jpg
文件 1879 2007-02-22 16:41 blind_deblur(FergusR)\code\automatic_patch_selector.m
文件 556 2007-02-22 16:41 blind_deblur(FergusR)\code\clip_image.m
文件 25600 2011-03-21 10:24 blind_deblur(FergusR)\code\code笔记文档.doc
文件 2527 2007-02-22 16:41 blind_deblur(FergusR)\code\create_greenspan_settings.m
文件 31970 2011-02-20 18:34 blind_deblur(FergusR)\code\deblur.m
文件 320 2007-02-22 16:47 blind_deblur(FergusR)\code\deconvlucy_intens.m
文件 358 2007-02-22 16:41 blind_deblur(FergusR)\code\delta_kernel.m
文件 2870 2007-02-22 16:41 blind_deblur(FergusR)\code\estimate_priors2.m
文件 1472 2007-02-22 16:41 blind_deblur(FergusR)\code\ExportFig.m
文件 5126 2011-02-19 21:44 blind_deblur(FergusR)\code\fiddle_lucy3.m
文件 5276 2007-02-22 16:48 blind_deblur(FergusR)\code\fiddle_lucy4.m
文件 869 2007-02-22 16:41 blind_deblur(FergusR)\code\fix_image.m
文件 5685 2007-02-22 16:41 blind_deblur(FergusR)\code\GaussianMixtures1D.m
文件 1088 2007-02-22 16:41 blind_deblur(FergusR)\code\greenspan.m
文件 1559 2007-02-22 16:41 blind_deblur(FergusR)\code\histmatch.m
文件 5863 2010-05-21 09:25 blind_deblur(FergusR)\code\initialize_parameters2.m
文件 545 2007-02-22 16:41 blind_deblur(FergusR)\code\invDel2.m
文件 495 2007-02-22 16:41 blind_deblur(FergusR)\code\mix_exponentials.m
文件 2641 2007-02-22 16:41 blind_deblur(FergusR)\code\move_level.m
文件 571 2007-02-22 16:41 blind_deblur(FergusR)\code\normMDpdf.m
............此处省略23个文件信息
相关资源
- Pattern Recognition and Machine Learning(高清
- MATLAB 编程 第二版 Stephen J. Chapman 著
- 均值滤波和FFT频谱分析Matlab代码
- 《MATLAB扩展编程》代码
- HDB3码、AMI码的MATLAB实现
- 3点GPS定位MATLAB仿真
- MATLAB数字信号处理85个实用案例精讲入
- matlab从入门到精通pdf94795
- 欧拉放大论文及matlab代码
- 跳一跳辅助_matlab版本
- 全面详解LTE MATLAB建模、仿真与实现
- MIMO-OFDM无线通信技术及MATLAB实现_孙锴
- MATLAB Programming for Engineers 4th - Chapman
- matlab 各种谱分析对比
- 分数阶chen混沌matlab程序
- 基于粒子群算法的非合作博弈的matl
- MATLAB车流仿真 包括跟驰、延误
- matlab空间桁架计算程序
- 基于MATLAB的图像特征点匹配和筛选
- DMA-TVP-FAVAR
- GPS信号的码捕获matlab代码.7z
- 一维光子晶体MATLAB仿真代码吸收率折
- newmark法源程序
- 传统关联成像、计算鬼成像matlab
- pri传统分选算法
- 摆动滚子推杆盘形凸轮设计
- 医学图像重建作业matlab源码
- Matlab实现混沌系统的控制
- 检测疲劳驾驶
- Matlab锁相环仿真-Phase Locked Loop.rar
评论
共有 条评论