Two-week ISTE workshop on Effective teaching/learning of computer programming Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal.

Slides:



Advertisements
Similar presentations
Pixels and Digital Images Yrd. Doc. Dr. Ahmet Sayar Kocaeli Universitesi Bilgisayar Muhendisligi Ileri Bilgisayar Grafikleri.
Advertisements

Md. Monjur –ul-Hasan Department of Computer Science & Engineering Chittagong University of Engineering & Technology Chittagong 4349
CSE Lecture 6 – Complex Numbers & Images
CS Spring 2009 CS 414 – Multimedia Systems Design Lecture 4 – Digital Image Representation Klara Nahrstedt Spring 2009.
A Digital Imaging Primer Nick Dvoracek Instructional Resources Center University of Wisconsin Oshkosh.
Digital Imaging and Image Analysis
Histograms – Chapter 4 Continued.
Bit Depth and Spatial Resolution SIMG-201 Survey of Imaging Science © 2002 CIS/RIT.
Multimedia for the Web: Creating Digital Excitement Multimedia Element -- Graphics.
From Image Capture to Digital Output. In looking at this we shall consider the following… Quantisation. Quantisation Error. Interpolation. Viewing images.
ISYS 3074 Graphics File Formats File formats have developed with applications. At least 50 currently in use. Examples include: GIF, JPEG, TIFF, BMP, DIB,
Graphics in the web Digital Media: Communication and Design
How Images are Represented Bitmap images (Dots used to draw the image) Monochrome images 8 bit grey scale images 24 bit colour Colour lookup tables Vector.
Manipulating Images Image A visual representation of something that is seen in real life. It can be two-dimensional or three-dimensional A visual representation.
Russell Taylor Week 3. Image File Formats - TIF, JPG, PNG, GIF - which to use? The three most common and important image file formats for for printing,
Zinnia Bell. RAWimages are image files that have not yet processed, they contain minimally processed data from the image sensor of either a image scanner,
HBCU-CUL Digital Imaging Workshop, November 2005
Prepared by George Holt Digital Photography BITMAP GRAPHIC ESSENTIALS.
Department of Physics and Astronomy DIGITAL IMAGE PROCESSING
Two-week ISTE workshop on Effective teaching/learning of computer programming Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal.
Color Names All standards-compliant browsers should handle these color names These color names can be used with the CSS properties of color and background-color.
COMP Bitmapped and Vector Graphics Pages Using Qwizdom.
Image processing Second lecture. Image Image Representation We have seen that the human visual system (HVS) receives an input image as a collection of.
CS 102 Computers In Context (Multimedia)‏ 01 / 28 / 2009 Instructor: Michael Eckmann.
Module Code: CU0001NI Technical Information on Digital Images Week -2.
Lab #5-6 Follow-Up: More Python; Images Images ● A signal (e.g. sound, temperature infrared sensor reading) is a single (one- dimensional) quantity that.
TOPIC 4 INTRODUCTION TO MEDIA COMPUTATION: DIGITAL PICTURES Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach.
Image Processing & Perception Sec 9-11 Web Design.
Image Storage Bitmapped Graphics – in which an image is represented as a collection of dots Vector Graphics – in which an image is represented as a set.
Chapter 11 Fluency with Information Technology 4 th edition by Lawrence Snyder (slides by Deborah Woodall : 1.
Two-week ISTE workshop on Effective teaching/learning of computer programming Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal.
© 1999 Rochester Institute of Technology Introduction to Digital Imaging.
Two-week ISTE workshop on Effective teaching/learning of computer programming Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal.
ImageJ EE4H, M.Sc Computer Vision Dr. Mike Spann
Two-week ISTE workshop on Effective teaching/learning of computer programming Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal.
Computer Graphics Bitmaps & Sprites CO2409 Computer Graphics Week 3.
CS112 Scientific Computation Department of Computer Science Wellesley College Numb3rs Number and image types.
Graphics workshop Library and Information Services University of St Andrews.
Image Representation. Digital Cameras Scanned Film & Photographs Digitized TV Signals Computer Graphics Radar & Sonar Medical Imaging Devices (X-Ray,
Marr CollegeHigher ComputingSlide 1 Higher Computing: COMPUTER SYSTEMS Part 1: Data Representation – 6 hours.
Graphics An image is made up of tiny dots called pixels (“picture elements”) The resolution determines the.
Computer Vision Introduction to Digital Images.
Images. Digital Images Rectangular arrays of pixel data Pixel - picture element, smallest addressable part of the frame buffer. Color depth - the depth.
Digital Imaging Fundamentals Ms. Hema C.R. School of Mechatronic Engineering.
Digital Images are represented by manipulating this…
Two-week ISTE workshop on Effective teaching/learning of computer programming Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal.
Image File Formats By Dr. Rajeev Srivastava 1. Image File Formats Header and Image data. A typical image file format contains two fields namely Dr. Rajeev.
TOPIC 4 INTRODUCTION TO MEDIA COMPUTATION: DIGITAL PICTURES Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach.
Think First, Code Second Understand the problem Work out step by step procedure for solving the problem (algorithm) top down design and stepwise refinement.
HOW SCANNERS WORK A scanner is a device that uses a light source to electronically convert an image into binary data (0s and 1s). This binary data can.
Programming Fundamentals. Summary of Previous Lectures Phases of C++ Environment Data Types cin and cout.
Graphics and Image Data Representations 1. Q1 How images are represented in a computer system? 2.
Two-week ISTE workshop on Effective teaching/learning of computer programming Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal.
Two-week ISTE workshop on Effective teaching/learning of computer programming Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal.
Information Systems Design and Development Media Types Computing Science.
Unit 2.6 Data Representation Lesson 3 ‒ Images
Images Data Representation.
Data Representation Images.
Sampling, Quantization, Color Models & Indexed Color
How to Convert Pictures into Numbers
Binary 4 File Sizes.
Raster Images CPSC 1030.
"Digital Media Primer" Yue-Ling Wong, Copyright (c)2013 by Pearson Education, Inc. All rights reserved.
Image File Size and File Compression
Histogram Histogram is a graph that shows frequency of anything. Histograms usually have bars that represent frequency of occuring of data. Histogram has.
Representing Images 2.6 – Data Representation.
Nuts and Bolts of Digital Imaging
Digital Image Processing
Basic Concepts of Digital Imaging
"Digital Media Primer" Yue-Ling Wong, Copyright (c)2013 by Pearson Education, Inc. All rights reserved.
Presentation transcript:

Two-week ISTE workshop on Effective teaching/learning of computer programming Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal Rekhi Building IIT Bombay Lectures 11, Matrices -examples Saturday 3 July 2010 [Several slides courtesy Anirudha Jathar and Wikipedia]

Overview  A quiz  Handling images Representation of digital images Histogram Contrast enhancement  Example program to calculate histogram of a small digital image

A quiz Q. Currently, what activity do you propose to carry out within two weeks of the workshop conclusion, for the mandatory submission A. Design questions and answers for examinations B. Design quiz questions and answers C. Add lecture slides with examples D. Something different

Digital images  Digital images are a collection of pixel values  These are arranged in an array (W x H)  Each pixel value can be represented by 1 bit (m : mono colour, e.g. black and white) 8 bits (g : gray scale 0 – black to 255 – white) 24 bits (c: Red, Blue, Green, each one byte)  One can have 16 million colours! Capacity of a human eye is limited to a small range from 200 to 2000 colours

Digital images...  While storing information about an image in a file, we mainly need values of Width, Height, the type of colours present, and values for each pixel  Images such as black and white fingerprints have small size (500 x 300)  For large images, compression is mandatory to keep the file size within limits 12 M pixel camera can produce 36 M bytes image  Compression can be either lossy or lossless  Several file formats have evolved raw, png, bmp, tiff, giff, jpeg, xmp  Refer to wikipedia (Image_file_formats)

Images and histograms  Pixel values of digital images can be read in a matrix for further processing  Each picture point (pixel) has an associated “tonal” value For grayscale images, the value range is : Black, 255: White  Thus each element of such an image matrix would contain a value which can be of the type/size short int or char (1 byte)  Histogram indicates how many pixels in an image have the same value

A sample image 8 pixel x 8 pixel

Pixel values in the sample image

Histogram values Val n Val n Val n Val n Val n

Cumulative Distribution Function (cdf) V c V c V c V c V c

Histogram equalization  The histogram equalization formula  “Equalization” formula for example image

Histogram equalization …  For example, the cdf of 78 is 46

Pixel values after histogram equalization

Enhancement of Contrast

Original Picture for comparison

Another grayscale picture

Histogram and cdf

“Equalized” histogram and cdf

Picture with enhanced contrast

Original picture for comparison

Program to calculate histogram #include using namespace std; int main(){ int i, j, npix; int image[500][500], histogram[256]; /* we assume that the image data is contained in a text file "image.txt“ in a suitable format Also, we will use command line redirection to read data from this file */

Histogram … cin >> npix; // number of pixels //read image pixel values in the matrix for(i=0; i< npix; i++){ for(j=0; j < npix; j++){ cin >> image[i][j]; cout << image[i][j] << " "; } cout << "\n"; }

Histogram … // set histogram counts to zero // for(i=0 ; i< 256; i++) histogram[i] = 0; // Calculate histogram values for(i=0; i< npix; i++){ for (j = 0; j < npix; j++){ // based on the value of the pixel // increment the corresponding count // in the histogram array histogram[image[i][j]]++; }

Histogram … // print the histogram at non zero values cout << "Histogram at non zero values is:”; cout << "\n"; for (i=0; i<256; i++){ if (histogram[i] !=0) { cout << i << " " << histogram[i] << "\n"; }

Histogram … // find the maximum value in the histogram int imax, max = 0; for (i=0; i<256; i++){ if (histogram[i] > max) max = histogram[i]; } cout << "Maximum histogram value " << max cout << “ occurs at:” << "\n"; // Print the grey levels at which max value occurs for(i=0; i<256; i++){ if (histogram[i]== max) cout << i << " "; } return 0; }

Image of a finger print

THANK YOU

Question, From GEC Thrisur Can we return structure from the function ?

Question, From PSG Coimbatore Does C support function overloading ? Lecture 11 Examples of matrix manipulation

Question, From PSG Coimbatore Why is C, C++ generally use to design and develop an operating system ? Lecture 11 Examples of matrix manipulation

Question, From NIT, Kurukshetra What is the application of bit wise operators ? Lecture 11 Examples of matrix manipulation

Question, From GEC Thrisur What is the maximum dimension possible for a multi dimension array ? Lecture 11 Examples of matrix manipulation

Question, From GEC Thrisur Earlier Pascal was use to discuss programming methodology, later why its turn to C ? Lecture 11 Examples of matrix manipulation

Question, From PSG Coimbatore If C is not supporting function overloading mean how it is possible to use different number of scanf with different argument ? Lecture 11 Examples of matrix manipulation

Question, From NIT Kurukshetra When we declare float instruct and why scanning value, It will display floating point abnormal termination error ?

Question, From NIT Kurukshetra Is cin and cout return any value ? Lecture 11 Examples of matrix manipulation

Question, From NIT Jalandhar What are macros and why they are taking lesser time during compilation ? Lecture 11 Examples of matrix manipulation