Interactive Computer Graphics: A Top-Down Approach Using OpenGL (4th Edition)

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CS/ECE 433 Introduction to Computer Graphics, Fall 2007 Homework 1 Due Sunday, September 23, 2007 at 11:59pm In this homework, you will get your hands dirty with 2D raster graphics, like we have been talking about in class. 1. Bilinear Resampling (30 pts) You have been hired at Adobe to work on the new version of Photoshop. They want a complete re-write of their codebase, and you have been assigned the task of writing the new bilinear resampling for scaling images. This is the algorithm that will run on an image when the user selects “Image->ImageSize” and changes the size of an image using bilinear resampling. You are to write a C or C++ program called LinearResample.exe that takes in an image in various possible formats and outputs it at a different size by using bilinear resampling. The executable should take in the following arguments: LinearResample.exe <input> <new width> <new height> <output> Where <input> and <output> are the input and output images, respectively. The output image should have the resolution given by <new width> x <new height> and the images could be in the jpg, tif, or bmp formats as specified by their extension. So for example, I would run the following to scale my test1.tif image into a 50 x 25 image which is saved as out.tif: LinearResample.exe test1.tif 50 25 out.tif Remember, the output image can be bigger or smaller than the original. The user can also change the aspect ratio. For example, one dimension can be increased while the other is decreased (see the examples below). Your program should produce an output that is visually comparable to that of using the bilinear resampling filter in Photoshop. To help you get started, I provide you with a Visual Studio solution file called ImageProc which reads in and image and saves it back out as a different filename. This code uses the Windows CImage class to read and write image, but feel free to write your own if you want (although writing a function to read/write jpegs is probably not a valuable use of your time). You can also use any standard image I/O library if there is another you prefer
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
or if you want to do your coding on something other than Windows. Just make sure that your final submission compiles and runs on the Windows machines in the lab, so please test it there before you submit and include any of the libraries or dll’s you need. Also please note in the comments any code you borrow. You are not to use someone else’s code to do the actual filtering. In terms of the filtering, remember that you can use different convolution kernels for upsampling and downsampling of the image.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern