1 / 21

Computer Graphics

Computer Graphics. Exercise 1 Halftoning and Color Transfer Due date: 20.11.05. Part 1. Halftoning. General Description. The purpose of this part of the exercise is to generate half tone images with two techniques: i. Ordered Dithering. ii. Error Distribution. . Original Image.

lauren
Télécharger la présentation

Computer Graphics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Graphics Exercise 1 Halftoning and Color Transfer Due date: 20.11.05

  2. Part 1 Halftoning

  3. General Description The purpose of this part of the exercise is to generate half tone images with two techniques: i. Ordered Dithering. ii. Error Distribution.

  4. Original Image

  5. Ordered Dithering

  6. Error Diffusion Propagate the error to the Four surrounding neighbours

  7. Program Usage The program should be named “halftoning.exe”. The programs gets from the command lineTWO parameters: • Option –d or –e • Input filename

  8. Program Usage The program generates one output image • dither_<input_name> (-d option) • errdiff_<input_name> (-e option)

  9. Part 2 Color Transfer

  10. General Description • The purpose of this part is to implement a simple algorithm that transfers the colors of one image onto another image.

  11. Example Colors Result:

  12. The algorithm • You will find an affine mapping (Matrix + translation) between the color spaces of the two images. • For every pixel i of the first image, you take its color pi = (ri, gi, bi), and apply the mapping M. • You obtain the new color for pixel i:

  13. B B G G R R In detail How to find a good mapping?

  14. B B G G R R Mapping by PCA • Find the axes by PCA • Compute the oriented bounding boxes • Define M as the affine mapping between those boxes!

  15. Program Usage The program should be named “ColorTransfer.exe”. The programs gets from the command lineTWO parameters: • First input filename (the one to map the colors onto) • Second input filename (the one to take the colors from)

  16. Program Usage The program generates one output image res_<input_name_1>

  17. General Guidelines

  18. Important Remarks • You should write the programs in C or C++. • Document your program thoroughly. • In this assignment there is no need to open a window or use OpenGL in any way.

  19. Important Remarks • The work can be done in pairs. • Submit your work on diskettes (or CD’s). Hardcopy of the documentation. • Points will be rewarded for nice and original images.

  20. More Important Remarks • Don't forget to check the number of parameters that your program receives. • Don't forget to check memory allocations, if they succeeded or failed. • Pay attention to the difference between bytes, int’s and float’s (Rounding error). • Pay attention to the borders of the image.

  21. A Little Help • IrfanView – An image viewer, editor. • FreeImage – A open source library for working with images. • NewMat10 – matrix and linear algebra library • See the links on the exercise webpage

More Related