CS 576 – Assignment 1
PART 1: Theory Questions for practice (solutions will be provided)
Q.1 Suppose a camera has 450 lines per frame, 520 pixels per line, and 25 Hz frame rate.
The color sub sampling scheme is 4:2:0, and the pixel aspect ratio is 16:9. The camera
uses interlaced scanning, and each sample of Y, Cr, Cb is quantized with 8 bits.
What is the bitrate produced by the camera?
Suppose we want to store the video signal on a hard disk, and, to save space, requantize each chrominance (Cr, Cb) signals with only 6 bits per sample. What is the minimum size of the hard disk required to store 10 minutes of video
Q.2 The following sequence of real numbers has been obtained sampling an audio
signal: 1.8, 2.2, 2.2, 3.2, 3.3, 3.3, 2.5, 2.8, 2.8, 2.8, 1.5, 1.0, 1.2, 1.2, 1.8, 2.2, 2.2, 2.2, 1.9,
2.3, 1.2, 0.2, -1.2, -1.2, -1.7, -1.1, -2.2, -1.5, -1.5, -0.7, 0.1, 0.9 Quantize this sequence by
dividing the interval [-4, 4] into 32 uniformly distributed levels (place the level 0 at -3.75,
the level 1 at -3.5, and so on. This should simplify your calculations).
Write down the quantized sequence.
How many bits in total do you need to transmit it?
Q.3 Temporal aliasing can be observed when you attempt to record a rotating wheel with
a video camera. In this problem, you will analyze such effects. Assume there is a car
moving at 36 km/hr and you record the car using a film, which traditionally record at 24
frames per second. The tires have a diameter of 0.4244 meters. Each tire has a white
mark to gauge the speed of rotation. Assume that the tire rotates without skidding.
If you are watching this projected movie in a theatre, what do you perceive the
rate of tire rotation to be in rotations/sec?
If you use your camcorder to record the movie in the theater and your camcorder
is recording at one third film rate (ie 8 fps), at what rate (rotations/sec) does the
tire rotate in your video recording
If you use an NTSC camera with 30 fps, what is the maximum speed that the car
can go at so that you see no aliasing in the recording.
Programming Part (100 points)This assignment will help you gain a practical understanding of Spatial/TemporalSampling and Filtering in terms of how these processes affect visual media types likeimages and video. First, you need to know how to display images in the RGB format. Wehave provided starter code to read and display an image in three ways – a cross platformC++ visual studio code project, a windows Microsoft Visual Studio C++ project andcross platform java project. You are free to start with any one of your choice, a githubpointer for these will be posted along with this assignment section. Since the intent of theassignments is for students to understand and implement details, we have a policy of notmaking use of programming environments that support libraries (such matlab, python,javascript etc.). Use of external libraries, including APIs that make the algorithmicimplementation details a simple library function call are not allowed.Your task is to start with an input image of size 512x512 and generate a video which willbe rotating and zooming either into the image or out of the image. But the display size ofyour output will be just 512x512 while the content will change depending on thefollowing four parameters as explained below: The first parameter is the name of the image, which will be provided in an 8 bitper channel RGB format (Total 24 bits per pixel). You may assume that allimages will be of the same size for this assignment of size 512 x 512. The .rgb fileformat stores the image in a particular order – first comes the red channel in scanline order, followed by the green and blue channels. Please refer to the referencecode if needed. The second parameter will be a Zoom speed value indicating how fast you arezooming in. This will give a zoom factor per second as a floating-point number,operates uniformly on width and height. Typical values may be.o 1.0 indicating no zoom per second.o 1.25 indicating zooming into the image at 1.25 magnification per second.o 0.5 indicating the image is reducing in size to 0.5 of the original persecond. The third parameter will be a Rotation speed value in degrees per second. Thiswill control by how much the image is rotating as the video zoom in (or out). It isa floating-point value which may be 0 (no rotation), positive (clockwise rotation)or negative (anti clockwise rotation). Typical values may be:o 0 indicating no rotation while zooming in (or out).o 15 indicating 15 degrees of clockwise rotation per second.o -25 indicating 25 degrees of anti-clockwise rotation second. The fourth parameter will be Frames per second to display your video. This willbe an integer value.Expectations and Examples:All parameters will have reasonable values. You should expect the following:1. 0.50 < Z < 2.002. -180.00 < R < 180.003. 1 < F < 30Some things to note regarding your implementation output: We don’t expect to have an “end” state to your video, which means the output isgenerated and displayed successively until your program is terminated. If rotatingand zooming out, we expect the content to get smaller and smaller until it maps toa single center pixel or disappears. If rotating and zooming in, we expect thecontent to get bigger and bigger until you just see one big pixel. We expect your output frames to be anti-aliased using simple averaging filters.This mostly applies to resampled cases while zooming out and resolutions getsmaller. When zooming in or out, you may have “empty” or “undefined” areas in frameswhere the original square image does not have a mapped definition. You mayinitialize these areas to all black or all white. See image examples below.To invoke your program, we will compile it and run it at the command line asYourProgram.exe C:/myDir/myImage.rgb Z R Fwhere Z R F are the parameters as described above. Example invocations and theirexpected outputs are explained below which should give you a fair idea about what yourinput parameters do and how your program will be tested.1. YourProgram.exe C:/myDir/myImage.rgb 1.0 0.0 30Here the video will be formed with a zoom speed of 1.0 (no zoom), rotation speed of 0degrees/second (no rotation) and displaying at 30 fps. Essentially you will see a videowith an unchanging image.2. YourProgram.exe C:/myDir/myImage.rgb 1.25 30.0 1Here the video will be formed with a zoom speed of 1.25 per second, rotation speed of30.0 degrees per second and displaying at 1 fps. Essentially you will see a video wherethe image is updating every second, each time rotated by 30 degrees clockwise andmagnified by 1.25 of the original. , an example of the first three frames is given below,rest will continue in the same pattern.
咨询 Alpha 小助手,获取更多课业帮助