From b1f9e9fe7d36744b9b7df4480295d966b74a841a Mon Sep 17 00:00:00 2001 From: Preetham Manjunatha Date: Thu, 14 Nov 2024 22:22:43 -0800 Subject: [PATCH] Fixed imageSet deprecation in MATLAB R2024b. --- MATLAB/Procedural Program/Inputs.m | 2 +- MATLAB/Procedural Program/Main_AutoPanoStitch.m | 16 ++++++++++------ MATLAB/Procedural Program/loadImages.m | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/MATLAB/Procedural Program/Inputs.m b/MATLAB/Procedural Program/Inputs.m index 1cf7a5d..60fc134 100644 --- a/MATLAB/Procedural Program/Inputs.m +++ b/MATLAB/Procedural Program/Inputs.m @@ -27,7 +27,7 @@ %% Inputs 3 % Warping -input.warpType = 'planar'; % 'spherical' | 'cylindrical' | 'planar' (projective) +input.warpType = 'spherical'; % 'spherical' | 'cylindrical' | 'planar' (projective) % Focal length input.fx = 2000; % focal length of camera in pixels diff --git a/MATLAB/Procedural Program/Main_AutoPanoStitch.m b/MATLAB/Procedural Program/Main_AutoPanoStitch.m index ebcd591..762df06 100644 --- a/MATLAB/Procedural Program/Main_AutoPanoStitch.m +++ b/MATLAB/Procedural Program/Main_AutoPanoStitch.m @@ -48,21 +48,25 @@ %-------------------------------------------------------------------------- % Image sets %-------------------------------------------------------------------------- -imgSetVector = imageSet(fullfile(folderPath,folderName),'recursive'); -datasetName = cat(1,{imgSetVector.Description})'; -foldersLen = length(imgSetVector); +imgFolders = dir(fullfile(folderPath,folderName)); +imgFolders = imgFolders([imgFolders(:).isdir]); +imgFolders = imgFolders(~ismember({imgFolders(:).name},{'.','..'})); + +% Dataset name and folders length +datasetName = {imgFolders.name}'; +foldersLen = length(datasetName); %% Panorama stitcher %-------------------------------------------------------------------------- % Stitches panoramas %-------------------------------------------------------------------------- -for myImg = 62 %1:foldersLen +for myImg = 65 %1:foldersLen stitchStart = tic; - fprintf('Image number: %i | Current folder: %s\n', myImg, imgSetVector(myImg).Description); + fprintf('Image number: %i | Current folder: %s\n', myImg, imgFolders(myImg).name); %% Load images loadimagestic = tic; - [keypoints, allDescriptors, images, numImg] = loadImages(input, imgSetVector, myImg); + [keypoints, allDescriptors, images, numImg] = loadImages(input, imgFolders, myImg); fprintf('Loading images (+ features): %f seconds\n', toc(loadimagestic)); %% Get feature matrices and keypoints diff --git a/MATLAB/Procedural Program/loadImages.m b/MATLAB/Procedural Program/loadImages.m index 72eec7f..9775601 100644 --- a/MATLAB/Procedural Program/loadImages.m +++ b/MATLAB/Procedural Program/loadImages.m @@ -11,7 +11,7 @@ %************************************************************************% % Read images - imgFolder = fileparts(imgSetVector(myImg).ImageLocation(1)); + imgFolder = fullfile(imgSetVector(myImg).folder, imgSetVector(myImg).name); imds = imageDatastore(imgFolder); imageFiles = readall(imds);