plateform stringclasses 1
value | repo_name stringlengths 13 113 | name stringlengths 3 74 | ext stringclasses 1
value | path stringlengths 12 229 | size int64 23 843k | source_encoding stringclasses 9
values | md5 stringlengths 32 32 | text stringlengths 23 843k |
|---|---|---|---|---|---|---|---|---|
github | Liusifei/Face-Hallucination-master | F16a_ACCV12TextureGradientNotIntensity.m | .m | Face-Hallucination-master/Code/Ours2/F16a_ACCV12TextureGradientNotIntensity.m | 48,117 | utf_8 | fc71ab06a0f444e4b47f80161a3e11c3 | %Chih-Yuan Yang
%09/19/12
%load sfall, srecall, allHRexampleimages before this function
function gradients_merge = F16a_ACCV12TextureGradientNotIntensity(img_y, zooming, Gau_sigma ,sfall,srecall,allHRexampleimages)
if zooming == 4
para.Gau_sigma = 1.6;
elseif zooming == 3
para.Gau_sigma = 1.2;
... |
github | Liusifei/Face-Hallucination-master | U9_DrawMultiPieLandmarkVisualCheck.m | .m | Face-Hallucination-master/Code/Ours2/U9_DrawMultiPieLandmarkVisualCheck.m | 504 | utf_8 | 3f1349d55d7d68600170460c93193816 | %Chih-Yuan Yang
%10/01/12
function hfig = U9_DrawMultiPieLandmarkVisualCheck(image,landmark,bshowtext)
%show image
hfig = figure;
imshow(image);
axis off image
hold on
%show landmark
plot(landmark(:,1),landmark(:,2),'w.','MarkerSize',30); %why the color changes after hfig returns?
... |
github | Liusifei/Face-Hallucination-master | F11e_BackProjection_GaussianKernel.m | .m | Face-Hallucination-master/Code/Ours2/F11e_BackProjection_GaussianKernel.m | 1,422 | utf_8 | 91c09fc297bd57f1030101b30351e20b | %Chih-Yuan Yang
%07/20/14
%F11c: controlled by iternum
%F11d: controled by TolF
%F11e: I replace the IF5 internal function by F26 since they are identical.
% I update the code to support the scaling factor of 3. I replace the F19a
% by F19c since F19c is simpler and does not require F20.
function img_bp = F... |
github | Liusifei/Face-Hallucination-master | F15_ComputeSRSSD.m | .m | Face-Hallucination-master/Code/Ours2/F15_ComputeSRSSD.m | 236 | utf_8 | 3532526636455f6cc3acccf05b85199d | %03/17/12
function SRSSD = F15_ComputeSRSSD(GradOrImg)
if size(GradOrImg,3) == 8
Grad = GradOrImg;
else
Grad = F14_Img2Grad(GradOrImg);
end
Sqr = Grad .^2;
Sum = sum(Sqr,3);
SRSSD = sqrt(Sum);
end |
github | Liusifei/Face-Hallucination-master | U5_ReadFileNameList.m | .m | Face-Hallucination-master/Code/Ours2/U5_ReadFileNameList.m | 249 | utf_8 | 6cc6e817fc7e4d5c331e663041ff41fc | %Chih-Yuan Yang
%03/07/13
%U5: read list from a file and return it as an cell array
function filenamelist = U5_ReadFileNameList( fn_list )
fid = fopen(fn_list,'r');
C = textscan(fid,'%d %s\n');
fclose(fid);
filenamelist = C{2};
end
|
github | Liusifei/Face-Hallucination-master | IF4s_BuildHRimagefromHRPatches.m | .m | Face-Hallucination-master/Code/Ours2/IF4s_BuildHRimagefromHRPatches.m | 4,401 | utf_8 | 07e053559d7bc259285d722b784bfab0 | % Build color image
function img_texture = IF4s_BuildHRimagefromHRPatches(hrpatch,zooming)
%reconstruct the high-resolution image
patchsize_hr = size(hrpatch,1);
patchsize_lr = patchsize_hr/zooming;
h_lr = size(hrpatch,4) + patchsize_lr - 1;
w_lr = size(hrpatch,5) + patchsize_lr - 1;
h_expected ... |
github | Liusifei/Face-Hallucination-master | F11a_AdaptiveBackProjection.m | .m | Face-Hallucination-master/Code/Ours2/F11a_AdaptiveBackProjection.m | 7,250 | utf_8 | 404edc2e654e7c70e60151b263ca5528 | %09/28/12
%Chih-Yuan Yang
%The adaptive kernelmap has to be passed from the caller, or generated by img_lr
function img_bp = F11a_AdaptiveBackProjection(img_lr, img_hr, Gau_sigma, iternum,bReport,kernelmap)
[h_hr] = size(img_hr,1);
[h_lr] = size(img_lr,1);
zooming = h_hr/h_lr;
if nargin < 6
... |
github | Liusifei/Face-Hallucination-master | F14c_Img2Grad_fast_suppressboundary.m | .m | Face-Hallucination-master/Code/Ours2/F14c_Img2Grad_fast_suppressboundary.m | 2,487 | utf_8 | dfc73eaa1e6c8da2acc4a7384ee4802a | %Chih-Yuan Yang
%03/05/13
%add class control
%F14b: improve the speed, the boudnary is inaccurate
%F14c: resolve the boundary problem
function grad = F14c_Img2Grad_fast_suppressboundary(img)
[h, w] = size(img);
grad = zeros(h,w,8);
rsup = cell(2,1);
csup = cell(2,1);
for i=1:8
switch i
... |
github | Liusifei/Face-Hallucination-master | F16d_ACCV12TextureGradientNotIntensity.m | .m | Face-Hallucination-master/Code/Ours2/F16d_ACCV12TextureGradientNotIntensity.m | 21,023 | utf_8 | d5f8b5f2fa7dd109fd9f1bad6a31d0ce | %Chih-Yuan Yang
%10/04/12
%16d: only run patch selection because the edge part has been separated
function [gradients_texture img_texture img_texture_backproject] = F16d_ACCV12TextureGradientNotIntensity(img_y, zooming, Gau_sigma ,sfall,srecall,allHRexampleimages,allLRexampleimages)
if zooming == 4
para.Gau... |
github | Liusifei/Face-Hallucination-master | U13_ComputeTransformMatrix.m | .m | Face-Hallucination-master/Code/Ours2/U13_ComputeTransformMatrix.m | 1,261 | utf_8 | e029340afaef26a58f7273c0495d4509 | %08/31/12
%Chih-Yuan Yang
%align and two points, no more restriction that the two eyes are horizontal
function transformmatrix = U13_ComputeTransformMatrix(input_points, base_points)
x1 = input_points(1,1);
y1 = input_points(1,2);
x2 = input_points(2,1);
y2 = input_points(2,2);
xb1 = base_point... |
github | Liusifei/Face-Hallucination-master | F19b_GenerateLRImage_jpeg.m | .m | Face-Hallucination-master/Code/Ours2/F19b_GenerateLRImage_jpeg.m | 2,021 | utf_8 | 0deb75d0b2c032cd97fde6ff5c26c7a5 | %Chih-Yuan Yang
%09/28/12
%Change the method of subsampling
%Sifei Liu
%02/22/13
%Generating compressed LR image
% hrimg: estimated HR image;
% s: zooming factor
% sigma: gaussian scale
% quality: jpeg compress quality
function lrimg = F19b_GenerateLRImage_jpeg(hrimg,s,sigma,quality)
if isa(hrimg,'uint8')
... |
github | Liusifei/Face-Hallucination-master | F6a_RetriveAreaGradientsByAlign_TwoPoints.m | .m | Face-Hallucination-master/Code/Ours2/F6a_RetriveAreaGradientsByAlign_TwoPoints.m | 2,320 | utf_8 | f8707eebc9c2bbbdc4384293e2351860 | %Chih-Yuan Yang
%09/25/12
%change rawexampleimage to uint8 to save memroy
function gradientcandidate = F6a_RetriveAreaGradientsByAlign_TwoPoints(testimage_lr, rawexampleimage, inputpoints, basepoints, region_lr, zooming, Gau_sigma)
%the rawexampleimage should be double
if ~isa(rawexampleimage,'uint8')
e... |
github | Liusifei/Face-Hallucination-master | F45_SimilarityEvaluation.m | .m | Face-Hallucination-master/Code/Ours2/F45_SimilarityEvaluation.m | 4,835 | utf_8 | ca3c2e4016d4fe1901981f92c7ea77f0 | %Chih-Yuan Yang
%11/09/12
%Separate from F27a
function SqrtData = F45_SimilarityEvaluation(Img_in)
[h w] = size(Img_in);
SqrtData = zeros(h,w,16);
f3x3 = ones(3);
for i = 1:16
[DiffOp N] = IF2_RetGradientKernel16(i);
if N == 1
Diff = imfilter(Img_in,DiffOp{1},'symmetric'... |
github | Liusifei/Face-Hallucination-master | F27a_SmoothnessPreserving.m | .m | Face-Hallucination-master/Code/Ours2/F27a_SmoothnessPreserving.m | 8,143 | utf_8 | 59cf63fde62f924872cf245e7725f34e | %Chih-Yuan Yang
%10/27/12
%Seperate this function from F21, because this function is required in training phase
%F27a: save similarity_lr and similarity_hr to draw figures required for the paper
function img_out = F27a_SmoothnessPreserving(img_y,zooming,Gau_sigma)
img_bb = imresize(img_y,zooming);
%compute the... |
github | Liusifei/Face-Hallucination-master | U27_CreateSymphonyFile.m | .m | Face-Hallucination-master/Code/Ours2/U27_CreateSymphonyFile.m | 259 | utf_8 | 66156ab38fd172eb5aa7e15ac5306e17 | %Chih-Yuan Yang
%09/16/12
%To parallel run Glasner's algorithm
function U24_CreateSymphonyFile(fn_create,iiend,filenamelist)
fid = fopen(fn_create,'w+');
for i=1:iiend
fprintf(fid,'%05d %s 0\n',i,filenamelist{i});
end
fclose(fid);
end
|
github | Liusifei/Face-Hallucination-master | U27b_CreateSemaphoreFile_IndexOnly_NoFileName.m | .m | Face-Hallucination-master/Code/Ours2/U27b_CreateSemaphoreFile_IndexOnly_NoFileName.m | 214 | utf_8 | d5ad9fa32410a0809a0c6e6c89a3a2a6 | %Chih-Yuan Yang
%3/22/13
%
function U27b_CreateSemaphoreFile_IndexOnly_NoFileName(fn_create,iiend)
fid = fopen(fn_create,'w+');
for i=1:iiend
fprintf(fid,'%05d 0\n',i);
end
fclose(fid);
end
|
github | Liusifei/Face-Hallucination-master | F11c_BackProjection_GaussianKernel.m | .m | Face-Hallucination-master/Code/Ours2/F11c_BackProjection_GaussianKernel.m | 2,214 | utf_8 | 55512b6425f55cb53110c116ec2c6d72 | %Chih-Yuan Yang
%09/28/12
%Change from square kernel to Gaussian Kernel
function img_bp = F11c_BackProjection_GaussianKernel(img_lr, img_hr, Gau_sigma, iternum,bReport)
[h_hr] = size(img_hr,1);
[h_lr] = size(img_lr,1);
zooming = h_hr/h_lr;
for i=1:iternum
img_lr_gen = F19a_GenerateLRImage_Gaussi... |
github | Liusifei/Face-Hallucination-master | F37i_GetTexturePatchMatch_SingleFor.m | .m | Face-Hallucination-master/Code/Ours2/F37i_GetTexturePatchMatch_SingleFor.m | 10,640 | utf_8 | cc8acd1dc21c233f921a826293d77cbd | %Chih-Yuan Yang
%2/3/15
%Use patchmatch to retrieve a texture background
%F37h: This file is updated from F37f to support the scaling factor of 3.
%F37i: Now I run the code on Linux machines where the parfor is unstable. Thus I change the parfor to for
function [gradients_texture, img_texture, img_texture_backprojectio... |
github | Liusifei/Face-Hallucination-master | F13_TestNewBackProjection.m | .m | Face-Hallucination-master/Code/Ours2/F13_TestNewBackProjection.m | 593 | utf_8 | 283841ca532ea0ca079b5b3adf26f1db | %09/13/12
%Chih-Yuan Yang
function img_out = F13_TestNewBackProjection(img_lr, img_hr, Gau_sigma, iternum)
img_initial = img_hr;
img_out = img_initial; %iternum may be 0
for i=1:iternum
%img_lr_gen = U3_GenerateLRImage_BlurSubSample(img_hr,zooming,Gau_sigma);
gradients_old = F14_Img2Gra... |
github | Liusifei/Face-Hallucination-master | F40_ExtractAllHrPatches.m | .m | Face-Hallucination-master/Code/Ours2/F40_ExtractAllHrPatches.m | 2,490 | utf_8 | 4703805b0d3fd12ba361d750a76e2f14 | %Chih-Yuan Yang
%10/07/12
%Sepearte internal function as external
function hrpatch = F40_ExtractAllHrPatches(patchsize_lr,zooming,hrpatchextractdata,allHRexampleimages)
%question: if the hrpatch does not need compensate, the input paramters img_y and allLRexampleimages can be ignore
%in:
%hrpatchextractdata... |
github | Liusifei/Face-Hallucination-master | U21_DrawLandmarks.m | .m | Face-Hallucination-master/Code/Ours2/U21_DrawLandmarks.m | 821 | utf_8 | 6046e1df7e14273c2505bea2c01539b3 | %09/10/12
%
function U21_DrawLandmarks(im, boxes, posemap,bshownumbers,bdrawpose)
% showboxes(im, boxes)
% Draw boxes on top of image.
imshow(im);
hold on;
axis image;
axis off;
for b = boxes,
partsize = b.xy(1,3)-b.xy(1,1)+1;
tx = (min(b.xy(:,1)) + max(b.xy(:,3)))/2;
ty = min(b.xy(:,2)) - partsize/2;
... |
github | Liusifei/Face-Hallucination-master | T1_shiftblock.m | .m | Face-Hallucination-master/Code/Ours2/T1_shiftblock.m | 3,847 | utf_8 | cfb7142784ab5b0c4f9bd552452392ec | % SHIFTBLOCK output the shift block structures
% jpeg: input jpeg data stucture
% sftblk: output shifted block stucture, including:
% vdb: coefficients of vertical shifted block;
% hdb: coefficients of horizontal shifted block;
% Vvars: spatial domain of step component;
% Vcons: spatial domain o... |
github | Liusifei/Face-Hallucination-master | F6d_RetriveImage_DrawFlowChart.m | .m | Face-Hallucination-master/Code/Ours2/F6d_RetriveImage_DrawFlowChart.m | 2,597 | utf_8 | 9eafbd0e18b8ac33ab67131aee3ca1f8 | %Chih-Yuan Yang
%07/20/14 I update the function F19a to F19c.
%F6d: return the alinged images to draw the flowchart
function [retrievedhrimage, retrievedlrimage, retrievedidx, alignedexampleimage_hr, alignedexampleimage_lr] = ...
F6d_RetriveImage_DrawFlowChart(testimage_lr, ...
rawexampleimage, inputpoints, bas... |
github | Liusifei/Face-Hallucination-master | T1_Img2Grad_Blockcompensate.m | .m | Face-Hallucination-master/Code/Ours2/T1_Img2Grad_Blockcompensate.m | 2,086 | utf_8 | c5d81b3a52933b697b727de169c40b13 | %This is Sifei's code to remove the blocky artifacts.
%The idea is to average gradients of pixels along every 8x8 block
%What is the difference of Grad_o and Grad_v?
function Grad_o = T1_Img2Grad_Blockcompensate(img)
bz = 8;
sftblk = T1_shiftblock(img);
% normalization
% img = (img-min(min(img)))/(max(max(img))-min(mi... |
github | Liusifei/Face-Hallucination-master | F31_AlignImages.m | .m | Face-Hallucination-master/Code/Ours2/F31_AlignImages.m | 624 | utf_8 | 77d84815d8097ed2d39598c753d5f9d9 | %Chih-Yuan Yang
%09/29/12
%as title
function alignedimages = F30_AlignImages(rawexampleimage, inputpoints, basepoints)
%the rawexampleimage should be double
if ~isa(rawexampleimage,'uint8')
error('wrong class');
end
exampleimagenumber = size(rawexampleimage,3);
%find the transform matrix by ... |
github | Liusifei/Face-Hallucination-master | F10_CSHUpampling.m | .m | Face-Hallucination-master/Code/Ours2/F10_CSHUpampling.m | 3,639 | utf_8 | 4c6ce81c759131078a8b3cf93717fdc0 | %Chih-Yuan Yang
%09/11/12
%To solve the hair and background problem
function img_hr = F10_CSHUpampling(img_y, exampleimage_hr, zooming, Gau_sigma)
addpath(genpath(fullfile('Lib','CSH_code_v2')));
%set randseed
seed = RandStream('mcg16807','Seed',0);
RandStream.setGlobalStream(seed)
[h_hr w_hr... |
github | Liusifei/Face-Hallucination-master | F4c_GenerateIntensityFromGradient.m | .m | Face-Hallucination-master/Code/Ours2/F4c_GenerateIntensityFromGradient.m | 4,531 | utf_8 | 8f1bc8f4bba3afae27185acf447e8f30 | %Chih-Yuan Yang
%09/29/12
%F4b: change first gradient from F19 to F19a, which uses a precise Gaussian kernel
%F4c: F4b is too slow, change the parameters
%Gradually incrase the coef of high-low term to achieve the contrained optimization problem
function img_out = F4c_GenerateIntensityFromGradient(img_y,img_initial,Gra... |
github | Liusifei/Face-Hallucination-master | F16_ACCV12UpamplingBackProjectionOnTextureOnly.m | .m | Face-Hallucination-master/Code/Ours2/F16_ACCV12UpamplingBackProjectionOnTextureOnly.m | 43,630 | utf_8 | 35bce9ddf165ff8accb3378a116dace3 | %Chih-Yuan Yang
%09/18/12
%load sfall, srecall, allHRexampleimages before this function
function img_hr = F16_ACCV12UpamplingBackProjectionOnTextureOnly(img_y, zooming, Gau_sigma ,sfall,srecall,allHRexampleimages)
if zooming == 4
para.Gau_sigma = 1.6;
elseif zooming == 3
para.Gau_sigma = 1.2;
... |
github | Liusifei/Face-Hallucination-master | F37f_GetTexturePatchMatch_Aligned.m | .m | Face-Hallucination-master/Code/Ours2/F37f_GetTexturePatchMatch_Aligned.m | 13,388 | utf_8 | 9f5b9bae31553af0503055933b6977aa | %Chih-Yuan Yang
%10/07/12
%Use patchmatch to retrieve a texture background
function [gradients_texture, img_texture, img_texture_backprojection] = F37f_GetTexturePatchMatch_Aligned(img_y, ...
hrexampleimages, lrexampleimages, landmarks_test, rawexamplelandmarks)
%parameter
numberofHcandidate = 10;
... |
github | Liusifei/Face-Hallucination-master | F40_CompensateHRpatches.m | .m | Face-Hallucination-master/Code/Ours2/F40_CompensateHRpatches.m | 1,341 | utf_8 | ece1f9e17377677e192ae02b610fb56a | %Chih-Yuan Yang
%10/07/12
function hrpatch_compensate = F40_CompensateHRpatches(hrpatch, img_y, zooming, hrpatchextractdata,lrexampleimages)
%in:
%hrpatchextractdata: (h_lr-patchsize_lr+1) x (w_lr-patchsize_lr+1) x numberofHcandidate x 3 %ii,r_lr_src,c_lr_src
hrpatch_compensate = zeros(size(hrpatch));... |
github | Liusifei/Face-Hallucination-master | F18a_AlignExampleImageByTwoPoints.m | .m | Face-Hallucination-master/Code/Ours2/F18a_AlignExampleImageByTwoPoints.m | 459 | utf_8 | 5bdf68475e0ffcc19064b4878111e604 | %Chih-Yuan Yang
%09/15/12
%Change from F18 to F18, two points only, no optimization
function alignedexampleimage = F18a_AlignExampleImageByTwoPoints(exampleimage,inputpoints,basepoints)
[h w d] = size(exampleimage);
tform = cp2tform(inputpoints, basepoints,'nonreflective similarity');
%generated the transfo... |
github | Liusifei/Face-Hallucination-master | U21a_DrawLandmarks_Points_ReturnHandle.m | .m | Face-Hallucination-master/Code/Ours2/U21a_DrawLandmarks_Points_ReturnHandle.m | 933 | utf_8 | c9419254c3dd43155fec87373fe5e03a | %Chih-Yuan Yang
%09/15/12
%Sometimes the format of landmarks are coordinates rather than boxes
%03/19/14 update the fucntion, the bdrawpose does not work
function hfig = U21a_DrawLandmarks_Points_ReturnHandle(im, points, posemap,bshownumbers,bdrawpose,bvisible)
if bvisible
hfig = figure;
else
hf... |
github | Liusifei/Face-Hallucination-master | F18b_AlignExampleImageByLandmarkSet.m | .m | Face-Hallucination-master/Code/Ours2/F18b_AlignExampleImageByLandmarkSet.m | 2,230 | utf_8 | b636615d164ee40bc5b4be7afc6a6730 | %Chih-Yuan Yang
%06/12/13
%F18: only return the aligned image
%F18a: AlignExampleImagesByTwoPoints, this must be an old function.
%F18b: from F18, return the aligned landmarks
function [alignedexampleimage, landmarks_aligned] = F18b_AlignExampleImageByLandmarkSet(exampleimage,inputpoints,basepoints)
%use shift and ... |
github | Liusifei/Face-Hallucination-master | T1_Facesmoother.m | .m | Face-Hallucination-master/Code/Ours2/T1_Facesmoother.m | 2,384 | utf_8 | 9169e2fd4a51a23c10447e4562d7a510 | function img = T1_Facesmoother(img)
% for super-resolution results smmother
dimg = T2_MultiDoG(img);
edge_bw = edge(rgb2gray(img),'canny',[0.01,0.12]);
img = T1_EdgeSmoothing(img, dimg, edge_bw);
end
% EDGESOMMTHIMG.m produce the edages by preserveing the edge-data in
% ref_im, and generates new pixels of other region... |
github | Liusifei/Face-Hallucination-master | U23_PrepareResultFolder.m | .m | Face-Hallucination-master/Code/Ours2/U23_PrepareResultFolder.m | 1,104 | utf_8 | 85619b24913ae5e317fd6fc41deeea7b | %Chih-Yuan Yang
%09/15/12
%simplify main function
function para = U23_PrepareResultFolder(resultfolder,para)
settingfolder = fullfile(resultfolder,sprintf('%s%d',para.SaveName,para.setting));
tuningfolder = fullfile(settingfolder, sprintf('Tuning%d',para.tuning));
para.resultfolder = resultfolder;
para.... |
github | Liusifei/Face-Hallucination-master | F37e_GetTexturePatchMatch_PatchCompensate_SimilarityFilter.m | .m | Face-Hallucination-master/Code/Ours2/F37e_GetTexturePatchMatch_PatchCompensate_SimilarityFilter.m | 12,898 | utf_8 | 7e0e3d9bfb628f725e1490725478cf54 | %Chih-Yuan Yang
%10/07/12
%Use patchmatch to retrieve a texture background
function [gradients_texture img_texture img_texture_backprojection] = ...
F37e_GetTexturePatchMatch_PatchCompensate_SimilarityFilter(img_y, ...
hrexampleimages, lrexampleimages)
%parameter
numberofHcandidate = 10;
%star... |
github | Liusifei/Face-Hallucination-master | U24_sc.m | .m | Face-Hallucination-master/Code/Ours2/U24_sc.m | 1,764 | utf_8 | fed7b2eda56837174f633232855bd7f8 | %Chih-Yuan Yang
%10/11/12
%Usage
%U24_sc(img,[0 1]);
function hfig = U24_sc(varargin)
bSetColormapGray = false;
for j=1:nargin
if isa(varargin{j},'char')
ControlString = varargin{j};
StringLength = length(ControlString);
for i=1:StringLength
switch Con... |
github | Liusifei/Face-Hallucination-master | F6f_RetriveImage_DrawFlowChart.m | .m | Face-Hallucination-master/Code/Ours2/F6f_RetriveImage_DrawFlowChart.m | 2,688 | utf_8 | 4062d227dc2025015b7a09ca66eddc0d | %Chih-Yuan Yang
%2/2/15
%F6d: return the alinged images to draw the flowchart. I update the function F19a to F19c.
%F6f: The parallel command parfor is unstall on Linux. Thus I change it back to normal for loop.
function [retrievedhrimage, retrievedlrimage, retrievedidx, alignedexampleimage_hr, alignedexampleimage_lr]... |
github | Liusifei/Face-Hallucination-master | U26_DrawMask.m | .m | Face-Hallucination-master/Code/Ours2/U26_DrawMask.m | 971 | utf_8 | b784d543172316f3d30cd8a78746ed36 | %Chih-Yuan Yang
%10/10/12
function U26_DrawMask(img, componentrecord, bsave, fn_save)
if nargin < 3
bsave = false;
end
codefolder = fileparts(pwd);
addpath(fullfile(codefolder,'Lib','YIQConverter'));
[h w] = size(img);
img = repmat(img,[1 1 3]); %prepare for color
img_yiq = RGB2YIQ... |
github | Liusifei/Face-Hallucination-master | U25a_ReadSemaphoreFile.m | .m | Face-Hallucination-master/Code/Ours2/U25a_ReadSemaphoreFile.m | 321 | utf_8 | b1430f2eb5cfb5ee4f131ef486b3272f | %Chih-Yuan Yang
%08/28/13
%To parallel run Glasner's algorithm
%Just read, do not change the semaphore file
function [arr_filename, arr_label] = U25a_ReadSemaphoreFile(fn_symphony)
fid = fopen(fn_symphony,'r+');
C = textscan(fid,'%05d %s %d\n');
arr_filename = C{2};
arr_label = C{3};
fclose(fid);
en... |
github | Liusifei/Face-Hallucination-master | F29_AddPixelIdxFromCoor.m | .m | Face-Hallucination-master/Code/Ours2/F29_AddPixelIdxFromCoor.m | 360 | utf_8 | df5423a57f2287ff5eee471e2b6ce3ed | %Chih-Yuan Yang
%10/01/12
%Correct error, the mapping from coordinate to index is round rather than floor or ceil
function region = F29_AddPixelIdxFromCoor(region)
region.left_idx = round(region.left_coor);
region.top_idx = round(region.top_coor);
region.right_idx = round(region.right_coor);
region.bott... |
github | Liusifei/Face-Hallucination-master | F27b_SmoothnessPreserving.m | .m | Face-Hallucination-master/Code/Ours2/F27b_SmoothnessPreserving.m | 7,564 | utf_8 | 9a939481df544fadc2c13f24d293c052 | %Chih-Yuan Yang
%1/3/15
%Seperate this function from F21, because this function is required in training phase
%F27a: save similarity_lr and similarity_hr to draw figures required for the paper
%F27b: Now I run the code on a Linux machine through SSH. There is no GUI so that I
%would like to disable all image rendering.... |
github | Liusifei/Face-Hallucination-master | F7_ComputePSNR_SSIM_DIIVINE.m | .m | Face-Hallucination-master/Code/Ours2/F7_ComputePSNR_SSIM_DIIVINE.m | 1,163 | utf_8 | 5eee7e53e792342dbae52c1943352c21 | %09/12/12
%Chih-Yuan Yang, EECS, UC Merced
%Compute PSNR, SSIM, DIVINE
%If you encounter a MATLAB error: Undefined function 'buildSFpyr' for input arguments of type 'double'.
%You need to install libraries which are dependencies of DIIVINE
%Steerable Pyramid Toolbox, Download from: http://www.cns.nyu.edu/~eero/steerpyr... |
github | Liusifei/Face-Hallucination-master | U23a_PrepareResultFolder.m | .m | Face-Hallucination-master/Code/Ours2/U23a_PrepareResultFolder.m | 1,137 | utf_8 | 3560d9fcfec329fa70657e0caeabb913 | %Chih-Yuan Yang
%09/25/12
%from U23 to U23a, change the name of setting folder
function para = U23a_PrepareResultFolder(resultfolder,para)
settingfolder = fullfile(resultfolder,sprintf('%s%d',para.settingname, para.setting));
tuningfolder = fullfile(settingfolder, sprintf('Tuning%d',para.tuning));
para.resu... |
github | Liusifei/Face-Hallucination-master | F37b_GetTexturePatchMatch_PatchCompensate.m | .m | Face-Hallucination-master/Code/Ours2/F37b_GetTexturePatchMatch_PatchCompensate.m | 12,865 | utf_8 | 849b03c185bdc637acc0f2492918d37b | %Chih-Yuan Yang
%10/07/12
%Use patchmatch to retrieve a texture background
function [gradients_texture img_texture img_texture_backprojection] = F37b_GetTexturePatchMatch_PatchCompensate(img_y, ...
hrexampleimages, lrexampleimages)
%parameter
numberofHcandidate = 1;
%start
[h_lr, w_lr, example... |
github | Liusifei/Face-Hallucination-master | U12_AlignExampleImageByTestEyes.m | .m | Face-Hallucination-master/Code/Ours2/U12_AlignExampleImageByTestEyes.m | 797 | utf_8 | 0c2c35f5e7ac99a7309df8637e349a4c | %Chih-Yuan Yang
%08/31/12
function [alignedexampleimage alignedlandmarks] = U12_AlignExampleImageByTestEyes(exampleimage,landmarks,eyecenter,testeyecenter)
[h w exampleimagenumber] = size(exampleimage);
alignedexampleimage = zeros(h, w, exampleimagenumber,'uint8');
alignedlandmarks = zeros(68,2,exampleimage... |
github | Liusifei/Face-Hallucination-master | F21c_EdgePreserving_GaussianKernel.m | .m | Face-Hallucination-master/Code/Ours2/F21c_EdgePreserving_GaussianKernel.m | 8,595 | utf_8 | 31c45f6b14eb21121a14bd50f78e5d4b | %Chih-Yuan Yang
%09/29/12
%F21b: Based on F21a, but change the square kernel to Gaussian, to see whether the square pattern disappear
%F21c: remove the para argument
function [gradient_expected gradient_actual weightmap_edge img_edge] = F21c_EdgePreserving_GaussianKernel(img_y,zooming,Gau_sigma)
LowMagSuppression =... |
github | Liusifei/Face-Hallucination-master | F2_ReturnLandmarks.m | .m | Face-Hallucination-master/Code/Ours2/F2_ReturnLandmarks.m | 1,429 | utf_8 | 7bfe348598b5785b1ac920493bfaef49 | %09/29/12
%Chih-Yuan Yang
%This file has to be executed on Linux
function [bs posemap]= F2_ReturnLandmarks(im, modelname)
% load and visualize model
% Pre-trained model with 146 parts. Works best for faces larger than 80*80
%load face_p146_small.mat
% % Pre-trained model with 99 parts. Works best for ... |
github | Liusifei/Face-Hallucination-master | F32a_ComputeMask_Mouth.m | .m | Face-Hallucination-master/Code/Ours2/F32a_ComputeMask_Mouth.m | 2,375 | utf_8 | 272accc010ebb93eccf1bac4f6d2eb9f | %Chih-Yuan Yang
%07/20/14
%Blur the mask_hr to prevent discontinue boundary
%F32a: I add new inputs to support the scaling factor of 3. I also replace F19a to F19c.
function [mask_lr, mask_hr] = F32a_ComputeMask_Mouth(landmarks_hr, scalingfactor, Gau_sigma)
%poits 49:68 are mouth
mask_hr = zeros(480,640);
... |
github | Liusifei/Face-Hallucination-master | F37_GetTexturePatchMatch.m | .m | Face-Hallucination-master/Code/Ours2/F37_GetTexturePatchMatch.m | 7,673 | utf_8 | 14c2ead333bda6b48e4e390a7728a074 | %Chih-Yuan Yang
%10/05/12
%Use patchmatch to retrieve a texture background
function [gradients_texture img_texture img_texture_backprojection] = F37_GetTexturePatchMatch(img_y, ...
hrexampleimages, lrexampleimages)
[h_lr, w_lr, exampleimagenumber] = size(lrexampleimages);
[h_hr, w_hr, ~] = size(hrexampleima... |
github | Liusifei/Face-Hallucination-master | F21d_EdgePreserving_GaussianKernel.m | .m | Face-Hallucination-master/Code/Ours2/F21d_EdgePreserving_GaussianKernel.m | 8,988 | utf_8 | 36518bf567ca2194183e56d5dd021413 | %Chih-Yuan Yang
%10/02/12
%F21b: Based on F21a, but change the square kernel to Gaussian, to see whether the square pattern disappear
%F21c: remove the para argument
%F21d: try to use large beta0 and small beta1 to see whether it can save the computational time
function [gradient_expected gradient_actual weightmap_edge... |
github | Liusifei/Face-Hallucination-master | U5d_ReadFileNameList_Index_Comment.m | .m | Face-Hallucination-master/Code/Ours2/U5d_ReadFileNameList_Index_Comment.m | 2,170 | utf_8 | 363e2331409333cc628abb5f9e597ed0 | %Chih-Yuan Yang
%09/01/13
%U5: read list from a file and return it as an cell array
%U5c: add more comment controls, the comment sign % may occur at the end of a line
%U5d: suppose the list contains index
function filenamelist = U5d_ReadFileNameList_Index_Comment( fn_list )
fid = fopen(fn_list,'r');
%skip the h... |
github | Liusifei/Face-Hallucination-master | F11_BackProjection.m | .m | Face-Hallucination-master/Code/Ours2/F11_BackProjection.m | 934 | utf_8 | 4b0bbea072111144272dbf5b81271106 | %09/19/12
%Chih-Yuan Yang
%add report
function img_bp = F11_BackProjection(img_lr, img_hr, Gau_sigma, iternum,bReport)
[h_hr] = size(img_hr,1);
[h_lr] = size(img_lr,1);
zooming = h_hr/h_lr;
for i=1:iternum
img_lr_gen = F19_GenerateLRImage_BlurSubSample(img_hr,zooming,Gau_sigma);
diff_lr ... |
github | Liusifei/Face-Hallucination-master | U27d_CreateSemaphoreFile_IndexOnly_Exclude.m | .m | Face-Hallucination-master/Code/Ours2/U27d_CreateSemaphoreFile_IndexOnly_Exclude.m | 321 | utf_8 | afcd97c7aca96d193bf7d1e1e1f51dab | %Chih-Yuan Yang
%4/1/13
%
function U27d_CreateSemaphoreFile_IndexOnly_Exclude(fn_create,iiend,set_value0)
fid = fopen(fn_create,'w+');
for i=1:iiend
if nnz(set_value0 == i)
fprintf(fid,'%05d 0\n',i);
else
fprintf(fid,'%05d 1\n',i);
end
end
fclose(fid);
end... |
github | Liusifei/Face-Hallucination-master | F14_Img2Grad.m | .m | Face-Hallucination-master/Code/Ours2/F14_Img2Grad.m | 805 | utf_8 | 782f46fa3e2d8440290ca95abe60cc43 | %Chih-Yuan Yang
%10/02/12
%add class control
function Grad = F14_Img2Grad(img)
if ~isa(img,'double')
img = im2double(img);
warning('input type is not double.');
end
[h w] = size(img);
Grad = zeros(h,w,8);
DiffOp = IF1_RetGradientKernel();
for i=1:8
Grad(:,:,i) = imfilter(... |
github | Liusifei/Face-Hallucination-master | U27f_CreateSemaphoreFile_FromFilenamelist_SetArray.m | .m | Face-Hallucination-master/Code/Ours2/U27f_CreateSemaphoreFile_FromFilenamelist_SetArray.m | 300 | utf_8 | d02e9667b2345eca5608aafa983837c6 | %Chih-Yuan Yang
%4/3/12
%To parallel run
function U27f_CreateSemaphoreFile_FromFilenamelist_SetArray(fn_create,arr_filename, arr_value)
fid = fopen(fn_create,'w+');
for i=1:length(arr_filename)
fprintf(fid,'%05d %s %d\n',i,arr_filename{i},arr_value(i));
end
fclose(fid);
end
|
github | Liusifei/Face-Hallucination-master | T1_ImprovePatchMatch.m | .m | Face-Hallucination-master/Code/Ours2/T1_ImprovePatchMatch.m | 1,264 | utf_8 | 6d50fdf1fcee30d1a653f63f9c78c8f0 | %Chih-Yuan Yang
%04/25/16
%Sifei calls the TVD_dpreserve_mm three times, to regularize images along x, y, and x axis by TV norm.
%Does the paper and the original released code also work in this way consequently for x, y, and then x?
function img_texture = T1_ImprovePatchMatch(img_texture,img_y)
%Grad_o is a set of ... |
github | Liusifei/Face-Hallucination-master | F8_RetriveAreaGradientsByAlign_Optimization_PatchCompare.m | .m | Face-Hallucination-master/Code/Ours2/F8_RetriveAreaGradientsByAlign_Optimization_PatchCompare.m | 2,368 | utf_8 | 221a92eeab3f073b39ce5d43f33b465e | %Chih-Yuan Yang
%09/11/12
%Solve the hair and background problem
%This idea does not work
function gradientcandidate = F8_RetriveAreaGradientsByAlign_Optimization_PatchCompare(testimage_lr, rawexampleimage, inputpoints, basepoints, region_lr, zooming, Gau_sigma)
region_hr = U18_ConvertLRRegionToHRRegion(region_lr, ... |
github | Liusifei/Face-Hallucination-master | U20_ReturnHandleDrawLandmarks.m | .m | Face-Hallucination-master/Code/Ours2/U20_ReturnHandleDrawLandmarks.m | 1,015 | utf_8 | feb1dfaf1aeb76f0c572dba0f91c468d | %09/14/12
%Chih-Yuan Yang
%Return the handle
function hfig = U23_ReturnHandleDrawLandmarks(im, boxes, posemap,bshownumbers,bdrawpose,bVisible)
if bVisible
hfig = figure;
else
hfig = figure('Visible','off');
end
imshow(im);
hold on;
axis image;
axis off;
for b = boxes,
... |
github | Liusifei/Face-Hallucination-master | F42_ConvertImageCoorToCartesianCoor.m | .m | Face-Hallucination-master/Code/Ours2/F42_ConvertImageCoorToCartesianCoor.m | 570 | utf_8 | dfd1f5972aeb86cbc8334d60cde570ef | %Chih-Yun Yang
%10/23/12
%Called by PP2_GenerateAlignImageAndAlignedLandmarks
function pts_cartisian = F42_ConvertImageCoorToCartesianCoor(pts_image, imagesize)
h = imagesize(1);
w = imagesize(2); %not used
[pointperimage, dimperpts, imagenumber] = size(pts_image);
pts_cartisian = zeros(pointperim... |
github | Liusifei/Face-Hallucination-master | F11d_BackProjection_GaussianKernel.m | .m | Face-Hallucination-master/Code/Ours2/F11d_BackProjection_GaussianKernel.m | 2,514 | utf_8 | 77f0ae684573082cd6e59065b67a6e02 | %Chih-Yuan Yang
%07/20/14 I update the code to support the scaling factor of 3.
%F11c: controlled by iternum
%F11d: controled by TolF
%This file should be replace by F11e
%function img_bp = F11d_BackProjection_GaussianKernel(img_lr, img_hr, Gau_sigma, iternum,bReport,TolF)
[h_hr] = size(img_hr,1);
[h_lr] = size... |
github | Liusifei/Face-Hallucination-master | F12_ACCV12Preprocess_LoadingData.m | .m | Face-Hallucination-master/Code/Ours2/F12_ACCV12Preprocess_LoadingData.m | 906 | utf_8 | 6c1821196672d0e9d784f00f25d71390 | %Chih-Yuan Yang
%09/19/12
%hint: for patch work, loading all data into memory can save time.
function [sfall srecall] = F12_ACCV12Preprocess_LoadingData(zooming,featurefilename,recordfilename)
if zooming == 4
featurefolder = fullfile('TexturePatchDataset','Feature','s4');
elseif zooming == 3
fea... |
github | Liusifei/Face-Hallucination-master | U27e_CreateSemaphoreFile_FromFilenamelist_ExcludeSet.m | .m | Face-Hallucination-master/Code/Ours2/U27e_CreateSemaphoreFile_FromFilenamelist_ExcludeSet.m | 419 | utf_8 | 7a0ceb3028a632f982a4637bb8fadf24 | %Chih-Yuan Yang
%4/3/12
%To parallel run
function U27e_CreateSymphonyFile_FromFilenamelist_ExcludeSet(fn_create,filenamelist, set_value0)
fid = fopen(fn_create,'w+');
for i=1:length(filenamelist)
if nnz(set_value0 == i)
fprintf(fid,'%05d %s 0\n',i,filenamelist{i});
else
... |
github | Liusifei/Face-Hallucination-master | F43_ConvertCartesianCoorToImageCoor.m | .m | Face-Hallucination-master/Code/Ours2/F43_ConvertCartesianCoorToImageCoor.m | 519 | utf_8 | 695a55806208b4ae78261a7b13223eb9 | %Chih-Yuan Yang
%10/29/12
function pts_image = F43_ConvertCartesianCoorToImageCoor(pts_cartisian, imagesize)
h = imagesize(1);
w = imagesize(2); %not used
[pointperimage, dimperpts, imagenumber] = size(pts_cartisian);
pts_image = zeros(pointperimage, dimperpts, imagenumber);
for ii = 1:imagen... |
github | Liusifei/Face-Hallucination-master | U27_CreateSemaphoreFile_TwoColumn.m | .m | Face-Hallucination-master/Code/Ours2/U27_CreateSemaphoreFile_TwoColumn.m | 257 | utf_8 | 1ea771b33752980e41f3531484e57e53 | %Chih-Yuan Yang
%09/29/12
%for parallel execution
function U27_CreateSemaphoreFile_TwoColumn(fn_create,iiend,filenamelist)
fid = fopen(fn_create,'w+');
for i=1:iiend
fprintf(fid,'%05d %s 0\n',i,filenamelist{i});
end
fclose(fid);
end
|
github | Liusifei/Face-Hallucination-master | F28_ComputeSquareSumLowHighDiff.m | .m | Face-Hallucination-master/Code/Ours2/F28_ComputeSquareSumLowHighDiff.m | 393 | utf_8 | 73640adb8e524325e9992ea6ea807837 | %Chih-Yuan Yang
%07/20/14
%I replace F19a to F19c to support the scaling factor of 3. In addition, F19c is simpler.
function f = F28_ComputeSquareSumLowHighDiff(img,img_low,Gau_sigma)
zooming = size(img,1)/size(img_low,1);
img_lr_generated = F19c_GenerateLRImage_GaussianKernel(img,zooming,Gau_sigma);
diff =... |
github | Liusifei/Face-Hallucination-master | F9_ACCV12Upampling.m | .m | Face-Hallucination-master/Code/Ours2/F9_ACCV12Upampling.m | 42,896 | utf_8 | b224bc49f05d72474523f5a65d022076 | %Chih-Yuan Yang
%09/12/12
%To solve the hair and background problem
%hint: for patch work, loading all data into memory can save time.
function img_hr = F9_ACCV12Upampling(img_y, zooming, Gau_sigma ,sfall,srecall)
if zooming == 4
para.Gau_sigma = 1.6;
featurefilename = 'sf_1_1264_qf';
record... |
github | Liusifei/Face-Hallucination-master | U2_ReturnTheLargestToDoNumber.m | .m | Face-Hallucination-master/Code/Ours2/U2_ReturnTheLargestToDoNumber.m | 707 | utf_8 | f1e7aae84f58dba2883b935de28df52c | %Chih-Yuan Yang
%09/29/12
%To parallel run Glasner's algorithm
%Change name from U25 to U2
function fileidx = U2_ReturnTheLargestToDoNumber(fn_symphony,iistart)
fileidx = -1; %default, if
fid = fopen(fn_symphony,'r+');
C = textscan(fid,'%05d %s %d\n');
iiend = length(C{1,3});
bwriteback = fa... |
github | Liusifei/Face-Hallucination-master | F19c_GenerateLRImage_GaussianKernel.m | .m | Face-Hallucination-master/Code/Ours2/F19c_GenerateLRImage_GaussianKernel.m | 1,852 | utf_8 | 867da30d81dc53d3a29ad3042d25141d | %Chih-Yuan Yang
%03/15/13
%Change the method of subsampling
%F19b, add the mode of scaling as 2
%F19c, add the mode of scaling as 8
function lrimg = F19c_GenerateLRImage_GaussianKernel(hrimg,s,sigma)
if isa(hrimg,'uint8')
hrimg = im2double(hrimg);
end
[h, w, d] = size(hrimg);
htrim = h-mod(h,s);... |
github | Liusifei/Face-Hallucination-master | F37g_GetTexturePatchMatch_Aligned.m | .m | Face-Hallucination-master/Code/Ours2/F37g_GetTexturePatchMatch_Aligned.m | 13,512 | utf_8 | daf2019f43ec02e60280f1cc83622ce9 | %Chih-Yuan Yang
%09/08/13
%Use patchmatch to retrieve a texture background
%F37g: There is parallel optimization toolbox problem so that I have to
%temporarily change the code where all parfor has to be removed.
function [gradients_texture, img_texture, img_texture_backprojection] = F37g_GetTexturePatchMatch_Aligned(im... |
github | Liusifei/Face-Hallucination-master | U11_ExtractEyeRangeFeature.m | .m | Face-Hallucination-master/Code/Ours2/U11_ExtractEyeRangeFeature.m | 529 | utf_8 | 8b0d1120b08d30f10d422b87054bd2bf | %Chih-Yuan Yang
%08/31/12
function eyerangefeature = U11_ExtractEyeRangeFeature(eyerange)
[h w] = size(eyerange);
%the feature: gradient
%check type, int8 can not compute feature
if isa(eyerange,'double')
eyerange_double = eyerange;
else
eyerange_double = double(eyerange);
end
... |
github | Liusifei/Face-Hallucination-master | F41_ComputePatchSimilarity.m | .m | Face-Hallucination-master/Code/Ours2/F41_ComputePatchSimilarity.m | 483 | utf_8 | 9a56cadc176880ec786d047551d619eb | %Chih-Yuan Yang
%10/12/12
%For nnmex() in terms of discriptor mode
function l2norm = F41_ComputePatchSimilarity(A,B,xy)
[h w d] = size(A);
retrieveddescriptor = zeros(h,w,d);
for r=1:h
for c=1:w
x = xy(r,c,1);
y = xy(r,c,2);
r_source = y+1;
c_source = ... |
github | Liusifei/Face-Hallucination-master | T1_Img2Grad.m | .m | Face-Hallucination-master/Code/Ours2/T1_Img2Grad.m | 743 | utf_8 | dfeb710d5ccd6e72fc1185c0d2ad270b | function Grad = T1_Img2Grad(img)
[h w] = size(img);
Grad = zeros(h,w,8);
DiffOp = RetGradientKernel();
for i=1:8
Grad(:,:,i) = imfilter(img,DiffOp{i},'replicate');
end
end
function f = RetGradientKernel()
f = cell(8,1);
f{1} = [0 0 0;
0 -1 1;
0 0 0];
f{2... |
github | Liusifei/Face-Hallucination-master | F37a_GetTexturePatchMatchSimilarityFilter.m | .m | Face-Hallucination-master/Code/Ours2/F37a_GetTexturePatchMatchSimilarityFilter.m | 15,700 | utf_8 | a3d7b006dc2ed233234aae66f7da2cbe | %Chih-Yuan Yang
%10/05/12
%Use patchmatch to retrieve a texture background
function [gradients_texture img_texture img_texture_backprojection] = F37a_GetTexturePatchMatchSimilarityFilter(img_y, ...
hrexampleimages, lrexampleimages)
%parameter
numberofHcandidate = 10;
%start
[h_lr, w_lr, exampl... |
github | Liusifei/Face-Hallucination-master | F39_ExtractAllHrPatches.m | .m | Face-Hallucination-master/Code/Ours2/F39_ExtractAllHrPatches.m | 2,478 | utf_8 | 2b17a373baa50a6548520ff944833a50 | %Chih-Yuan Yang
%10/07/12
%Sepearte internal function as external
function hrpatch = F39_ExtractAllHrPatches(patchsize_lr,zooming,hrpatchextractdata,allHRexampleimages)
%question: if the hrpatch does not need compensate, the input paramters img_y and allLRexampleimages can be ignore
%in:
%hrpatchextractdata... |
github | Liusifei/Face-Hallucination-master | F20_Sigma2Kernel.m | .m | Face-Hallucination-master/Code/Ours2/F20_Sigma2Kernel.m | 174 | utf_8 | 5dd9a9e790fe6562963dad18ce1f632d | %Chih-Yuan Yang
%09/20/12
function Kernel = F20_Sigma2Kernel(Gau_sigma)
KernelSize = ceil(Gau_sigma * 3)*2+1;
Kernel = fspecial('gaussian',KernelSize,Gau_sigma);
end
|
github | Liusifei/Face-Hallucination-master | F6e_RetriveImage_DrawFlowChart.m | .m | Face-Hallucination-master/Code/Ours2/F6e_RetriveImage_DrawFlowChart.m | 2,799 | utf_8 | 90151785621128e11aefa5cdc589c2fe | %Chih-Yuan Yang
%6/12/13
%F6d: return the alinged images to draw the flowchart
%F6e: return the aligned landmarks so that I can draw the new figure for PAMI
function [retrievedhrimage, retrievedlrimage, retrievedidx, alignedexampleimage_hr, alignedexampleimage_lr, ...
alignedlandmarks] = ...
F6e_RetriveImage_Dr... |
github | Liusifei/Face-Hallucination-master | F21f_EdgePreserving_GaussianKernel.m | .m | Face-Hallucination-master/Code/Ours2/F21f_EdgePreserving_GaussianKernel.m | 10,261 | utf_8 | c49afa98a0822dec5155f604e7daf9f1 | %Chih-Yuan Yang
%10/27/12
%F21b: Based on F21a, but change the square kernel to Gaussian, to see whether the square pattern disappear
%F21c: remove the para argument
%F21d: try to use large beta0 and small beta1 to see whether it can save the computational time
%F21e: return gradient_expect to save time
%F21f: change t... |
github | Liusifei/Face-Hallucination-master | im2patches.m | .m | Face-Hallucination-master/Code/Ma10/im2patches.m | 1,616 | utf_8 | cc1828fb7cc7e88a54b135f8bd1c17a6 | % function to convert an image into patches according to a possible mask
% note that for now im has to be a grayscale image
function [patches,max_x,max_y] = im2patches(im,patchSize,intervalSize)
if exist('boundarySize','var')~=1
boundarySize = ceil(patchSize/2);
end
% if boundarySize < patchSize
% error('The b... |
github | Liusifei/Face-Hallucination-master | F1a_rnd_smp_dictionary.m | .m | Face-Hallucination-master/Code/Jianchao08/F1a_rnd_smp_dictionary.m | 1,202 | utf_8 | efe29029302db06579a4ca72784e60a1 | %Chih-Yuan Yang
%10/29/12
%F1: Change the original file to load '*.png'
%F1a: according to the ICIP paper of Jianchao, the Xl and Xh are both high-resolution patch
function [Xh, Xl] = F1a_rnd_smp_dictionary(folder_exampleimages, folder_reconstructedimages, patch_size, num_patch)
fpath = fullfile(folder_reconstructedim... |
github | Liusifei/Face-Hallucination-master | F2_coupled_dic_train.m | .m | Face-Hallucination-master/Code/Jianchao08/F2_coupled_dic_train.m | 1,084 | utf_8 | 142a3e5792ad61dc4db24ef3a0d90175 | %Chih-Yuan Yang
%10/19/12
%reduce the iteration number to reduce the computation time
%this function needs to be further improved, to pass the temp folder of dictionary to F3_sparse_coding
%and remove the hard-coded folder in F3_sparse_coding
function [Dh, Dl] = F2_coupled_dic_train(Xh, Xl, codebook_size, lambda, itera... |
github | Liusifei/Face-Hallucination-master | rnd_smp_dictionary.m | .m | Face-Hallucination-master/Code/Jianchao08/rnd_smp_dictionary.m | 2,852 | utf_8 | 212d5ad367742fb65a07fe925569d9ec | function [Xh, Xl] = rnd_smp_dictionary(tr_dir, patch_size, zooming, num_patch)
fpath = fullfile(tr_dir, '*.bmp');
img_dir = dir(fpath);
Xh = [];
Xl = [];
img_num = length(img_dir);
nums = zeros(1, img_num);
for num = 1:length(img_dir),
im = imread(fullfile(tr_dir, img_dir(num).name));
nums(num) = prod(size(... |
github | Liusifei/Face-Hallucination-master | F3_L1SR.m | .m | Face-Hallucination-master/Code/Jianchao08/F3_L1SR.m | 4,861 | utf_8 | f698e5b227c276d06019af58f299e8b5 | %Chih-Yuan yang
%10/24/12
%remove a bug where the upsampled image size in not always 3x, but should be controlled by zooming
%remove a bug where the boundary can not be well filled in Jianchao's original code
%note: the format of the first argument lIm is double but the range is 0~255
function [hIm, ww] = F3_L1SR(lIm, ... |
github | Liusifei/Face-Hallucination-master | F3a_L1SR.m | .m | Face-Hallucination-master/Code/Jianchao08/F3a_L1SR.m | 7,950 | utf_8 | c517a83c8a2019640fb35dc497f554b6 | %Chih-Yuan yang
%10/24/12
%remove a bug where the upsampled image size in not always 3x, but should be controlled by zooming
%remove a bug where the boundary can not be well filled in Jianchao's original code
%note: the format of the first argument lIm is double but the range is 0~255
%F3a: dymanically change the dicti... |
github | Liusifei/Face-Hallucination-master | F4_OptimizationTerm.m | .m | Face-Hallucination-master/Code/Jianchao08/F4_OptimizationTerm.m | 857 | utf_8 | 15d8711641b99d84c55235c45fb90590 | %Chih-Yuan Yang
%10/29/12
%solve the optimization problem
function termvalue = F4_OptimizationTerm(c, basisW,img_y,sigma)
[h_lr, w_lr] = size(img_y);
vector_hr = basisW * c;
zooming = round(sqrt(size(vector_hr,1)/(h_lr* w_lr)));
h_hr = h_lr * zooming;
w_hr = w_lr * zooming;
img_hr = reshape(vect... |
github | Liusifei/Face-Hallucination-master | F3b_L1SR.m | .m | Face-Hallucination-master/Code/Jianchao08/F3b_L1SR.m | 7,366 | utf_8 | 1e041e1c5630403bb833d728f9d3828b | %Chih-Yuan yang
%10/24/12
%remove a bug where the upsampled image size in not always 3x, but should be controlled by zooming
%remove a bug where the boundary can not be well filled in Jianchao's original code
%note: the format of the first argument lIm is double but the range is 0~255
%F3a: dymanically change the dicti... |
github | Liusifei/Face-Hallucination-master | F5_sample_patches.m | .m | Face-Hallucination-master/Code/Jianchao08/F5_sample_patches.m | 1,400 | utf_8 | 4eb7f1f373a3a48d367c73424626b0bb | %Chih-Yuan Yang
%10/29/12
%Export this function form F1a_rnd_smp_dictionary
function [HP, LP] = F5_sample_patches(img_reconstructed, img_original, patchsize, patch_num)
[nrow, ncol] = size(img_reconstructed);
x = randperm(nrow-patchsize+1);
y = randperm(ncol-patchsize+1);
[X,Y] = meshgrid(x,y);
xrow = X(:);
ycol = Y... |
github | Liusifei/Face-Hallucination-master | F1_rnd_smp_dictionary.m | .m | Face-Hallucination-master/Code/Jianchao08/F1_rnd_smp_dictionary.m | 2,927 | utf_8 | eb2f78ed0c406dcc46fb5cc253b0b1ef | %Chih-Yuan Yang
%10/17/12
%F1: Change the original file to load '*.png'
function [Xh, Xl] = F1_rnd_smp_dictionary(tr_dir, patch_size, zooming, num_patch)
fpath = fullfile(tr_dir, '*.png');
img_dir = dir(fpath);
Xh = [];
Xl = [];
img_num = length(img_dir);
nums = zeros(1, img_num);
for num = 1:length(img_dir),
i... |
github | Liusifei/Face-Hallucination-master | L1SR.m | .m | Face-Hallucination-master/Code/Jianchao08/L1SR.m | 4,642 | utf_8 | 6a6cc4d000b3a0e623ebe08066cce5ad | %Chih-Yuan yang
%10/22/12
%remove a bug where the upsampled image size in not always 3x, but should be controlled by zooming
function [hIm, ww] = L1SR(lIm, zooming, patch_size, overlap, Dh, Dl, lambda, regres)
% Use sparse representation as the prior for image super-resolution
% Usage
% [hIm] = L1SR(lIm, zooming,... |
github | Liusifei/Face-Hallucination-master | F3c_L1SR_HRHR_Dictionary.m | .m | Face-Hallucination-master/Code/Jianchao08/F3c_L1SR_HRHR_Dictionary.m | 5,822 | utf_8 | a24f9782d6dab41b0c2b7d6e052d10cd | %Chih-Yuan yang
%10/24/12
%remove a bug where the upsampled image size in not always 3x, but should be controlled by zooming
%remove a bug where the boundary can not be well filled in Jianchao's original code
%note: the format of the first argument img_recon is double but the range is 0~255
%F3a: dymanically change the... |
github | Liusifei/Face-Hallucination-master | immaxproduct.m | .m | Face-Hallucination-master/Code/Liu07IJCV/immaxproduct.m | 4,991 | utf_8 | 63134b108b43613ee53f95414d8be926 | % max-product belief propagation on image lattice (2D matrix)
% This implementation contains no product. The compatibility function
% should be changed to exp{-E} where E is energy or error. Here E is the
% input. Output is the MAP estimation of the graph
%
% This implementation is based on W.T. Freeman et al's IJCV p... |
github | Liusifei/Face-Hallucination-master | Sigma2Kernel.m | .m | Face-Hallucination-master/Code/Liu07IJCV/Sigma2Kernel.m | 154 | utf_8 | 139abf654633c4b0fd0c1146ade54f2c | %10/23/11
function Kernel = Sigma2Kernel(Gau_sigma)
KernelSize = ceil(Gau_sigma * 3)*2+1;
Kernel = fspecial('gaussian',KernelSize,Gau_sigma);
end
|
github | Liusifei/Face-Hallucination-master | F2_FindSimilarPatch_CSH.m | .m | Face-Hallucination-master/Code/Liu07IJCV/F2_FindSimilarPatch_CSH.m | 3,398 | utf_8 | b326c59409096453749c6affa18ca294 | %Chih-Yuan Yang, EECS, UC Merced
%Last Modified: 08/23/12
%Find similar patches form many images using CSH
%Question: I do not need to use all patches cropped from the query image.
%Only parts are required. How to handle it?
%However, do not consider it now.
%And what I need are the coordinate and norm, not the patch. ... |
github | Liusifei/Face-Hallucination-master | imgraphen.m | .m | Face-Hallucination-master/Code/Liu07IJCV/imgraphen.m | 505 | utf_8 | fcf09b9d17018fce6c5fefc7e27f85ce | % function to compute energy of the graph defiend on image lattice
function E=imgraphen(IDX,CO,CM_h,CM_v)
if length(size(IDX))==2
[nh,nw]=size(IDX);
IDX=reshape(IDX,[1 nh nw]);
end
E=CO(IDX);
E=sum(E(:));
IDX=squeeze(IDX);
[nh,nw]=size(IDX);
for i=1:nh
for j=1:nw
% horizontal energy
p=IDX(i,... |
github | Liusifei/Face-Hallucination-master | PP5_GenerateLRImage.m | .m | Face-Hallucination-master/Code/Liu07IJCV/PP5_GenerateLRImage.m | 1,026 | utf_8 | c33aa33f548f868504cdf06cbc52b199 | %08/22/12
%Compute PCA
function PP5_GenerateLRImage()
%for test images
%sourcefolder = fullfile('Examples','TestFaces_Color');
%dstfolder = fullfile('Source','TestFaces');
%GenerateLRImagesWholeFolder(sourcefolder,dstfolder);
%for training images;
sourcefolder = fullfile('Examples','TrainingFa... |
github | Liusifei/Face-Hallucination-master | mergePatches.m | .m | Face-Hallucination-master/Code/Liu07IJCV/mergePatches.m | 1,075 | utf_8 | 8d3cffb2b6e9bb2b635f4cf5851a5680 | % function to merge all the patches onto one image
function im = mergePatches(Patches,overlapSize,width,height)
[nDim,h,w]=size(Patches);
patchDim = sqrt(nDim);
patchSize = (patchDim-1)/2;
intervalSize = patchSize*2-overlapSize;
% set the dimension for the output image
if exist('width','var')~=1
width = patchDim... |
github | Liusifei/Face-Hallucination-master | U2_GenerateImagebbnn.m | .m | Face-Hallucination-master/Code/Liu07IJCV/U2_GenerateImagebbnn.m | 894 | utf_8 | 5944a59cbd22e978e8e8c8f45d36d84b | %date of last edit: 08/10/12, rename Zooming to zooming
function U2_GenerateImagebbnn(img_y, para)
s = para.zooming;
imb255 = imresize(img_y,s) * 255;
imgnn= imresize(img_y,s,'nearest');
imwrite(imb255/255,fullfile(para.tuningfolder,[para.SaveName '_bb.png']));
imwrite(imgnn,fullfile(para.tuningfold... |
github | Liusifei/Face-Hallucination-master | F15_ComputePSNR_RMSE_SSIM_DIIVINE.m | .m | Face-Hallucination-master/Code/Liu07IJCV/F15_ComputePSNR_RMSE_SSIM_DIIVINE.m | 1,065 | utf_8 | b4057938b919964cf07810f9cf5fca3d | %08/09/12
%Chih-Yuan Yang, EECS, UC Merced
%Compute PSNR, SSIM, DIVINE
%If you encounter a MATLAB error: Undefined function 'buildSFpyr' for input arguments of type 'double'.
%You need to install libraries which are dependencies of DIIVINE
%Steerable Pyramid Toolbox, Download from: http://www.cns.nyu.edu/~eero/steerpyr... |
github | tanvir002700/Coursera-Introduction-to-Programming-with-MATLAB-master | roman2.m | .m | Coursera-Introduction-to-Programming-with-MATLAB-master/Lab08/roman2.m | 1,861 | utf_8 | a5646f76cbee04af3dd08f0530e14808 | function A = roman2 (R)
% This function initially assumes the supplied input is valid. If it is not valid,
% the result, when converted back to Roman, will differ from the original input.
Roman = 'IVXLC';
Arabic = {1 5 10 50 100};
LastValue = 0; % V is value, LastValue is last V
A = uin... |
github | libDirectional/libDirectional-master | mvnpdfbench.m | .m | libDirectional-master/examples/mvnpdfbench.m | 2,336 | utf_8 | aaba49ec24c7c9856decfeeb2472618e | % This function performs a benchmark of the mvnpdf and the mvnpdffast
% functions.
function mvnpdfbench
figure(1)
benchmark();
figure(2)
benchmarkSingle();
%bench(1) ;
%benchSingle(1);
end
function benchmark
dims = 1:20;
evals = 1000000;
repeats = 10;
t1 = zer... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.