0% found this document useful (0 votes)
4 views19 pages

5) Introduction To Computer Vision

Computer Vision is a field aimed at enabling computers to understand digital images, involving tasks such as object detection, event detection, and scene reconstruction. It is closely related to AI, primarily utilizing neural networks, particularly convolutional neural networks, for image processing. The document also discusses essential Python libraries for computer vision, practical applications like Braille book processing, and advanced techniques for motion detection.

Uploaded by

sonij27062
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views19 pages

5) Introduction To Computer Vision

Computer Vision is a field aimed at enabling computers to understand digital images, involving tasks such as object detection, event detection, and scene reconstruction. It is closely related to AI, primarily utilizing neural networks, particularly convolutional neural networks, for image processing. The document also discusses essential Python libraries for computer vision, practical applications like Braille book processing, and advanced techniques for motion detection.

Uploaded by

sonij27062
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Introduction to Computer Vision

Computer Vision is a discipline whose aim is to allow computers to gain high-level


understanding of digital images. This broad field encompasses many different tasks,
from finding objects on pictures to understanding events, describing images in text, or
reconstructing scenes in 3D.
AI BRANCH

Computer Vision as Part of AI

Computer vision is often considered to be a branch of AI.


Nowadays, most computer vision tasks are solved using
neural networks. We will learn more about the special type of
neural networks used for computer vision, convolutional
neural networks, throughout this section.

However, before you pass the image to a neural network, in


many cases it makes sense to use some algorithmic
techniques to enhance the image.
Understanding Through Vision
Understanding can mean many different things in computer vision. The field encompasses a wide range of capabilities that allow machines to
interpret visual information.

Object Detection Event Detection Scene Reconstruction Image Description


Finding and identifying specific Understanding what is happening Rebuilding three-dimensional Describing pictures in natural
objects within images in a scene or video scenes from two-dimensional language text
images
Human-Focused Vision Tasks
Computer vision has developed specialized capabilities for understanding human
subjects in images. These tasks are particularly important for applications in security,
healthcare, and human-computer interaction.

Face Detection Age Estimation Emotion


Recognition
Identifying and Predicting the age of
locating human faces individuals from facial Detecting emotional
in images features states from facial
expressions

3D Pose Estimation
Understanding body position and movement in three dimensions
Image Classification

The Foundation Task


One of the simplest tasks of computer vision is image classification. This fundamental capability
involves categorizing images into predefined classes or categories.
Image classification serves as the building block for many more complex computer vision
applications and is often the first task learned when studying the field.
PYTHON TOOLS

Essential Python Libraries


Several powerful Python libraries are available for image processing, each offering unique capabilities and strengths. These tools form the foundation
of most computer vision projects.

1 2 3 4

imageio Pillow (PIL) OpenCV dlib


Used for reading and writing More powerful library that Powerful image processing C++ library implementing
different image formats. Also supports image manipulation library written in C++ with many machine learning
supports ffmpeg, a useful tool such as morphing, palette convenient Python interface. algorithms with Python
to convert video frames to adjustments, and more. The de facto standard for interface. Used for
images. image processing. challenging tasks like face
detection.
imageio Library
Key Features imageio can be used for reading and writing different
image formats. It provides a simple and consistent
Reading and writing
interface for handling various file types.
various image formats
with ease The library also supports ffmpeg, which is a useful
tool to convert video frames to images, making it
invaluable for video processing tasks.
Pillow: Enhanced Image Manipulation

Pillow, also known as PIL (Python Imaging


Library), is a bit more powerful than basic image
reading libraries. It supports various image
manipulation operations that go beyond simple
input and output.

The library includes capabilities for morphing,


palette adjustments, filtering, and many other
image transformation operations that are
essential for pre-processing images before
analysis.
OpenCV: The Industry Standard
OpenCV is a powerful image processing library written in C++, which has become the
de facto standard for image processing. Its comprehensive feature set and
performance make it the go-to choice for professional computer vision applications.

High Python Interface Comprehensive


Performance Tools
Convenient Python
C++ foundation bindings for easy use Extensive library of
ensures fast vision algorithms
processing
dlib: Advanced Machine Learning

Powerful ML Algorithms
dlib is a C++ library that implements many machine
learning algorithms, including some of the most
advanced Computer Vision algorithms available.

It also has a Python interface, and can be used for


challenging tasks such as face and facial landmark
detection. The library is particularly well-suited for
applications requiring high accuracy in human face
analysis.
CASE STUDY

Braille Book Processing


Pre-processing a photograph of a Braille book demonstrates the power of computer
vision techniques. This practical example shows how we can use thresholding, feature
detection, perspective transformation and NumPy manipulations to separate
individual Braille symbols for further classification by a neural network.
Braille Processing Pipeline
01

Thresholding

Convert image to binary format

02

Feature Detection

Identify Braille dot patterns

03
Image capture Feature detection Symbol separation
Thresholding Perspective Transform

Correct image distortion

The processing pipeline transforms a raw photograph into individual Braille symbols ready for neural 04
network classification.
Symbol Separation

Extract individual characters


Braille Processing Results

The transformation from original photograph to processed symbols demonstrates the effectiveness of computer vision techniques in preparing data
for neural network analysis.
Motion Detection Using Frame
Difference
Detecting motion in video using frame difference is a simple yet effective technique. If
the camera is fixed, then frames from the camera feed should be pretty similar to each
other.

Since frames are represented as arrays, just by subtracting those arrays for two
subsequent frames we will get the pixel difference, which should be low for static
frames, and become higher once there is substantial motion in the image.
Frame Difference Technique

How It Works
The frame difference method relies on the
mathematical subtraction of pixel values
between consecutive frames. When the camera
is stationary, most pixels remain unchanged,
resulting in minimal difference values.

However, when motion occurs, the pixel values


change significantly, creating a clear signal that
movement has been detected in the scene.
ADVANCED TECHNIQUE

Optical Flow for Motion Detection


Optical flow allows us to understand how individual pixels on video frames move. This sophisticated technique provides detailed information about
motion patterns in video sequences.

Dense Optical Flow Sparse Optical Flow


Computes the vector field that shows for each pixel where it is Based on taking distinctive features in the image and building their
moving trajectory from frame to frame
Dense vs Sparse Optical Flow

Two Approaches
Dense Optical Flow computes motion vectors
for every single pixel in the image, creating a
comprehensive vector field that shows the
complete motion pattern across the entire
frame.

Sparse Optical Flow focuses on distinctive


features like edges and corners, tracking only
these key points from frame to frame to build
motion trajectories efficiently.
Optical Flow Visualization
This visualization demonstrates how optical flow captures motion patterns in video
sequences. The vectors show the direction and magnitude of movement for tracked
features, providing rich information about scene dynamics.
Applications of Motion Detection

Security Systems Sports Analytics Autonomous Vehicles


Automated surveillance and intrusion detection Tracking player movements and performance Detecting pedestrians and other moving
metrics objects

You might also like