Numbers in Images GCNU 1025 Numbers Save the Day

Preview:

Citation preview

Numbers in Images

GCNU 1025Numbers Save the Day

Announcement

• In-class Assignment #3 on Nov 21 (Friday)• Coverage: Chapter 3 “Numbers on the Internet”• 10% of final score• Books, notes, other materials and discussions all allowed• Help from instructor and teaching assistant• Assignments submitted after class subject to penalty

Image storage in computers

• Pixel: small coloured point (smallest component of image)• Colour represented by number: one digital value for each pixel

• How many different possible colours are there?• How many bits are used to represent each colour?

Image storage in computers

• Pixel: small coloured point (smallest component of image)• Colour represented by number: one digital value for each pixel

• How many different possible colours are there?• Colour palette: a list of available colours

• How many bits are used to represent each colour?• Example: RGB models

• Encoding colour by mixing red (R), green (G) and blue (B)

Image storage in computers

• Pixel: small coloured point (smallest component of image)• Colour represented by number: one digital value for each pixel

• How many bits are used to represent each colour?• Example: RGB model (colour-depth: 8-bit)

• Red/Green (3 bits each): from 0 to 7• 0: least intense• 7: most intense

• Blue (2 bits): from 0 to 3• 0: least intense• 3: most intense

• Total: 256 colours

Image storage in computers

• Pixel: small coloured point (smallest component of image)• Colour represented by number: one digital value for each pixel

• How many bits are used to represent each colour?• Example: RGB model (colour-depth: 24-bit)

• Red/Green/Blue (8 bits each): from 0 to 255• 0: least intense• 255: most intense

• Total: more than 10M colours

Image storage in computers

• Pixel: small coloured point (smallest component of image)• Colour represented by number: one digital value for each pixel

• How many bits are used to represent each colour?• Example: RGB model (colour-depth: 24-bit)

• Red/Green/Blue (8 bits each): from 0 to 255• 0: least intense• 255: most intense

• Total: more than 10M colours

Image storage in computers

• Pixel: small coloured point (smallest component of image)• Colour represented by number: one digital value for each pixel

• How many bits are used to represent each colour?• Example: RGB model (colour-depth: 24-bit)

• Red/Green/Blue (8 bits each): from 0 to 255• 0: least intense• 255: most intense

• Total: more than 10M colours

Resolution and file size

• Resolution: number of pixels in image• Expressed as dimension ()

• Example:

• Display resolution: number of pixels on the screen• Expression as dimension ()

• Example:

Resolution and file size

• Resolution: number of pixels in image• Expressed as dimension ()

• Example: • Higher resolution:

• More details can be shown• Larger file size (given same colour-depth)

Image file format

• File format: method of storage• Image compression: lossless/lossy

Image file format

• File format: method of storage• Image compression: lossless/lossy

Image processing

• Image formed by a rectangle of pixels• Matrix: table with rows and columns of numbers• Image represented by matrix • Example: matrix representing an image

• Resolution of image: • Size of matrix:

Image processing

• Manipulation of image (image processing): operation on matrix representing the image• 3-bit grey scale examples (0-7) used in this course

• Major types of actions:• Reduction of image• Rotation of image• Cropping of image• Darkening/brightening of image• Inversion of image• Blurring of image• Enlargement of image• Morphing of images• Addition/removal of objects in image

Image processing

• Reduction of image by half

Image processing

• Reduction of image by half• Average taken for each partition• Example: (resolution) reduced to (resolution)

Image processing

• Reduction of image by half• Average taken for each partition• Example: (resolution) reduced to (resolution)

Image processing

• Rotation by 90 degrees• Simple rotation of matrix

Image processing

• Cropping of image• Deletion of corresponding part of matrix

Image processing

• Darkening of image• Multiplication by weight factor (smaller than 1)

Image processing

• Darkening of image• Multiplication by weight factor (smaller than 1)• Example: darkening by a factor of 0.8

• Rounding off needed

Image processing

• Brightening of image• Multiplication by weight factor (bigger than 1) wouldn't work as some

entries might exceed 7• Alternative method: assign new value to an entry for some factor smaller

than 1• Example: Brightening with a factor of 0.8

• Replacement of each entry by • Rounding off needed• Smaller factor used instead of 0.8 for brighter image

Image processing

• Inversion of image• Replacement of each entry by 𝑥

Image processing

• Blurring of image• Averaging neighbourhood of each entry

Image processing

• Enlargement of image• Step 1: determine size of new matrix • Step 2: duplicate existing entries• Step 3: blurring • Example: doubling linear size

• Step 1: (matrix size) enlarged to (matrix size)• Step 2: duplication

Image processing

• Enlargement of image• Step 1: determine size of new matrix • Step 2: duplicate existing entries• Step 3: blurring • Example: doubling linear size

• Step 3: blurring

Image processing

• Morphing of images• Matching the corresponding entries of the matrices and adjusting the

weighting• Example: morphing of lion and tiger

• Matching eyes of lion with eyes of tiger• Adjustment of weighting

Image processing

• Addition of objects• Application of “if…then” statements to add background• Example: replacing white background

Image processing

• Removal of objects• Series of photos needed to provide background information• Median averaging: elimination of abnormal pixels by taking median value

of corresponding pixels in the images

Numbers in Images

-End-

Recommended