Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
UkcheolShin authored Dec 17, 2019
1 parent 49e1f1a commit a264e63
Show file tree
Hide file tree
Showing 19 changed files with 2,442 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Run_FeatureMatching.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
% Type your dataset path
Path_to_result = './Results\Result_img';

addpath('./Utils_FeatureMatching');

% Run feature extraction & matching
main_feature_matching_analysis(strcat(Path_to_result,'\indoor_class_room1_340Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\indoor_class_room2_401Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\indoor_class_room3_320Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\indoor_class_room4_263Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\indoor_common_room1_177Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\indoor_common_room2_95Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\indoor_lounage1_200Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\indoor_meeting_room1_198Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\indoor_meeting_room3_213Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\indoor_meeting_room2_191Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\outdoor_bench1_6420Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\outdoor_bench2_5530Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\outdoor_bicycle1_14230Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\outdoor_bicycle2_2680Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\outdoor_car1_15310Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\outdoor_car2_5530Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\outdoor_car3_4080Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\outdoor_car4_5520Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\outdoor_car5_5290Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\outdoor_car6_4539Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\outdoor_car7_8490Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\outdoor_scene1_7380Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\outdoor_scene2_7710Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\outdoor_weed1_3350Lux'));
main_feature_matching_analysis(strcat(Path_to_result,'\outdoor_weed2_3010Lux'));
85 changes: 85 additions & 0 deletions Run_MetricsEvaluation.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
% Type your dataset path
Path_to_datset = './DataSet_AE';

addpath('./Utils_metric');

% Run Metric Evaluator
Eval_Metric(strcat(Path_to_datset,'\indoor_class_room1_340Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\indoor_class_room2_401Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\indoor_class_room3_320Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\indoor_class_room4_263Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\indoor_common_room1_177Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\indoor_common_room2_95Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\indoor_lounage1_200Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\indoor_meeting_room1_198Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\indoor_meeting_room3_213Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\indoor_meeting_room2_191Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\outdoor_bench1_6420Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\outdoor_bench2_5530Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\outdoor_bicycle1_14230Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\outdoor_bicycle2_2680Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\outdoor_car1_15310Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\outdoor_car2_5530Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\outdoor_car3_4080Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\outdoor_car4_5520Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\outdoor_car5_5290Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\outdoor_car6_4539Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\outdoor_car7_8490Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\outdoor_scene1_7380Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\outdoor_scene2_7710Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\outdoor_weed1_3350Lux\left'));
Eval_Metric(strcat(Path_to_datset,'\outdoor_weed2_3010Lux\left'));

% Run hyper paramter tester
% Test_HyperParam(strcat(Path_to_datset,'\indoor_class_room1_340Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\indoor_class_room2_401Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\indoor_class_room3_320Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\indoor_class_room4_263Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\indoor_common_room1_177Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\indoor_common_room2_95Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\indoor_lounage1_200Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\indoor_meeting_room1_198Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\indoor_meeting_room3_213Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\indoor_meeting_room2_191Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\outdoor_bench1_6420Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\outdoor_bench2_5530Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\outdoor_bicycle1_14230Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\outdoor_bicycle2_2680Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\outdoor_car1_15310Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\outdoor_car2_5530Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\outdoor_car3_4080Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\outdoor_car4_5520Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\outdoor_car5_5290Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\outdoor_car6_4539Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\outdoor_car7_8490Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\outdoor_scene1_7380Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\outdoor_scene2_7710Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\outdoor_weed1_3350Lux\left'));
% Test_HyperParam(strcat(Path_to_datset,'\outdoor_weed2_3010Lux\left'));

