This assignment will help you gain a practical understanding of Resampling and Filtering and how it affects visual media types like images and videos.
Firstly, you will have to write a program to display images in the RGB format. This source has been provided as a reference for students who may not know how to read and display images.
You will take an image an input in a 4:3 aspect ratio, which will be a high resolution image (4000×3000) or a low resolution image (400×300). Your program will generate an output image which will be one of the following standard formats
• O1: 1920×1080
• O2: 1280×720
• O3: 640×480
In each case, depending on your input size, you will need to either down sample or up sample the image. In each case implement these two methods to choose your sample value.
• In the down sample case, use
1. Specific/Random sampling where you choose a specific pixel
2.Gaussian smoothing where you choose the average of a set of samples
• In the up sample case, use
1.Nearest neighbor to choose your up sampled pixel
2. Bilinear/Cubic interpolation
Correspondingly you will have five input parameters to your program
• FileName (string) – gives you the location of the file containing the image.
• Width (int) – width of the image in pixels.
• Height (int) – height of the image in pixels.
• Resampling method (int) – has values of 1 or 2. You will have to determine whether the image is being up sampled or down sampled and decide accordingly.
• Output format (string) – can have values O1, O2 or O3 for the three formats discussed above.
To invoke your program we will compile it and run it at the command line as
YourProgram.exe C:/myDir/myImage.rgb 4000 3000 1 O2
The expectation here is that your program will read the image of size 4000×3000 and down sample it to 1280×720 and use specific/random sampling to decide each pixel value in the output.