# Computer Graphics - Get Now PowerPoint

Document Sample

```					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
Ordered Dithering
Error Diffusion
Propagate the error to the Four surrounding neighbours
Program Usage
The program should be named
“halftoning.exe”.
The programs gets from the command line
TWO parameters:
1. Option –d or –e
2.   Input filename
Program Usage
The program generates one output image
•  dither_<input_name>    (-d option)
•  errdiff_<input_name> (-e option)
Part 2
Color Transfer
General Description
 The purpose of this part is to implement a
simple algorithm that transfers the colors
of one image onto another image.
Example

Colors

Result:
The algorithm
   You will find an affine mapping (Matrix +
translation) between the color spaces of the two
images.
M (p)  Ap  t
 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:

p  M (pi )
i
In detail

B                             B

G          How to find        G
a good mapping?
R                             R
Mapping by PCA

B                               B

G                               G

R                                R

   Find the axes by PCA
   Compute the oriented bounding boxes
   Define M as the affine mapping between those boxes!
Program Usage
The program should be named
“ColorTransfer.exe”.
The programs gets from the command line
TWO parameters:
1. First input filename (the one to map the
colors onto)
2. Second input filename (the one to take
the colors from)
Program Usage
The program generates one output image

res_<input_name_1>
General Guidelines
Important Remarks
 You   should write the programs in C or
C++.
 In this assignment there is no need to
open a window or use OpenGL in any
way.
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.
More Important Remarks
 Don't  forget to check the number of
 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.
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

```
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
 views: 2 posted: 11/4/2012 language: Unknown pages: 21
How are you planning on using Docstoc?