Introduction to
Computer Vision
Shatabdi Basu, Dept of DSE
What is computer vision?
• Computer vision is a field that includes methods for
acquiring, processing, analyzing and understanding
images.
• Computer vision duplicates the abilities of human
vision by electronically perceiving and understanding
an image.
• The image data can take many forms, such as a video
sequence, depth images, views from multiple cameras,
or multi-dimensional data from a medical scanner.
Shatabdi Basu, Dept of DSE
Computer vision
• Make computers understand images and videos.
• What kind of
scene?
• Where are the
cars?
• How far is the
building?
Shatabdi Basu, Dept of DSE
Components of computer vision
system
Shatabdi Basu, Dept of DSE
Relation to other fields
Shatabdi Basu, Dept of DSE
Applications of computer vision
Shatabdi Basu, Dept of DSE
Vision is hard
• Vision is an amazing feat of natural intelligence.
• More human brain is devoted to vision than anything
else.
• Machines can't replicate human image recognition and
don't possess our ability to recognize distorted
images yet. Is that a
queen or a
bishop?
Shatabdi Basu, Dept of DSE
Computer vision vs human vision
Shatabdi Basu, Dept of DSE
Vision transforms from this..
Shatabdi Basu, Dept of DSE
To this..
Shatabdi Basu, Dept of DSE
Why is vision difficult?
Shatabdi Basu, Dept of DSE
But this…
Shatabdi Basu, Dept of DSE
Some possible outputs
Shatabdi Basu, Dept of DSE
What your brain does ?
Shatabdi Basu, Dept of DSE
What makes computer vision hard?
Shatabdi Basu, Dept of DSE
Early CV research
Shatabdi Basu, Dept of DSE
More examples of early CV research
Shatabdi Basu, Dept of DSE
Computer Vision Applications
• Optical character recognition
• Face detection
• Smile detection
• Object recognition
• Face recognition
• Biometrics
• Login without password
• Special effects
• Smart cars
Shatabdi Basu, Dept of DSE
Optical character recognition
• Converts printed or handwritten text into digital format.
• Enables automated data entry, document digitization, and text extraction
from images.
• Widely used in applications like scanning documents, reading license
plates, and processing invoices.
Shatabdi Basu, Dept of DSE
Face detection
• Identifies human faces within images or video streams.
• Fundamental for various applications including surveillance,
photo tagging, and video conferencing.
• Enhances security systems and user experience in mobile
devices and social media platforms.
Shatabdi Basu, Dept of DSE
Smile detection
• Identifies smiles in real-time from live video or still
images.
• Used in photography for capturing perfect moments and in
interactive advertising.
Shatabdi Basu, Dept of DSE
Object recognition
• The process of identifying and classifying objects within an
image or video.
• The goal is to locate and label objects in a way that mimics
human visual perception, making it possible for machines to
understand and interpret visual information.
Shatabdi Basu, Dept of DSE
Levels of Computer Vision
• The three levels of computer vision are :
• Low-Level Vision
• Mid-Level Vision
• High-Level Vision
• Each level represents a different stage in the
processing and understanding of visual information,
with increasing complexity and abstraction.
Shatabdi Basu, Dept of DSE
Low level vision
• At this level, the focus is on extracting basic
features from the visual input without understanding
the overall context or meaning.
• This stage primarily deals with pixel-level operations
and is the foundation for higher levels of processing.
• The key techniques in low-level vision are :
• Edge detection :
• Identifying boundaries and edges within an image.
• Techniques: Sobel, Canny, Prewitt, and Laplacian of
Gaussian.
• Noise Reduction :
• Removing unwanted noise from the image to enhance its
quality.
Shatabdi Basu, Dept of DSE
• Techniques: median filtering, and bilateral filtering.
Low level vision
• Image Segmentation :
• Dividing an image into meaningful regions or segments.
• Techniques: Thresholding, region growing, and clustering
algorithms.
• Color and Texture Analysis :
• Analyzing color distributions and textures in the image.
• Techniques: Histogram analysis, Gabor filters.
Shatabdi Basu, Dept of DSE
Applications of low-level vision
• Enhancing image quality for better visual
representation
• Basic object detection and feature extraction
• Medical imaging for noise reduction and edge detection
in scans
Shatabdi Basu, Dept of DSE
Contours
• Contours can be defined
as the curves or outlines
that represent the
boundaries of objects or
shapes within an image.
• These curves join all the
continuous points (along
the boundary) having the
same color or intensity,
highlighting the
structural properties of
objects and providing a
way to extract and
represent shape
information from images.
Shatabdi Basu, Dept of DSE
Difference between Contours and
Edges
Shatabdi Basu, Dept of DSE
Difference between Edges and
Contours
Shatabdi Basu, Dept of DSE
Motion detection
• Identifying and analyzing changes in a sequence of
images or video frames to detect movement.
• A critical component in various applications like
surveillance, activity recognition, autonomous
vehicles, and human-computer interaction.
• The key techniques for motion detection are :
• Background Subtraction
• Optical Flow
• Frame Differencing
• Event-based Cameras
Shatabdi Basu, Dept of DSE
Applications of motion detection
• Video Surveillance:
• Detect and track intruders or unusual activities.
• Automate alerts for suspicious movements.
• Traffic Monitoring:
• Count vehicles, detect traffic congestion, and monitor lane
violations.
• Autonomous Vehicles:
• Detect pedestrians, cyclists, and other vehicles in real-
time.
• Human-Computer Interaction:
• Enable gesture-based controls or virtual reality
interactions.
Shatabdi Basu, Dept of DSE
Frame Differencing
• A simple technique where the difference between two
consecutive frames is calculated.
• Regions with significant differences are marked as motion.
• Limitation: May miss objects that blend with the background
or move slowly.
• Applications: Basic motion detection in low-complexity
scenarios.
Shatabdi Basu, Dept of DSE
Optical Flow
• Optical flow estimates the motion of objects or pixels between
consecutive frames based on changes in intensity patterns.
• It computes a vector field representing motion direction and
magnitude for every pixel.
• Algorithms: Lucas-Kanade, Horn-Schunck.
• Applications: Human activity tracking, gesture recognition.
Shatabdi Basu, Dept of DSE
Local features in computer vision
• Distinctive patterns or regions in an image that are
used to identify and describe important
characteristics of that image.
• These features are typically invariant to changes in
scale, rotation, or illumination, making them highly
effective for tasks such as object recognition, image
matching, and tracking.
Shatabdi Basu, Dept of DSE
Properties of local features
• Invariance: Local features are designed to remain
consistent under various transformations, including
rotation, scaling, and changes in lighting.
• Distinctiveness: Features should be unique enough to
distinguish between different parts of the image or
between images.
Shatabdi Basu, Dept of DSE
Types of local features
• Corners: Points in the image where the intensity
changes in multiple directions.
• Edges: Boundaries between regions with different
intensities.
• Regions: Areas of interest that differ in properties
like intensity or texture.
Shatabdi Basu, Dept of DSE
Feature detectors
• Identify keypoints in the image.
• Examples:
• SIFT (Scale-Invariant Feature Transform)
• SURF (Speeded-Up Robust Features)
• FAST (Features from Accelerated Segment Test)
Shatabdi Basu, Dept of DSE
Feature descriptors
• Represent the keypoints with numerical vectors for
matching or classification.
• Examples:
• SIFT descriptor
• ORB (Oriented FAST and Rotated BRIEF)
• BRIEF (Binary Robust Independent Elementary Features)
Shatabdi Basu, Dept of DSE
Bag of words model in Computer
Vision
• A technique used for representing images as a
collection of visual "words," analogous to the way a
text document can be represented by the frequency of
words it contains.
• Useful in tasks like image classification, object
recognition, and image retrieval.
Shatabdi Basu, Dept of DSE
Steps in Bag of words model
• Feature Extraction:
• Detect and describe local features in images using
algorithms like SIFT, SURF, or ORB.
• Vocabulary Creation:
• Use a clustering algorithm (e.g., k-means) to group feature
descriptors from a training set of images into k clusters.
• Each cluster center is considered a visual word, creating a
visual vocabulary.
• Feature Quantization:
• Map the features of each image to the nearest cluster center
(visual word).
• Construct a histogram that records the frequency of each
visual word in the image.
Shatabdi Basu, Dept of DSE
Steps in Bag of words model
(cont.)
• Image Representation:
• The histogram acts as a feature vector representing the
image.
• Classification/Comparison:
• Use the histogram as input to a machine learning model
(e.g., SVM) for tasks like classification or compare
histograms to measure image similarity.
Shatabdi Basu, Dept of DSE
Steps in Bag of words model
(cont.)
Shatabdi Basu, Dept of DSE