-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepareRowData.m
49 lines (44 loc) · 1.41 KB
/
prepareRowData.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
function IG=prepareRowData(I,SIG)
% prepareRowData crops part of the initial image (120,120) and filters it.
% Set the corner values of the filtered image the same as the corner
% values of the raw data (low) in order to improve the triangulation
%
%
% SYNOPSIS IG=prepareRowData(I,SIG)
%
% INPUT I : raw data
% SIG : sigma of the GK
%
% OUTPUT IG : filtered image
%
% REMARKS Used by fsmPrepMainSecondarySpeckles when the detection algorithm is run
% independently from the software package
%
% DEPENDENCES prepareRowData uses { Gauss2d}
% prepareRowData is used by { fsmPrepMainSecondarySpeckles }
%
% Alexandre Matov, November 7th, 2002
% extracting the Bit Depth information
aux=class(I);
switch aux
case 'uint8'
BitDepth=8;
I=double(I); % initial treatment of the raw data
I=I/(2^BitDepth-1); % convert back the images
case 'uint16'
BitDepth=16;
I=double(I);
I=I/(2^(BitDepth-2)-1);
otherwise
error('unknown bit depth')
end
% I=double(I);
% I=I/(2^14-1);
% % I=I/(2^8-1);
% filter image
IG=Gauss2D(I,1);
% set the corner values of the filtered image the same as the corner values of the raw data (low) in order to improve the triangulation
IG(1,1)=I(1,1);
IG(1,size(IG,2))=I(1,size(I,2));
IG(size(IG,1),1)=I(size(I,1),1);
IG(size(IG,1),size(IG,2))=I(size(I,1),size(I,2));