Using Confocal algorithm on MATLAB

9 Ansichten (letzte 30 Tage)
Marina Ghobrial
Marina Ghobrial am 10 Dez. 2021
Bearbeitet: Image Analyst am 10 Dez. 2021
Hi, I was trying to make a code, where I input a set of images and then I would use confocal algorithm on them. However, I am having errors in the code, Can someone please help?
rootFolder = '/Users/marinaghobrial/Downloads/compressed-2';
%imds=Image2D
imds = imageDatastore (fullfile(rootFolder), ...
'LabelSource',"foldernames", 'IncludeSubfolders',true);
figure
for i = 1:20
subplot(2,2,i);
imshow(imds)
end
I = imread(imds);
PSF = fspecial('gaussian',5,5);
V = 0.002;
blurred_noisy = imnoise(blurred,'gaussian',0,V);
luc1 = deconvlucy(blurred_noisy,PSF,5);
imshow(luc1)
title('I = imread(imds);
PSF = fspecial('gaussian',5,5);
V = 0.002;
blurred_noisy = imnoise(blurred,'gaussian',0,V);
luc1 = deconvlucy(blurred_noisy,PSF,5);
imshow(luc1)
title('Confocalled images')

Antworten (1)

Image Analyst
Image Analyst am 10 Dez. 2021
Bearbeitet: Image Analyst am 10 Dez. 2021
This is not correct syntax:
title('I = imread(imds);
You need to have a string in the title argument, like
title('This is my image');
And your display loop needs to be like this:
rootFolder = '/Users/marinaghobrial/Downloads/compressed-2';
imds = imageDatastore (fullfile(rootFolder), ...
'LabelSource',"foldernames", 'IncludeSubfolders',true);
figure
allFileNames = imds.Files;
%allFileNames = allFileNames(1:16); % Show just the first 16.
numImages = length(allFileNames)
plotRows = ceil(sqrt(numImages))
allPossibleFormats = imformats;
validImageCount = 0;
for k = 1:numImages
thisFileName = allFileNames{k};
% Display the file as an image, if you can.
try
thisImage = imread(thisFileName);
validImageCount = validImageCount + 1;
subplot(plotRows, plotRows, validImageCount);
imshow(thisImage)
[folder, baseFileName, ext] = fileparts(thisFileName);
title([baseFileName, ext]);
drawnow;
catch
end
end
g = gcf;
g.WindowState = 'maximized'

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by