it shows undefined function error in this line * * * [images offsets croppedOriginal] = SynthDataset(im, numImages, blurSigma)*** i am using free version of matlab 2015

1 view (last 30 days)
clc
clear variables
close all
dbstop if error
%%Prepare the reference image
im = imread('F:\Data\typewrtr.jpg');
im = rgb2gray(im);
im = imresize(im, [ 128 128 ]);
im = im2double(im);
%%Simulate the low-resolution images
numImages = 4;
blurSigma = 1;
* * * *[images offsets croppedOriginal] = SynthDataset(im, numImages, blurSigma)****
%%Compute the Super-Resolution image
[ lhs rhs ] = SREquations(images, offsets, blurSigma);
K = sparse(1 : size(lhs, 2), 1 : size(lhs, 2), sum(lhs, 1));
initialGuess = K \ lhs' * rhs; % This is an 'average' image produced from the LR images.
HR = GradientDescent(lhs, rhs, initialGuess);
HR = reshape(HR, sqrt(numel(HR)), sqrt(numel(HR)));
%%Visualize the results
ShowLRImages(images);
figure;
subplot(1, 3, 1);
imshow(HR);
title('Super-Resolution');
subplot(1, 3, 2);
imshow(imresize(imresize(croppedOriginal, 0.5), 2));
title('Bicubic Interpolation');
subplot(1, 3, 3);
imshow(croppedOriginal);
title('Reference');
%%Compute the mean-square error of reconstruction.
mse = sum((HR(:) - croppedOriginal(:)) .* (HR(:) - croppedOriginal(:))) / numel(HR);
fprintf(1, 'Reconstruction Mean-square error: %f\n', mse);

Answers (1)

Geoff Hayes
Geoff Hayes on 4 Oct 2015
vignesh - you probably need to download Victor May's submission for the function SynthDataset. You can get the code from this link http://www.mathworks.com/matlabcentral/fileexchange/33839-image-super-resolution-iterative-back-projection-algorithm/content/TestUtils/SynthDataset.m. Make sure that you save this file (or files) within the MATLAB search path.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!