summaryrefslogtreecommitdiffstats
path: root/SD-VBS/common/toolbox/toolbox_basic/fact/construct_w2.m
diff options
context:
space:
mode:
Diffstat (limited to 'SD-VBS/common/toolbox/toolbox_basic/fact/construct_w2.m')
-rwxr-xr-xSD-VBS/common/toolbox/toolbox_basic/fact/construct_w2.m25
1 files changed, 25 insertions, 0 deletions
diff --git a/SD-VBS/common/toolbox/toolbox_basic/fact/construct_w2.m b/SD-VBS/common/toolbox/toolbox_basic/fact/construct_w2.m
new file mode 100755
index 0000000..b2939b7
--- /dev/null
+++ b/SD-VBS/common/toolbox/toolbox_basic/fact/construct_w2.m
@@ -0,0 +1,25 @@
1function W = construct_w2(centers,Ds,img_center,indexes,frames)
2%
3% function W = construct_w2(centers,Ds,img_center,indexes,frames)
4% optional: frames
5%
6
7
8points = length(indexes);
9if (nargin == 4),
10 frames = 0.5*size(centers,2);
11end
12
13W = zeros(3*frames,points);
14
15center_x = img_center(1);
16center_y = img_center(2);
17
18for j=1:frames,
19 % x is centers(:,2*j-1)
20 % y is centers(:,2*j)
21 % d is Ds(:,2*j-1)
22 W(j,:) = (centers(indexes,2*j-1) -center_x)'./Ds(indexes,2*j-1)';
23 W(j+frames,:) = (centers(indexes,2*j) -center_y)'./Ds(indexes,2*j-1)';
24 W(j+2*frames,:) = ones(1,points)./Ds(indexes,2*j-1)';
25end \ No newline at end of file