Question: Subsampling in 2D: Consider g : R2 R. Note that g(x,y) on an interval [a,b] [c,d could represent the value of a grayscale photo at

Subsampling in 2D: Consider g : R2 R. Note that g(x,y) on an interval [a,b] [c,d could represent the value of a grayscale photo at position (x,y) [a, b] x [c, d]. Say that you know the value g at NzNy points (ziy.9(zi;Uj)) for i = 0, 1, . . . , N,-1 and J = 0, 1, . . . , N,1. You wish to downsample this set of points by a factor of Kx in the x direction and Ky in the y direction, starting with i = C and j = D. As an example, see Figure l (a) (5 points) Let NzNy be the number of points in the original set. Write a formula for M2My, the number of points in the subsampled image, in terms of Nz, Ny, K, Ky, C and D. (b) (5 points) Let gArr be a 2D array storing g(zi,Vi) for i-0,1, , M,-1 and J-0,1, ,N,-1. Write pseudo-code for a function that takes gArr, Nz, Ny, C, D, K and Ky as inputs, and outputs gSubArr, a 2D array that's the subsampled result. Figure 1: This grid represents the original 2D array, with blue dots in the entries that are kept by subsampling. The parameters for this subsampling are C 2, D 1, K2, Ky-3, N, 13 and N, 8, with (i, j) = (0,0) in the top left corner. Note: x values increase going to the right and y values increase going downt. Subsampling in 2D: Consider g : R2 R. Note that g(x,y) on an interval [a,b] [c,d could represent the value of a grayscale photo at position (x,y) [a, b] x [c, d]. Say that you know the value g at NzNy points (ziy.9(zi;Uj)) for i = 0, 1, . . . , N,-1 and J = 0, 1, . . . , N,1. You wish to downsample this set of points by a factor of Kx in the x direction and Ky in the y direction, starting with i = C and j = D. As an example, see Figure l (a) (5 points) Let NzNy be the number of points in the original set. Write a formula for M2My, the number of points in the subsampled image, in terms of Nz, Ny, K, Ky, C and D. (b) (5 points) Let gArr be a 2D array storing g(zi,Vi) for i-0,1, , M,-1 and J-0,1, ,N,-1. Write pseudo-code for a function that takes gArr, Nz, Ny, C, D, K and Ky as inputs, and outputs gSubArr, a 2D array that's the subsampled result. Figure 1: This grid represents the original 2D array, with blue dots in the entries that are kept by subsampling. The parameters for this subsampling are C 2, D 1, K2, Ky-3, N, 13 and N, 8, with (i, j) = (0,0) in the top left corner. Note: x values increase going to the right and y values increase going downt
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
