DIP Lec1
DIP Lec1
LECTURE # 1
INTRODUCTION
ü Email: [email protected]
ü Website: http://fms.uettaxila.edu.pk/Profile/ali.javed
ü Contact No: +92-51-9047747
ü Office hours:
n Monday, 11:00 - 12:00
q http://www.mathworks.com/index.html
q http://opencv.willowgarage.com/wiki/
q http://sourceforge.net/projects/opencvlibrary/
q Grading
P Mid Exam - 30%
P Final Exam - 50%
P Quiz - 10 %
P Assignment -6%
P Class Participation -4%
P Term Project - will be counted in lab marks
q Quiz- 4 quizzes
P 2 before mid exam
P 2 after mid exam
q Assignment- 4 assignments
P 2 before mid exam
P 2 after mid exam
3. devise and evaluate algorithms for real-time problem solving using tools
like MATLAB and MS Visual Studio with OpenCV by conducting
independent/ group study.
C4 2 3
2. analyze and design various
transformation functions/filters for
image enhancement, compression,
morphology for binary, grayscale and C5, 3 3
color images. A2
q When x,y and the amplitude values of f are all finite, discrete quantities, we call
the image a Digital Image.
q These elements are referred to as Picture Elements, Image Elements, Pels or Pixels.
q Pixels are normally arranged in a regular 2-dimensional grid, and are often
represented using dots or squares
q The intensity of each pixel is variable; in grayscale images we have one color value
while in color systems, each pixel has typically three or four components such as red,
green, and blue, or cyan, magenta, yellow, and black
q Image Processing deals with algorithms that transform an input image into a
new image (processed image)
q DIP is the field of processing digital images by means of a digital computer
q Binary Image
ü 1 Sample per point
q Color Image
ü 3 or 4 Samples per point
q It can be considered as a matrix whose row column indices specify a point in the
image and the element value identifies the gray level value at that point
q A digital video consists of frames that are presented to the viewer's eye in rapid succession to
create the impression of movement.
q Each frame within a digital video can be uniquely identified by its frame index, a serial
number.
q A shot is a sequence of frames shot uninterruptedly by one camera. In the context of shot
transition detection they are usually group into two types:
ü Abrupt Transitions
ü Gradual Transitions
q Abrupt Transitions (Cuts) - This is a sudden transition from one shot to another, i. e.
one frame belongs to the first shot, the next frame belongs to the second shot. They
are also known as hard cuts or simply cuts.
q Gradual Transitions - In this kind of transitions the two shots are combined using
chromatic, spatial or spatial-chromatic effects which gradually replace one shot by
another. These are also often known as soft transitions and can be of various types,
e.g., wipes, dissolves, fades...
q The magic of Tele-Vision (Greek word, Tele means far away, vision is for sight)
ü Our vision capability is extended in space. You don’t need to travel to liberty
island NY to watch statue of liberty
q Acquisition
ü Digital cameras, scanners
ü Infrared and microwave imaging etc
q Transmission
ü Internet, satellite and wireless communication
q Storage
ü CD/DVD, Blu-ray
ü Flash memory
q Display
ü CRT monitors, LCD monitor, LED Monitors
ü PDAs, smart phones, smart watches
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Representation
Image
&
Acquisition Description
Object
Problem Domain Recognition
Color Image Image
Processing Compression
Dr. Ali Javed
Key Stages in Digital Image Processing
28
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Representation
Image
&
Acquisition Description
q The first stage of any vision system is the image acquisition stage.
¨ An image is captured by a sensor (such as a monochrome or color TV
camera) & digitized
¨ If the output of the camera or sensor is not already in digital form, an ADC
converter digitizes it
q Images are processed after acquisition.
q However, if the image has not been acquired satisfactorily then the intended
tasks may not be achievable
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Representation
&
Acquisition
Description
q The aim of image enhancement is to improve the perception of information in images for
human viewers, or to provide better input for other automated image processing
techniques.
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Representation
Image
&
Acquisition Description
q Image enhancement : process image to emphasize features of the image that make the image
more pleasing to the observer or to process image so that the result is more suitable for a
specific application, is largely a subjective process.
q Image restoration : recover image from distortions to its original image, is largely an objective
process.
q Image enhancement is the improvement of digital image quality without knowledge about the
source of degradation. If the source of degradation is known, one calls the process image
restoration
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Object
Acquisition Recognition
Representation
Problem Domain &
Description
Color
ColorImage
Image Image
Processing
Processing Compression
Dr. Ali Javed
Morphological Image Processing
37
q Deals with Tools for extracting image components that are useful in the
representation & description of shape
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Representation
Image
&
Acquisition Description
Object
Problem Domain
Recognition
Color Image Image
Processing Compression
Dr. Ali Javed
Image Segmentation
39
q Image Segmentation algorithms generally are based on one of two basic properties
of intensity values:: Discontinuity and Similarity
q Through Similarity the approach is based on partitioning an image into regions that
are similar according to a set of predefined criteria. Thresholding, region growing,
region splitting and merging are examples of methods in this category
q Region growing
5 6 6 7 7 7 6 6
6 7 6 7 5 5 4 7
q Selection of seed point, lets select 6 6 6 4 4 3 2 5 6
q Select the threshold, lets select t<3 5 4 5 4 2 3 4 6
0 3 2 3 3 2 4 7
0 0 0 0 2 2 5 6
1 1 0 1 0 3 4 4
q Region splitting and merging 1 0 1 0 2 3 5 4
q Split the image, e.g. in four quadrants
q Select any region, and take a difference between the maximum and minimum value in the region
q Compare the difference against the selected threshold, e.g. t<=3
q If the difference is within the threshold, then don’t split the region further else split the region again
into four quadrants
q Once further split is not possible then we start merging. Here we consider adjacent regions.
q Take the maximum of one region and minimum of second region and compare the difference
against the threshold. Repeat this by picking the minimum of first and maximum of second region.
If both meets the threshold criteria then we can merge the two selected regions.
Dr. Ali Javed
Image Segmentation
43
q Can you identify the difference between these two? Both the images are using image
segmentation to identify and locate the people present.
q In image 1, every pixel belongs to a particular class (either background or person).
Also, all the pixels belonging to a particular class are represented by the same color
(background as black and person as pink). This is an example of semantic
segmentation
q Image 2 has also assigned a particular class to each pixel of the image. However,
different objects of the same class have different colors (Person 1 as red, Person 2
as green, background as black, etc.). This is an example of instance segmentation.
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain
Recognition
Color Image Image
Processing Compression
Dr. Ali Javed
Representation and Description
45
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Representation
Image
&
Acquisition Description
q Recognition is the process that assigns a label to an object based on its descriptors
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Representation
Image
&
Acquisition Description
q The reduction in file size allows more images to be stored in a given amount of disk
or memory space. It also reduces the time required for images to be sent over the
Internet or downloaded from Web pages.
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Representation
Image &
Acquisition Description
Object
Problem Domain
Recognition
Color Image Image
Processing Compression
Dr. Ali Javed
53 Image Processing Components
q Storage Media
q Processing Systems
q Displays [5]
q Communication Media
q Frame Grabber
q Lens
q Pixel count
ü Front Illumination
ü Back Illumination
Dr. Ali Javed
Camera Lens
56
q The function of the lens in the camera is to direct the light source to the camera
sensor to help focusing the image.
q The main difference of the different lens brands will be the coating that they use.
q Different lens coating will give varying results from sharpness to color
reproduction.
q Camera filters alter the properties of light entering the camera lens for the purpose of
improving the image being recorded.
q The filter can be a square or oblong shape mounted in a holder accessory, or, more commonly,
a glass or plastic disk with a metal or plastic ring frame, which can be placed in front of the
lens
q Filters can affect contrast, sharpness, color, and light intensity, either individually, or in various
combinations.
q The negative aspects of using filters, though often negligible, include the possibility of loss of
image definition if using dirty or scratched filters
q For example, a camera that is 2.1 gross/2.0 effective means that the
CCD is comprised of a total of 2.1 million pixels, but the image it captures is
actually using only 2.0 million pixels to create the photo.
q Optical Zoom
ü Optical zoom is when the lens actually moves in and out and gets you
closer to the object. An optical zoom is a “real zoom”.
q Digital Zoom
q PC based
ü General purpose PCs
ü Servers
ü Industrial PCs
q A component of a computer vision system, in which video frames are captured in digital form and
then displayed, stored or transmitted in raw or compressed digital form.
q Early frame grabbers had only enough memory to acquire (i.e., "grab") and store a single
digitized video frame
q Modern frame grabbers are typically able to store multiple frames and compress the frames in
real time using algorithms such as MPEG2 & JPEG
§ Frame grabbers that perform compression on the video frames are referred to as Active Frame Grabbers.
§ Frame grabbers that simply capture the raw video data are referred to as Passive Frame Grabbers.