Bugfixes, minor modifications.
This commit is contained in:
parent
85ade404f2
commit
b6a49ff0f7
@ -114,4 +114,7 @@ function val = nearestOdd(x, minVal)
|
|||||||
|
|
||||||
% Enforce minimum
|
% Enforce minimum
|
||||||
val = max(n, minVal);
|
val = max(n, minVal);
|
||||||
|
if mod(val,2) == 0
|
||||||
|
val = val + 1; % bump to next odd
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -29,9 +29,9 @@ function plotDetectedPatches(img, patchProps, results, params, xStart, yStart, f
|
|||||||
|
|
||||||
if isempty(hFig)
|
if isempty(hFig)
|
||||||
% If not found, create a new figure
|
% If not found, create a new figure
|
||||||
hFig = figure('Name','Bayesian Optimization Live Viewer', ...
|
hFig = figure('Name','Optimization Live Viewer', ...
|
||||||
'NumberTitle','off', ...
|
'NumberTitle','off', ...
|
||||||
'Position', [50 50 1000 800], ...
|
'Position', [200 200 600 600], ...
|
||||||
'KeyPressFcn',@keyPressCallback, ...
|
'KeyPressFcn',@keyPressCallback, ...
|
||||||
'Tag','OptimizerViewer'); % <-- unique tag
|
'Tag','OptimizerViewer'); % <-- unique tag
|
||||||
else
|
else
|
||||||
|
|||||||
@ -3,20 +3,24 @@
|
|||||||
% Joint optimization across all training images
|
% Joint optimization across all training images
|
||||||
|
|
||||||
% ------------------ USER INPUTS ------------------
|
% ------------------ USER INPUTS ------------------
|
||||||
imageFolder = 'OptimizationImages';
|
|
||||||
maskFolder = 'OptimizationMasks';
|
% Use folder where this script is located
|
||||||
|
thisScriptPath = mfilename('fullpath');
|
||||||
|
[thisScriptDir, ~, ~] = fileparts(thisScriptPath);
|
||||||
|
baseimageFolder = fullfile(thisScriptDir, 'OptimizationImages');
|
||||||
|
basemaskFolder = fullfile(thisScriptDir, 'OptimizationMasks');
|
||||||
|
|
||||||
% Load all images and ground truth masks
|
% Load all images and ground truth masks
|
||||||
imgFiles = dir(fullfile(imageFolder, '*.png'));
|
imgFiles = dir(fullfile(baseimageFolder, '*.png'));
|
||||||
maskFiles = dir(fullfile(maskFolder, '*.png'));
|
maskFiles = dir(fullfile(basemaskFolder, '*.png'));
|
||||||
|
|
||||||
nImages = min(numel(imgFiles), numel(maskFiles));
|
nImages = min(numel(imgFiles), numel(maskFiles));
|
||||||
imgs = cell(1, nImages);
|
imgs = cell(1, nImages);
|
||||||
masks = cell(1, nImages);
|
masks = cell(1, nImages);
|
||||||
|
|
||||||
for i = 1:nImages
|
for i = 1:nImages
|
||||||
imgs{i} = im2double(imread(fullfile(imageFolder, imgFiles(i).name)));
|
imgs{i} = im2double(imread(fullfile(baseimageFolder, imgFiles(i).name)));
|
||||||
masks{i} = imread(fullfile(maskFolder, maskFiles(i).name)) > 0;
|
masks{i} = imread(fullfile(basemaskFolder, maskFiles(i).name)) > 0;
|
||||||
end
|
end
|
||||||
|
|
||||||
% ------------------ BASE PARAMETERS ------------------
|
% ------------------ BASE PARAMETERS ------------------
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user