資源簡介
圖形學論文代碼

代碼片段和文件信息
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%???Please?check?our?website?for?the?latest?version?of?this?script:
%???www.cs.ubc.ca/labs/imager/tr/2010/TheoryOfPlenopticMultiplexing/
%
%???This?demo?reconstructs?(demosaicks)?a?RAW?sensor?image?in?the?Fourier?
%???domain.?
%
%???Ivo?Ihrke?[ivo.ihrke@cs.ubc.ca]
%???Gordon?Wetzstein?[wetzste1@cs.ubc.ca]
%???PSM?Lab?UBC
%???March?2010
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear?all;
I?=?double(?imread?(?‘../data/bayer_dc.pgm‘?)?);
Ifft?=?fftshift(fft2(I));
tx?=?size(I2)/4;
ty?=?size(I1)/4;
%lower?limit
llx=1;
lly=1;
%upper?limit
ulx=size(I2);
uly=size(I1);
%shift?in?FT?due?to?even?#scanlines?and?repetitions?of?bayer?pattern
shiftx=0;
shifty=0;
%middle?tile?coord‘s
mty?=?((ty+1):(3*ty))+shifty;
mtx?=?((tx+1):(3*tx))+shiftx;
%lower?range
ltx?=?llx:(mtx(1)-1);
lty?=?lly:(mty(1)-1);
%upper?range
utx?=?(mtx(length(mtx))+1):ulx;
uty?=?(mty(length(mty))+1):uly;
%this?is?for?the?smaller?versions
rtxl?=?1:(tx-shiftx);
rtxu?=?((tx+1)-shiftx):2*tx;
rtyl?=?1:(ty-shifty);
rtyu?=?((ty+1)-shifty):2*ty;
Ifft_lr?=?Ifft(?mty+1?mtx?);
Ifft_ll(?:?rtxu?)?????=?Ifft(?mty?ltx?);
Ifft_ll(?:?rtxl?)?????=?Ifft(?mty?utx?);
Ifft_ur(??rtyu?:?)???=?Ifft(?lty??mtx?);
Ifft_ur(??rtyl?:?)???=?Ifft(?uty??mtx?);
%Ifft_green(?(ty+1):2*ty?:?)?????=?Ifft(?1:ty?(tx+1):(3*tx)?);
%Ifft_green(?1:ty?:?)????????????=?Ifft(?(3*ty+1):(4*ty)?(tx+1):(3*tx));
Ifft_ul(?rtyl?rtxl?)??????????=?Ifft(?uty?utx?);
Ifft_ul(?rtyu?rtxl?)??????????=?Ifft(?lty?utx?);
Ifft_ul(?rtyl?rtxu?)??????????=?Ifft(?uty?ltx?);
Ifft_ul(?rtyu?rtxu?)??????????=?Ifft(?lty?ltx);
%Ifft_red???=?0.25*Ifft_lr??-0.25*Ifft_ul?-?0.25*Ifft_ll?+?0.25*Ifft_ur;?
%Ifft_green?=?0.25*Ifft_lr??+0.25*Ifft_ul;?
%Ifft_blue??=?0.25*Ifft_lr??-0.25*Ifft_ul?+?0.25*Ifft_ll?-?0.25*Ifft_ur;?
%Ifft_gray??=?0.25*Ifft_lr;
Ifft_lr?=?-circshift(Ifft_lr[1??0]);
Ifft_red???=?0.25*Ifft_lr??+0.25*Ifft_ul?+?0.5*Ifft_ll;?
Ifft_green?=?0.25*Ifft_lr??-0.25*Ifft_ul;?
Ifft_blue??=?0.25*Ifft_lr??+0.25*Ifft_ul?-?0.5*Ifft_ll;?
Ifft_gray??=?0.25*Ifft_lr;
I_gray??=?abs((ifft2(ifftshift(?Ifft_gray??)))?/?(?max(?I(:)?)));
I_red???=?abs((ifft2(ifftshift(?Ifft_red???)))?/?(?max(?I(:)?)));
I_blue??=?abs((ifft2(ifftshift(?Ifft_blue??)))?/?(?max(?I(:)?)));
I_green?=?abs((ifft2(ifftshift(?Ifft_green?)))?/?(?max(?I(:)?)));
subplot(141)
imshow(?I_red)
%imshow(?abs(Ifft_red).^(1/2.2)/3000?)?;
imshow(?abs(ifft2(ifftshift(Ifft_ur)))?/?(?1?*?max(?I?(:)))??);
title(‘Demosaicked?red?channel‘);
subplot(142);
imshow(?I_green?);?
%imshow(?abs(Ifft_blue).^(1/2.2)/3000?)?;
imshow(?abs(ifft2(ifftshift(Ifft_ll)))?/?(?1?*?max(?I?(:)))??);
title(‘Demosaicked?green?channel‘);
subplot(143);
imshow(?I_blue?);?
imshow(?abs(ifft2(ifftshift(Ifft_lr)))?/?(?4?*?max(?I?(:)))??);
title(‘Demosaicked?blue?channel‘);
subplot(1
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3423??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\CFAReconstruction\bayer_fourier.m
?????文件?????415798??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\CFAReconstruction\bayer_fourier.png
?????文件???????2612??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\DappledPhotography\dp_fourier_general.m
?????文件???????4459??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\DappledPhotography\dp_spatial_interp.m
?????文件????2016050??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\data\bayer_dc.pgm
?????文件?????415798??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\data\InputCones_9x9.png
?????文件???????3366??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\data\lightFieldSpatialMajor2DirectionMajor.m
?????文件????????965??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\data\resampleCones.m
?????文件???????1867??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\data\resampleGolgi.m
?????文件???????3242??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\NoiseAnalysis\lightFieldTransport.m
?????文件???????1094??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\NoiseAnalysis\mura.m
?????文件???????3311??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\NoiseAnalysis\reconstructionBatchsc
?????文件???????9108??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\NoiseAnalysis\reconstructLightFieldFromSensorImage.m
?????文件???????8323??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\NoiseAnalysis\simulateLightFieldCamera.m
?????文件????????831??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\NoiseAnalysis\sos.m
?????文件???????2952??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\README
?????文件?????166482??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\ShieldFields\guideImage.png
?????文件???????9911??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\ShieldFields\joint_bilateral_up_cubic_spatial.m
?????文件????4389174??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\ShieldFields\mannequin.png
?????文件????4008924??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\ShieldFields\mask.png
?????文件????????207??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\ShieldFields\mura11x11.mat
?????文件???????6439??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\ShieldFields\ShieldFieldsJointBilateralSpatialReconstruction.m
?????目錄??????????0??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\ShieldFields\channels
?????目錄??????????0??2012-04-21?23:33??TheoryPlenopticMultiplexingCode\ShieldFields\results
?????目錄??????????0??2012-04-21?23:35??TheoryPlenopticMultiplexingCode\CFAReconstruction
?????目錄??????????0??2012-04-21?23:35??TheoryPlenopticMultiplexingCode\DappledPhotography
?????目錄??????????0??2012-04-21?23:35??TheoryPlenopticMultiplexingCode\data
?????目錄??????????0??2012-04-21?23:41??TheoryPlenopticMultiplexingCode\NoiseAnalysis
?????目錄??????????0??2012-04-21?23:35??TheoryPlenopticMultiplexingCode\ShieldFields
?????目錄??????????0??2012-04-21?23:35??TheoryPlenopticMultiplexingCode
............此處省略3個文件信息
評論
共有 條評論