diff options
Diffstat (limited to 'SD-VBS/common/toolbox/toolbox_basic/fact/construct_w2.m')
| -rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/fact/construct_w2.m | 25 |
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 @@ | |||
| 1 | function 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 | |||
| 8 | points = length(indexes); | ||
| 9 | if (nargin == 4), | ||
| 10 | frames = 0.5*size(centers,2); | ||
| 11 | end | ||
| 12 | |||
| 13 | W = zeros(3*frames,points); | ||
| 14 | |||
| 15 | center_x = img_center(1); | ||
| 16 | center_y = img_center(2); | ||
| 17 | |||
| 18 | for 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)'; | ||
| 25 | end \ No newline at end of file | ||
