L. Akshay Masare Piyush Awasthi IMAGE PROCESSING AND OPENCV.

Slides:



Advertisements
Similar presentations
Image Processing … computing with and about data, … where "data" includes the values and relative locations of the colors that make up an image.
Advertisements

 2000 Prentice Hall, Inc. All rights reserved Fundamentals of Strings and Characters String declarations –Declare as a character array or a variable.
Chapter Eleven Digital Darkroom Expert Techniques.
Computer Science 111 Fundamentals of Programming I More Digital Image Processing.
Backgrounds. Background 1 File – New – 300x300, True Color, White background Adjust -> Add/Remove Noise -> Add Noise (Random, 100%)
The Binary Numbering Systems
Gavin S Page OpenCV Tutorial Part II Loading Images and Using Histograms 29 November 2005.
DIGITAL IMAGE PROCESSING CMSC 150: Lecture 14. Conventional Cameras  Entirely chemical and mechanical processes  Film: records a chemical record of.
By Rishabh Maheshwari. Objective of today’s lecture Play Angry Birds in 3D.
Bit Depth and Spatial Resolution SIMG-201 Survey of Imaging Science © 2002 CIS/RIT.
Lecture 5 Sept 10 Goals: 2-d arrays Image representation Image processing examples Stack data structure.
Gavin S Page OpenCV Tutorial Part IV A Brief Guide to Memory Management (and other Miscellaneous Functions) 02 December 2005.
Graphics File Formats. 2 Graphics Data n Vector data –Lines –Polygons –Curves n Bitmap data –Array of pixels –Numerical values corresponding to gray-
R-1 University of Washington Computer Programming I Lecture 17: Multidimensional Arrays © 2000 UW CSE.
Images and colour Colour - colours - colour spaces - colour models Raster data - image representations - single and multi-band (multi-channel) images -
Image representation methods. Bitmap graphic method of a black-and-white image.
Images  Camera models  Digital images  Colour images  Noise  Smoothing Images Based on A Practical Introduction to Computer Vision with OpenCV by.
Graphics in the web Digital Media: Communication and Design
Introduction to OpenCV
Bitmapped Images 27 th November 2014 With Mrs
L.
Bitmapped Images. Bitmap Images Today’s Objectives Identify characteristics of bitmap images Resolution, bit depth, color mode, pixels Determine the most.
CSC – Java Programming II Lecture 9 January 30, 2002.
OpenCV Open source C omputer V ision library By: Bahare Torkaman Fall 2010.
Basics of a Computer Graphics System Introduction to Computer Graphics CSE 470/598 Arizona State University Dianne Hansford.
© GCSE Computing Candidates should be able to:  explain the representation of an image as a series of pixels represented in binary  explain the need.
Detect Candle.  Open VC++ Directories configuration: Tools > Options > Projects and Solutions > VC++ Directories  Choose "Show directories for: Include.
ECE291 Computer Engineering II Lecture 9 Josh Potts University of Illinois at Urbana- Champaign.
Images Data Representation. Objectives  Understand the terms bitmap & pixel  Understand how bitmap images are stored using binary in a computer system.
Multimedia Programming 03: Point Processing Departments of Digital Contents Sang Il Park.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 5 Working with Images Starting Out with Games & Graphics in.
Introduction of OpenCV Alireza Shirani Researcher of Medical Image and Signal Processing M. S Electrical Engineering yahoo. com Spring.
Agenda Last class: Memory, Digitizing Numbers Today: Digitizing: Text
Introduction to Image processing using processing.
W2D1. HSV colour model Source: Primary colours Red Green Blue Secondary Cyan Magenta.
Vision Geza Kovacs Maslab Colorspaces RGB: red, green, and blue components HSV: hue, saturation, and value Your color-detection code will be more.
Object Oriented Programming Dr. Ennis-Cole CECS 5100.
Ch 6 Color Image processing CS446 Instructor: Nada ALZaben.
` Tracking the Eyes using a Webcam Presented by: Kwesi Ackon Kwesi Ackon Supervisor: Mr. J. Connan.
Color Web Design Professor Frank. Color Displays Based on cathode ray tubes (CRTs) or back- lighted flat-screen Monitors transmit light - displays use.
COMPUTER GRAPHICS. Can refer to the number of pixels in a bitmapped image Can refer to the number of pixels in a bitmapped image The amount of space it.
1 ENGI 2420 Structured Programming (Lab Tutorial 8) Memorial University of Newfoundland.
CS 101 – Sept. 14 Review Huffman code Image representation –B/W and color schemes –File size issues.
Intelligent Robotics Today: Vision & Time & Space Complexity.
F28HS2 Hardware-Software Interface Lecture 6 - Programming in C 6.
Lecture 11 Text mode video
More Digital Representation Discrete information is represented in binary (PandA), and “continuous” information is made discrete.
Representation of image data
Representing images.
EEC-693/793 Applied Computer Vision with Depth Cameras
Processing the image with Python
Images In Matlab.
Reading Netpbm Images.
Computer Programming Methodology Files and Colors
DIP 9 65 Original 210 Eye Zoomed.
Backgrounds.
ورشة عمل : لنفبرك معاً! تقديم : مها عبوش.
Data Representation.
Representing Images 2.6 – Data Representation.
What do these words mean to you?
Nuts and Bolts of Digital Imaging
EEC-693/793 Applied Computer Vision with Depth Cameras
Digital Image Processing
Basic Concepts of Digital Imaging
EEC-693/793 Applied Computer Vision with Depth Cameras

Tracking the Eyes using a Webcam
EEC-693/793 Applied Computer Vision with Depth Cameras
Year 8 Unit 2 Bitmap Graphics
Presentation transcript:

l

Akshay Masare Piyush Awasthi IMAGE PROCESSING AND OPENCV

WHAT IS IMAGE PROCESSING? IMAGE PROCESSING = IMAGE + PROCESSING

WHAT IS IMAGE? IMAGE = Made up of PIXELS. Each Pixels is like an array of Numbers. Numbers determine colour of Pixel. TYPES OF IMAGES : 1.BINARY IMAGE 2.GREYSCALE IMAGE 3.COLOURED IMAGE

BINARY IMAGE Each Pixel has either 1 (White) or 0 (Black) Depth =1 (bit) Number of Channels = 1

GRAYSCALE Each Pixel has a value from 0 to : black and 1 : White Between 0 and 255 are shades of b&w. Depth=8 (bits) Number of Channels =1

GRAYSCALE IMAGE

RGB IMAGE Each Pixel stores 3 values :- R : G: B : Depth=8 (bits) Number of Channels = 3

RGB IMAGE

HSV IMAGE Each pixel stores 3 values. In OpenCV H ( hue ) : S (saturation) : V (value): Depth = 8 (bits) Number of Channels = 3 Note : Hue in general is from 0-360, but as hue is 8 bits in OpenCV, it is shrinked to 180

OPENCV

IMAGE POINTER OR OBJECT An image is stored as a structure IplImage with following elements :- int height int width int nChannels int depth char *imageData int widthStep ….. So on In the newer version there is an object named Mat with similar elements.

imageData An image’s data is stored as a character array whose first element is pointed by :- Input->imageData ( char pointer ) widthStep Number of array elements in 1 row is stored in :- input->widthStep

IMAGE POINTER Initialising pointer to a image (structure) :- IplImage* input Mat input Load image to the pointer [0=gray;1=colored] input=cvLoadImage("apple.jpg",1) input=imread(“apple.jpg”,1) Note :The image apple.jpg must be in same folder where you save your C program

cvNamedWindow("ii",1) Creates a window named ii 1 = Coloured0 = Grayscale namedWindow(“ii”, 1)

Shows image pointed by input, in the window named ii imshow(“ii”,input)

If 0 or negative number is given as input:- Waits indefinitely till key press and returns the ASCII value of the key pressed If positive number is given as input :- Waits for corresponding milliseconds.

CREATE AN IMAGE To create an image you need to specify its :- Size ( height and width) Depth Number of Channels output=cvCreateImage(cvGetSize(input),IPL_DEPTH_8U,3) Mat output(2,2,CV_8UC3,Scalar(0,0,255));

TAKING IMAGE FROM CAMERA CvCapture *capture=cvCreateCameraCapture(0); for(int i=0;i< ;i++); if(capture!=NULL) IplImage *frame=cvQueryFrame(capture); Note : Here for loop is used to compensate time of initialization of camera in Windows

CommandFunction cvDestroyWindow("ii")Destroys window named ii cvReleaseImage( &input )Releases image pointer input from memory output=cvCloneImage(input) input.copyTo(output) Copies image from input to output cvSaveImage("output.jpg",output) Imwrite(“output.jpg”,output) Saves image pointed by output naming it output

CONVERTING COLOR SPACES cvCvtColor( input, output, conversion type) cvtColor(input,output, code, 0) Conv. type : CV_BGR2GRAY,CV_BGR2HSV Saves input image in output pointer in other color space

ACCESSING (I,J) PIXEL OF AN IMAGE Grayscale uchar *pinput = (uchar*)input->imageData; int c = pinput[i*input->widthStep + j]; Scalar intensity=img.at (y,x); i (0,0 ) (i,j) j

3 CHANNEL IMAGE (BGR):- uchar *pinput = (uchar*)input->imageData; int b= pinput[i*input->widthStep + j*input->nChannels+0]; int g= pinput[i*input->widthStep + j*input->nChannels+1]; int r= pinput[i*input->widthStep + j*input->nChannels+2]; i (0,0) B G R (i,j) j

3 CHANNEL IMAGE (BGR):- Vec3b intensity=img.at (y,x); Uchar blue = intensity.val[0]; Uchar green = intensity.val[1]; Uchar red = intensity.val[2];

Threshhold types:- CV_THRESH_BINARY max value if more than threshold, else 0 CV_THRESH_BINARY_INV 0 if more than threshold, else max value CV_THRESH_TRUNC threshold if more than threshold,else no change CV_THRESH_TOZERO no change if more than threshold else 0 CV_THRESH_TOZERO_INV 0 if more than threshold, else no change cvThreshold(input, output, threshold, maxValue, thresholdType)

SMOOTHING IMAGES Image smoothing is used to reduce the the sharpness of edges and detail in an image. OpenCV includes most of the commonly used methods. void GaussianBlur(imagein, imageout, Size ksize,sig); void blur (imagein, imageout, Size ksize);

IMAGE MORPHOLOGY cvDilate(input, output, NULL, iterations) Dilate(input, output, element, anchor, iterations, border type, border value) Dilates an image for given number of iterations and saves it in output cvErode(input,erode,NULL,iterations); Note:here NULL is a structural element Erodes an image for given number of iterations and saves it in output

EFFECTS OF ERODE AND DILATE

LAPLACE OPERATOR

QUESTIONS

THANK YOU