% Extract result img
Extract_Result(strcat(Path_to_datset,'\indoor_class_room1_340Lux\left'));
Extract_Result(strcat(Path_to_datset,'\indoor_class_room2_401Lux\left'));
Extract_Result(strcat(Path_to_datset,'\indoor_class_room3_320Lux\left'));
Extract_Result(strcat(Path_to_datset,'\indoor_class_room4_263Lux\left'));
Extract_Result(strcat(Path_to_datset,'\indoor_common_room1_177Lux\left'));
Extract_Result(strcat(Path_to_datset,'\indoor_common_room2_95Lux\left'));
Extract_Result(strcat(Path_to_datset,'\indoor_lounage1_200Lux\left'));
Extract_Result(strcat(Path_to_datset,'\indoor_meeting_room1_198Lux\left'));
Extract_Result(strcat(Path_to_datset,'\indoor_meeting_room3_213Lux\left'));
Extract_Result(strcat(Path_to_datset,'\indoor_meeting_room2_191Lux\left'));
Extract_Result(strcat(Path_to_datset,'\outdoor_bench1_6420Lux\left'));
Extract_Result(strcat(Path_to_datset,'\outdoor_bench2_5530Lux\left'));
Extract_Result(strcat(Path_to_datset,'\outdoor_bicycle1_14230Lux\left'));
Extract_Result(strcat(Path_to_datset,'\outdoor_bicycle2_2680Lux\left'));
Extract_Result(strcat(Path_to_datset,'\outdoor_car1_15310Lux\left'));
Extract_Result(strcat(Path_to_datset,'\outdoor_car2_5530Lux\left'));
Extract_Result(strcat(Path_to_datset,'\outdoor_car3_4080Lux\left'));
Extract_Result(strcat(Path_to_datset,'\outdoor_car4_5520Lux\left'));
Extract_Result(strcat(Path_to_datset,'\outdoor_car5_5290Lux\left'));
Extract_Result(strcat(Path_to_datset,'\outdoor_car6_4539Lux\left'));
Extract_Result(strcat(Path_to_datset,'\outdoor_car7_8490Lux\left'));
Extract_Result(strcat(Path_to_datset,'\outdoor_scene1_7380Lux\left'));
Extract_Result(strcat(Path_to_datset,'\outdoor_scene2_7710Lux\left'));
Extract_Result(strcat(Path_to_datset,'\outdoor_weed1_3350Lux\left'));
Extract_Result(strcat(Path_to_datset,'\outdoor_weed2_3010Lux\left'));
31 changes: 31 additions & 0 deletions Run_NMbasedControl.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
% Type your dataset path
Path_to_result = './Results\Result_Exp';

addpath('./Utils_control');

% Run Test
Test_nelder_mead_AE(strcat(Path_to_result,'\indoor_class_room1_340Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\indoor_class_room2_401Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\indoor_class_room3_320Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\indoor_class_room4_263Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\indoor_common_room1_177Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\indoor_common_room2_95Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\indoor_lounage1_200Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\indoor_meeting_room1_198Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\indoor_meeting_room3_213Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\indoor_meeting_room2_191Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\outdoor_bench1_6420Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\outdoor_bench2_5530Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\outdoor_bicycle1_14230Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\outdoor_bicycle2_2680Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\outdoor_car1_15310Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\outdoor_car2_5530Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\outdoor_car3_4080Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\outdoor_car4_5520Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\outdoor_car5_5290Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\outdoor_car6_4539Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\outdoor_car7_8490Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\outdoor_scene1_7380Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\outdoor_scene2_7710Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\outdoor_weed1_3350Lux\workspace_upsampled_result.mat'));
Test_nelder_mead_AE(strcat(Path_to_result,'\outdoor_weed2_3010Lux\workspace_upsampled_result.mat'));
86 changes: 86 additions & 0 deletions Utils_Control/FindClosestPoint.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
function x_ = FindClosestPoint(x, Flag_dataset)
%% Camera Exposure Control for Robust Robot Vision with Noise-Aware Image Assessment Metric
%
% Ukcheol Shin, Jinsun Park, Gyumin Shim, Francois Rameau, and In So Kweon
%
% IROS 2019
%
% Please feel free to contact if you have any problems.
%
% E-mail : Ukcheol Shin ([email protected] / [email protected])
% Robotics and Computer Vision Lab., EE,
% KAIST, Republic of Korea
%
% Project Page : https://sites.google.com/view/noise-aware-exposure-control
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Name :
% FindClosestPoint.m
%
% Returns the nearest point to the input point based on the interval previously used to upsample the dataset.
%
% Modified:
%
% 04 December 2019
%
% Author:
%
% Ukcheol Shin
%
% Parameters:
%
% Input : x - Input point
% : Flag_dataset - flag to select the setttings for each dataset
%
% output : x_ - The point closest to the input point present in the upsampled data set
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

if ( nargin == 1 )
Flag_dataset = 1;
end

if(Flag_dataset == 0) % Outdoor dataset
Interval_gain = 2;
Interval_expt = 150;
Limit_gain = 20;
Lower_limit_expt = 100;
Upper_limit_expt = 7450;
elseif(Flag_dataset == 1) % Indoor dataset
Interval_gain = 1;
Interval_expt = 3000;
Limit_gain = 24;
Lower_limit_expt = 4000;
Upper_limit_expt = 67000;
end

Gain = x(1,1);
Expt = x(1,2);

if(mod(Gain,Interval_gain) >= Interval_gain/2)
Gain = Gain - mod(Gain,Interval_gain) + Interval_gain;
elseif(mod(Gain,Interval_gain) < Interval_gain/2)
Gain = Gain - mod(Gain,Interval_gain);
end

