diff options
Diffstat (limited to 'SD-VBS/benchmarks/tracking/src/matlab/imageResize.m')
-rwxr-xr-x | SD-VBS/benchmarks/tracking/src/matlab/imageResize.m | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/SD-VBS/benchmarks/tracking/src/matlab/imageResize.m b/SD-VBS/benchmarks/tracking/src/matlab/imageResize.m deleted file mode 100755 index e5fa7b8..0000000 --- a/SD-VBS/benchmarks/tracking/src/matlab/imageResize.m +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | function [imageOut] = imageResize(imageIn) | ||
2 | |||
3 | imageIn = double(imageIn); | ||
4 | imsize = size(imageIn); | ||
5 | rows = imsize(1); | ||
6 | cols = imsize(2); | ||
7 | |||
8 | %% level 1 is the base image. | ||
9 | |||
10 | outputRows = floor((rows+1)/2); | ||
11 | outputCols = floor((cols+1)/2); | ||
12 | |||
13 | kernel = [1,4,6,4,1]; | ||
14 | kernelSize = 5; | ||
15 | |||
16 | temp = zeros(rows, outputCols);%initalize output image to all zeros | ||
17 | imageOut = zeros(outputRows, outputCols);%initalize output image to all zeros | ||
18 | imageIn = double(imageIn);%convert to double to allow image arithmetic | ||
19 | |||
20 | initialCol = 3; %((kernelSize+1)/2); | ||
21 | endCol = cols - 2; %round(cols - ((kernelSize+1)/2)); | ||
22 | halfKernel = 2; %(kernelSize-1)/2; | ||
23 | |||
24 | initialRow = 3; %((kernelSize+1)/2); | ||
25 | endRow = rows - 2; %(rows - ((kernelSize+1)/2)); | ||
26 | |||
27 | %% Start 1-D filtering row-wise first. | ||
28 | |||
29 | for i=initialRow:endRow | ||
30 | k = 1; | ||
31 | for j=initialCol:2:endCol | ||
32 | temp(i,k) = sum(imageIn(i,j-halfKernel:j+halfKernel).*kernel)/sum(kernel);%actual filtering step | ||
33 | k = k+1; | ||
34 | end | ||
35 | end | ||
36 | |||
37 | %imshow(uint8(temp)); | ||
38 | |||
39 | %% Start 1-D filtering col-wise first. | ||
40 | % | ||
41 | kernelT = kernel'; | ||
42 | j = 1; | ||
43 | for i=initialRow:2:endRow | ||
44 | for k=1:outputCols | ||
45 | imageOut(j,k) = sum(temp(i-halfKernel:i+halfKernel,k).*kernelT)/sum(kernel);%kernel to be transposed for performing multiplcation | ||
46 | end | ||
47 | j = j + 1; | ||
48 | end | ||
49 | |||
50 | % %imshow(uint8(imageOut)); | ||