-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathenergy_along_track_measure.m
74 lines (57 loc) · 1.93 KB
/
energy_along_track_measure.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
function result = energy_along_track_measure(left_image, right_image, nadir)
% This function estimates the overall variation in energy signal per each
% ping.
%
% Input
% sss_in: a structure that contains the left and right (original) SSS image, the
% normalized scans and the nadir edge
%
%
% Author: Mohammed Al-Rawi [[email protected]]
% Project: SWARMs
% Date: Sept 12, 2016
%
%
%
%
%
% Project SWARMs http://www.swarms.eu/
%
% License:
%=====================================================================
% This is part of the UNDROIP toolbox, released under
% the GPL. https://github.com/rawi707/UNDROIP/blob/master/LICENSE
%
% The UNDROIP toolbox is available free and
% unsupported to those who might find it useful. We do not
% take any responsibility whatsoever for any problems that
% you have related to the use of the UNDROIP toolbox.
%
% ======================================================================
%%
[result.en_var_L, result.en_mean_L] = do_it(left_image, nadir.left.edge);
[result.en_var_R, result.en_mean_R] = do_it(right_image, nadir.right.edge);
end
function [s, m] = do_it(img, nadir_edge)
[npings, npts]=size(img);
% s = zeros(npts,1);
% m = zeros(npts,1);
%
%
% for idx= nadir_edge(1): npts
% m(idx)= mean(img(:,idx));
% s(idx) = std(img(:,idx))/( m(idx) + 0.001); % the 0.001 has been added to prevent overflow if the signal is all zeros
% end
s = zeros(npings,1);
m = zeros(npings,1);
% for idx= nadir_edge(1): npings
% m(idx)= mean(img(idx, :));
% s(idx) = std(img(idx, :))/( m(idx) + 0.001); % the 0.001 has been added to prevent overflow if the signal is all zeros
% end
% using log
for idx= nadir_edge(1): npings
m(idx)= mean(log(img(idx, :)));
s(idx) = std(log(img(idx, :)))/( m(idx) + 0.001); % the 0.001 has been added to prevent overflow if the signal is all zeros
end
% s= s/(npings*npts);
end