function s060802_el_bias_study

load DATA/eval_detloc_el-classify_cluster_sns-sbmfcc_sns_model-FAST_detect_locate_wrapper-seq01-1p-0000-result.mat
load( eval_result.list.classify_cluster_filename, 'result');
tmp = eval_result.list.restricted.el_error; tmpind = eval_result.list.restricted.which_loc_est; toto = result.list.sphloc_mat( :, tmpind );
tmpgt = eval_result.list.gt.person(1).interp_sph;
tmpgtind = eval_result.list.restricted.gt_frame_ind;
figure; plot( tmpgt(1,tmpgtind), tmpgt(4, tmpgtind),'.', 'markersize', 15);
hold on; plot( toto(1,:), toto(4,:),'rx');
hold on; plot( toto(1,:), tmp + tmpgt(4,tmpgtind),'ko');
title( 'verification' );

% Now let's look at the dependency of el error on true el

elgtdeg = tmpgt(4,tmpgtind)/pi*180;
elerrordeg = tmp/pi*180;
figure; plot( elgtdeg, elerrordeg, '.' );

% Means may show it more clearly (bias only, not std dev)
uelgt = unique( elgtdeg )
n_gt = numel( uelgt )
for n = 1:n_gt
  ind = find( abs( elgtdeg - uelgt( n ) ) < eps );

  bias( n ) = mean( elerrordeg( ind ) );
  dev( n ) = std( elerrordeg( ind ) );

end 
figure; plot( uelgt, bias, '.', 'markersize', 15 ); v = axis; axis( [ 0 v(2:4) ] );

hfig = figure; h=errorbar( uelgt, bias, dev, 'k.' ); set( h, 'markersize', 20 ); v = axis; v(1) = 0; axis( v );
hold on; plot( v(1:2), [ 0 0],'k--');
set( gca, 'fontsize', 20 );
xlabel( 'ground-truth elevation in degrees' );
ylabel( 'elevation bias in degrees' );
out_filename = [ mfilename '-bw.eps' ];
print( hfig, '-deps2', out_filename );
disp( [ mfilename ' wrote out "' out_filename '".' ] );


