0% found this document useful (0 votes)
12 views4 pages

Fall2024 Assignment1

CS 576 Assignment 1, assigned on September 9, 2024, requires students to submit solutions by September 30, 2024, with a strict late policy. The assignment includes theoretical questions on video and audio processing, as well as a programming task focused on image resampling and filtering techniques. Students must submit source code, a README file, and a PDF report detailing their methods and results for evaluation.

Uploaded by

Ha Moondancer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views4 pages

Fall2024 Assignment1

CS 576 Assignment 1, assigned on September 9, 2024, requires students to submit solutions by September 30, 2024, with a strict late policy. The assignment includes theoretical questions on video and audio processing, as well as a programming task focused on image resampling and filtering techniques. Students must submit source code, a README file, and a PDF report detailing their methods and results for evaluation.

Uploaded by

Ha Moondancer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

CS 576 – Assignment 1

Instructor: Parag Havaldar

Assigned on Monday Sept 9th, 2024.


Solutions due on Monday Sept 30th, 2024, evening 5 pm
Late Policy: None. Any assignment submitted after 5 pm will not be graded. If multiple
assignments are submitted, the last one before the deadline will be graded.

PART 1: Theory Questions for practice (No need to submit answers,


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, re-
quantize 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 (150 points)
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. We have
also provided a Microsoft Visual C++ project and java to display images. This source has
been provided as a reference for students who may not know how to read and display
images. You are free to use this as a start, or write your own in any language of your
choice (no matlab please!), as long as your program can be easily evaluated on our UCS
computer systems.

You will take a 4:3 aspect ratio image as input, which will have a high-resolution image
(4000x3000) or a low-resolution image (400x300). Your program will generate an output
image which will be one of the following standard output formats
 O1: 1920x1080
 O2: 1280x720
 O3: 640x480
In each case, depending on your input size, you will need to either down sample or up
sample the image. Furthermore, these two methods to choose your sample value.
 In the down sample case, use
1. Specific sampling where you choose one specific pixel
2. Average (or Gaussian) smoothing where you choose the average of a set
of samples. This option will reduce aliasing effects
 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 (could be 4000 or 400).
 Height (int) – height of the image in pixels (could be 3000 or 300).
 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 4000x3000 and
down sample it to 1280x720 and use specific/random sampling to decide each pixel value
in the output.
YourProgram.exe C:/myDir/myImage.rgb 400 300 2 O1

The expectation here is that your program will read the image of size 400x300 and
up sample it to 1920x1080 and use a bilinear/cubic interpolation scheme to decide pixel
values

Additional discussion points to submit: (70 points – 30 + 10 + 30)


1. Pixel Aspect Ratio (PAR) changes while down sampling – When down
sampling a high-resolution image with aspect ratio 4:3 to a O1 or O2, the
resulting change in pixel aspect will cause pixel stretching artifacts which are
undesired effects. One standard way is letter boxing where screen real estate is
compromised to keep aspects the same, but this is not ideal. Another smart way is
to maintain pixels at the center of the image (where the attention is focused)
without any stretching and increase the stretching nonlinearly towards the
periphery (where attention is not in focus). Implement such a method showing
your outputs. You do not need to submit any code here, but please attach outputs
of your method on the given high res to 01 and 02 conversions with an
explanation of your method.
2. Seam Carving as a solution – As shown in class, seam carving is another
smarter way to resize your image that takes the content of the image into account.
Read the paper uploaded to the lecture site (ResearchReading-SeamCarving.pdf).
Download the code to perform scene carving (http://code.google.com/p/seam-
carving-gui/), compile it and run it on the images given to you and attach them in
your submission. Since this is an exploration, there are also several python-based
repos that you are welcome to use on github.. Comment on the results – the pros
and especially the cons. Where do you think the method performs well or does not
perform well? Please attach outputs on a few of the given images in the uploaded
dataset.
3. Up sampling image quality – Up sampling to increase resolution often leads to
worse outputs. This should be no surprise because you are beginning with less
samples and create new samples based on the original ones. There is no new
information as such. Research and implement ways to improve the quality of up
sampled images to give examples of better results on the input images. Hint - you
may find it useful pointers by googling “Super - resolution from a single image”.
You do not need to submit any code here, but please attach outputs of your
method(s) on the given high res and low-res images and explanations of your
method.

What should you submit?


Your submission should have three parts:
 Source code of your program, along with any project files or makefiles necessary
to compile. We will compile your program and execute our tests accordingly.
Please do not submit any binaries or images since they take a lot of space. Doing
so, will adversely penalize your Grade.
 An optional README file if needed, if you need provide special instructions to
compile your project
 A PDF file describing your explanations, algorithms and experimental outputs for
the discussion points. Please include your name and USC ID in your submission.

Evaluation:
We will run tests to evaluate your resampled outputs for 80 points. Marks will be
deducted for incorrect outputs. The discussion analysis has 70 points (30+10+30). We
expect thorough analysis including clear explanations & experimentation with example
outputs. The total evaluation score will be 150.

You might also like