if(mod(Expt,Interval_expt) >= Interval_expt/2)
Expt = Expt - mod(Expt,Interval_expt) + Interval_expt + Lower_limit_expt;
elseif(mod(Expt,Interval_expt) < Interval_expt/2)
Expt = Expt - mod(Expt,Interval_expt) + Lower_limit_expt;
end

if(Gain > Limit_gain)
Gain = Limit_gain;
elseif(Gain < 0)
Gain = 0;
end

if(Expt > Upper_limit_expt)
Expt = Upper_limit_expt;
elseif(Expt < Lower_limit_expt)
Expt = Lower_limit_expt;
end

x_ = zeros(1,2);
x_(1,1) = Gain;
x_(1,2) = Expt;
end
91 changes: 91 additions & 0 deletions Utils_Control/Metric_our.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
function f = Metric_our ( x , Path_UpsampledData)
%% Camera Exposure Control for Robust Robot Vision with Noise-Aware Image Assessment Metric
%
% Ukcheol Shin, Jinsun Park, Gyumin Shim, Francois Rameau, and In So Kweon
%
% IROS 2019
%
% Please feel free to contact if you have any problems.
%
% E-mail : Ukcheol Shin ([email protected] / [email protected])
% Robotics and Computer Vision Lab., EE,
% KAIST, Republic of Korea
%
% Project Page : https://sites.google.com/view/noise-aware-exposure-control
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Name :
% Metric_our
%
% Returns a value based on the proposed image evaluation method for the input point,
% which value is returned based on the "<dataset_name> _upsample.mat" generated by
% the previous "Metric_Evaluaotr.m" and "Data_Interpolation.m" .
%
% Modified:
%
% 04 December 2019
%
% Author:
%
% Ukcheol Shin
%
% Parameters:
%
% Input : x - input point, the dimension of x is 2x1,
% we assume x(1) component is "gain", x(2) component is "exposure time".
% output : f_x - Evaluated value based on our metric
% with given input parameter (gain, exposure time)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

if ( length ( x ) ~= 2 )
error ( 'Error: function expects a two dimensional input\n' );
end

% load upsampled dataset.
% In this code, we use pre-calculated datapoint and evaluated value of each dataset.
persistent Xq Yq Zq Interval_Up_Gain Interval_Up_ExpT result_txt;
if ( nargin == 2 )
load(Path_UpsampledData,'Xq','Yq','Zq', 'interval_ExpT','interval_dB');
Interval_Up_Gain = interval_dB;
Interval_Up_ExpT = interval_ExpT;
result_txt = strcat(Path_UpsampledData(1:regexp(Path_UpsampledData,'workspace')-1), 'Traj_ExpTGain.txt');
fileID = fopen(result_txt,'w');
fclose(fileID);
else
fileID = fopen(result_txt,'a');
fprintf(fileID , '%4.5f %4.5f\n' , x(1) , x(2));
fclose(fileID);
end

Gain = x(1);
Expt = x(2);

if(mod(Gain, Interval_Up_Gain) >= Interval_Up_Gain/2)
Approxi_Gain = Gain - mod(Gain, Interval_Up_Gain) + Interval_Up_Gain;
elseif(mod(Gain, Interval_Up_Gain) < Interval_Up_Gain/2)
Approxi_Gain = Gain - mod(Gain, Interval_Up_Gain);
end

if(mod(Expt, Interval_Up_ExpT) >= Interval_Up_ExpT/2)
Approxi_Expt = Expt - mod(Expt, Interval_Up_ExpT) + Interval_Up_ExpT;
elseif(mod(Expt, Interval_Up_ExpT) < Interval_Up_ExpT/2)
Approxi_Expt = Expt - mod(Expt, Interval_Up_ExpT);
end

Gain_index = find(abs(Xq(1,:) - Approxi_Gain) < 0.001);
ExpT_index = find(abs(Yq(:,1) - Approxi_Expt) < 0.001);

f = -Zq(ExpT_index,Gain_index);

% Exception handler for out of range or nonexistent values.
if(isnan(f))
f = 10^10; % instead of using "inf", use some large number
elseif(isempty(f))
f = 10^10;
end

fprintf ( 1, ' %9.3f', Approxi_Gain );
fprintf ( 1, ' %9.3f', Approxi_Expt );
fprintf ( 1, ' %9.3e\n', f );

return
end
Loading

0 comments on commit a264e63

Please sign in to comment.