0% found this document useful (0 votes)
5 views

CVIP-Module-01-Reviewer

The document provides an overview of digital image processing and computer vision, highlighting their differences, fundamental concepts, core techniques, and applications across various industries. It discusses how image processing serves as a preprocessing step for computer vision tasks and outlines emerging trends in the field. Additionally, it covers types of images, color formats, and methods for color code conversion.

Uploaded by

Adlei Tan
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)
5 views

CVIP-Module-01-Reviewer

The document provides an overview of digital image processing and computer vision, highlighting their differences, fundamental concepts, core techniques, and applications across various industries. It discusses how image processing serves as a preprocessing step for computer vision tasks and outlines emerging trends in the field. Additionally, it covers types of images, color formats, and methods for color code conversion.

Uploaded by

Adlei Tan
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
You are on page 1/ 20

MODULE 01: INTRODUCTION TO DIGITAL IMAGE PROCESSING

Computer Vision

➢ Aims to enable machines to interpret and understand visual information from the world (e.g.
images or videos)
➢ Mimics human vision and allows for applications like object detection, facial recognition, and
scene understanding.

Image Processing

➢ Focuses on transforming and analyzing images to improve their quality or extract information
➢ Techniques include filtering, noise reduction, and color adjustments
➢ Often acts as a preprocessing step for computer vision tasks

Difference Between Computer Vision and Image Processing

➢ IP: more focused on pixel-level manipulation


➢ CV: works on higher-level interpretation

FUNDAMENTAL CONCEPTS

Image

➢ Composed of pixels

Pixel

➢ Smallest unit of information in an image

Resolution

➢ Number of pixels in an image, affecting its quality

Color Models

➢ Defines how colors are represented


➢ Example: RGB, CMYK, grayscale
BASIC OPERATIONS

1. Image Acquisition

➢ Capturing an image using devices like cameras or sensors

2. Preprocessing

➢ Steps like resizing, cropping, and noise reduction to prepare the image for analysis

3. Enhancement

➢ Improving image quality for better visual interpretation (e.g. adjusting contrast or sharpness)

CORE TECHNIQUES

Edge Detection

➢ Identifying boundaries in images to highlight regions of interest


➢ Common Algorithms: Canny, Sobel, Prewitt

Segmentation

➢ Dividing an image into meaningful regions or segments (e.g. separating a foreground object
from the background).
➢ Approaches include thresholding, clustering (e.g. K-means), and region-based methods.

Feature Extraction

➢ Extracting key characteristics or descriptors from an image (e.g. shapes, edges, or textures)
➢ These features are used in machine learning and deep learning for classification or recognition
tasks
APPLICATIONS

1. Healthcare

Medical imaging for diagnosing diseases (e.g. X-rays, CT scans)

Analyzing biological images (e.g. cell segmentation)

2. Automotive Industry

Self-driving cars rely on computer vision for lane detection, object recognition, and obstacle
avoidance.

3. Surveillance and Security

Face recognition and behavior monitoring in security systems

4. Retail and E-commerce

Image-based product search, augmented reality for virtual try-ons

5. Other Emerging Trends

AI-powered vision systems in agriculture, manufacturing, and robotics


IMAGE PROCESSING IN REAL LIFE

Image Processing

➢ Involves transforming and enhancing raw images for better quality or feature extraction.

A. Photo Editing and Enhancement

• Example: Apps like Adobe Photoshop, Instagram filters, and Snapseed.

o These tools apply image processing techniques like color correction, sharpening, and
blurring.

o For example, Instagram filters adjust contrast, brightness, and saturation in real-time.

B. Medical Imaging

• Example: X-rays, MRI scans, and CT scans.

o Image processing helps enhance medical images to improve diagnosis.

o Use case: Removing noise in MRI images to identify tumors or abnormalities.

C. Document Scanning

• Example: OCR (Optical Character Recognition) software in apps like CamScanner.

o Image processing enhances the scanned document (e.g., increasing contrast) before
text is extracted using OCR.

D. Barcode and QR Code Scanning

• Example: Barcode readers in supermarkets or QR code payments.

o The scanned image is preprocessed to detect and decode the pattern for product
identification or payment processing.

E. Satellite and Remote Sensing

• Example: Google Earth or weather prediction models.

o Satellite images are processed to analyze terrain, detect deforestation, or predict crop
health.
COMPUTER VISION IN REAL LIFE

Computer Vision

➢ Goes a step further by interpreting images and making decisions based on the content.

A. Facial Recognition

• Example: Face Unlock in smartphones, airport security, or attendance systems.

o CV detects and matches faces against a database to identify individuals.

o Use case: Apple's Face ID uses a 3D map of your face for secure authentication.

B. Self-Driving Cars

• Example: Tesla's Autopilot or Waymo vehicles.

o Cameras and CV algorithms are used for:

▪ Lane detection to keep the car within road boundaries.

▪ Pedestrian detection to avoid collisions.

▪ Traffic sign recognition to obey road rules.

C. Healthcare - Disease Diagnosis

• Example: AI-assisted tools like DeepMind's retinal disease detection system.

o Computer vision analyzes medical images (like retinal scans) to detect diabetic
retinopathy or cancer.

D. Retail - Visual Search

• Example: Amazon and Pinterest's "visual search" features.

o You can take a photo of a product, and the app finds similar products online.

o How it works: CV extracts features like color, shape, and texture to match items.
E. Augmented Reality (AR)

• Example: Snapchat filters or Pokémon GO.

o CV identifies facial landmarks to apply filters or detects the ground to place virtual
Pokémon in the real world.

F. Security and Surveillance

• Example: CCTV systems with motion detection or person tracking.

o CV algorithms identify suspicious activities or unauthorized access automatically.

o Use case: Airports use CV to track individuals in crowded terminals.

G. Agriculture

• Example: Monitoring crop health using drones.

o Drones capture field images, and CV algorithms analyze the images for plant diseases,
water stress, or pest infestation.

H. Manufacturing - Quality Control

• Example: Automated assembly lines.

o CV systems inspect products for defects, ensuring consistent quality.

o Use case: Detecting scratches or uneven surfaces in car manufacturing.

I. E-commerce - Try-On Features

• Example: Virtual try-on for clothes or glasses (e.g., Warby Parker, Sephora).

o CV maps your face or body to overlay products like glasses, makeup, or clothes in real-
time.
COMBINED USE OF IMAGE PROCESSING AND COMPUTER VISION

In most cases, image processing is a preprocessing step for computer vision tasks. Here's how they
work together:

Example 1: Automatic Number Plate Recognition (ANPR)

• Step 1 (Image Processing): The camera captures an image of a vehicle, and preprocessing
is applied to enhance contrast and remove noise.

• Step 2 (Computer Vision): CV algorithms detect the number plate, segment the characters,
and recognize the text for applications like toll collection or traffic violation tracking.

Example 2: Medical Imaging

• Step 1 (Image Processing): Enhance a CT scan to improve clarity and remove noise.

• Step 2 (Computer Vision): Analyze the enhanced image to detect patterns, such as
identifying cancerous cells or measuring organ sizes.
EMERGING TRENDS WITH EXAMPLES

1. Gesture Recognition

• Example: Gaming consoles like Xbox Kinect or Google's Soli project.

o Recognizing hand gestures to control devices or interact with virtual objects.

2. Real-Time Translation

• Example: Google Translate's camera feature.

o CV identifies text in an image, and OCR extracts the characters.

o The extracted text is then translated into the target language.

3. Fraud Detection

• Example: Banks use CV for fraud prevention.

o Use case: Verifying if ID documents (like a driver's license) match the face of the user
in real time.

4. Urban Planning

• Example: Detecting urban sprawl or illegal construction.

o Satellite images are processed and analyzed using CV to monitor changes over time.

Why This Field is Transformational

• Efficiency: Automated systems can process thousands of images in seconds, far beyond
human capabilities.

• Accuracy: Machine learning-powered CV systems are often more accurate than manual
methods, such as detecting early-stage diseases or inspecting microscopic defects.

• Scalability: CV and IP applications can scale to industries like education, entertainment, and
even social media moderation (e.g., detecting harmful content).
TYPES OF IMAGES

1. Binary Images

➢ The simplest type of image.


➢ Takes only two values (i.e. black and white, or 0 and 1).
➢ Consist of a 1-bit image, and it takes only 1 binary digit to represent a pixel.
➢ Mostly used for general shape or outline.
➢ Generated using threshold operation. When a pixel is above the threshold value, then it is
turned white (‘1’) and which are below the threshold value then they are turned black (‘0’).
➢ Example: Optical Character Recognition (OCR)

2. Grayscale Images

➢ Monochrome images
➢ They only have one color.
➢ Do not contain any information about color.
➢ Each pixel determines available different grey levels.
➢ A normal grayscale image contains 8 bits/pixel data, which has 256 different grey levels.
➢ In medical images and astronomy, 12 or 16 bits/pixel images are used.

3. Colour Images

➢ Three band monochrome images in which, each band contains a different color and the actual
information is stored in the digital image.
➢ Contain gray level information in each spectral band.
➢ Represented as red, green, and blue (RGB images). Each color has 24 bits/pixel means 8 bits
for each of the three color band (RGB).
COLOR FORMATS

1. 8-bit Color

➢ Also known as a grayscale image.


➢ Used for storing image information in a computer’s memory or in a file of an image.
➢ Each pixel represents one 8 bit byte.
➢ It has 0 − 255 range of colors, in which 0 is used for black, 255 for white, and 127 for gray
color.
➢ Initially, it was used by the UNIX operating system.

2. 16-bit Color

➢ Also known as high color format.


➢ It has 65,536 different color shades.
➢ It is used in the system developed by Microsoft.
➢ Further divided into three formats: Red, Green, and Blue (also known as RGB format).
➢ In RGB format, there are 5 bits for Red, 6 bits for Green, and 5 bits for Blue.
➢ One additional bit is added in green because in all the 3 colors, green color is soothing to eyes.

3. 24-bit Color

➢ Also known as the true color format.


➢ Also distributed in Red, Green, and Blue.
➢ As 24 can be equally divided on 8, it is distributed equally between 3 different colors like 8 bits
for Red, 8 bits for Green, and 8 bits for Blue.
COLOR CODE CONVERSION

By changing the quantity of the 3 portions of red, green, and blue, you can make different colors.

BINARY COLOR FORMAT

COLOR RED GREEN BLUE RGB

Black 0 0 0 (0,0,0)

White 255 255 255 (255, 255, 255)

Red 255 0 0 (255, 0, 0)

Green 0 255 0 (0, 255, 0)

Blue 0 0 255 (0, 0, 255)

Gray 128 128 128 (128, 128, 128)

CMYK COLOR MODEL

➢ Used for printers in which two carters are used: one for CMY color, and other for K (Black)
color. CMY can be changed to RGB.
➢ C: Cyan, M: Magenta, Y: Yellow, K: Black

COLOR RED GREEN BLUE RGB

Cyan (0, 255, 255) (0, 255, 255)

Magenta (255, 0, 255) (255, 0, 255)

Yellow (255, 255, 0) (255, 255, 0)


COLOR CODE CONVERSION

RGB CODE TO HEX CODE

Example: 𝑅𝐺𝐵(200, 100, 0)

PROCESS 1:

Step 1: Divide each number inside the parentheses by 16 repeatedly until you get a quotient of 0.
Take note of the remainders in order.

𝑫𝑰𝑽𝑰𝑺𝑰𝑶𝑵 𝑸𝑼𝑶𝑻𝑰𝑬𝑵𝑻 𝑹𝑬𝑴𝑨𝑰𝑵𝑫𝑬𝑹

200/16 12 8

12/16 𝟎 12

𝑫𝑰𝑽𝑰𝑺𝑰𝑶𝑵 𝑸𝑼𝑶𝑻𝑰𝑬𝑵𝑻 𝑹𝑬𝑴𝑨𝑰𝑵𝑫𝑬𝑹

100/16 6 4

6/16 𝟎 6

𝑫𝑰𝑽𝑰𝑺𝑰𝑶𝑵 𝑸𝑼𝑶𝑻𝑰𝑬𝑵𝑻 𝑹𝑬𝑴𝑨𝑰𝑵𝑫𝑬𝑹

0/16 𝟎 0

Step 2: Arrange the remainders in a horizontal format.

RED GREEN BLUE


Convert two-
digit numbers
12 8 6 4 0 0
to hexadecimal
symbol (e.g.
“12” to “C”. 𝑪 𝟖 𝟔 𝟒 𝟎 𝟎

Answer: #𝑪𝟖𝟔𝟒𝟎𝟎
PROCESS 2:

Step 1: Draw a table with 8 columns, with each column having 2𝑛 , where the value of 𝑛
increases from right to left.

𝟐𝒏 𝟐𝒏 𝟐𝒏 𝟐𝒏 𝟐𝒏 𝟐𝒏 𝟐𝒏 𝟐𝒏

𝟐𝟕 𝟐𝟔 𝟐𝟓 𝟐𝟒 𝟐𝟑 𝟐𝟐 𝟐𝟏 𝟐𝟎

𝟏𝟐𝟖 𝟔𝟒 𝟑𝟐 𝟏𝟔 𝟖 𝟒 𝟐 𝟏

Step 2: Create a row for each of the red, green, and blue digits of the RGB code.

Example: 𝑅𝐺𝐵(200, 100, 0)

𝑹𝑮𝑩 𝟏𝟐𝟖 𝟔𝟒 𝟑𝟐 𝟏𝟔 𝟖 𝟒 𝟐 𝟏

𝟐𝟎𝟎

𝟏𝟎𝟎

𝟎
Step 3: For each row, identify the largest values that sum to the given digit.
Assign a value of 1 to the digits that contribute to the given number when added.
Always start from left to right.

3.1. For 𝑅𝑒𝑑(200): 200 = 128 + 64 + 8

3.2. For 𝐺𝑟𝑒𝑒𝑛(100): 100 = 64 + 32 + 4

3.3. For 𝐵𝑙𝑢𝑒(0): 0 = 𝑁𝑜𝑛𝑒

𝑹𝑮𝑩 𝟏𝟐𝟖 𝟔𝟒 𝟑𝟐 𝟏𝟔 𝟖 𝟒 𝟐 𝟏

𝟐𝟎𝟎 𝟏 𝟏 0 0 𝟏 0 0 0

𝟏𝟎𝟎 0 𝟏 𝟏 0 0 𝟏 0 0

𝟎 0 0 0 0 0 0 0 0

Step 4: Split the table vertically into two sections, then convert each section into the 8-4-2-1
format.

𝑹𝑮𝑩 𝟏𝟐𝟖 𝟔𝟒 𝟑𝟐 𝟏𝟔 𝟖 𝟒 𝟐 𝟏

𝟐𝟎𝟎 𝟏 𝟏 0 0 𝟏 0 0 0

𝟏𝟎𝟎 0 𝟏 𝟏 0 0 𝟏 0 0

𝟎 0 0 0 0 0 0 0 0

𝑹𝑮𝑩 𝟖 𝟒 𝟐 𝟏 𝟖 𝟒 𝟐 𝟏

𝟐𝟎𝟎 𝟏 𝟏 0 0 𝟏 0 0 0

𝟏𝟎𝟎 0 𝟏 𝟏 0 0 𝟏 0 0

𝟎 0 0 0 0 0 0 0 0
Step 5: Convert each row from binary to hexadecimal.
Add the numbers that has an assigned value of 1.
Since Blue has no assigned value of 1, all its values will be set to 0.

𝑹𝑮𝑩 𝟖 𝟒 𝟐 𝟏 𝟖 𝟒 𝟐 𝟏

𝟐𝟎𝟎 𝟏 𝟏 0 0 𝟏 0 0 0

𝟏𝟎𝟎 0 𝟏 𝟏 0 0 𝟏 0 0

𝟎 0 0 0 0 0 0 0 0

RED GREEN BLUE

8+4 8 4+2 4 0 0
Convert two-
digit numbers 12 8 6 4 0 0
to hexadecimal
symbol (e.g.
“12” to “C”.
𝑪 𝟖 𝟔 𝟒 𝟎 𝟎

Answer: #𝑪𝟖𝟔𝟒𝟎𝟎
HEX CODE TO RGB CODE

Example: #𝐶86400

Step 1: Divide the code into three equal parts.

𝑪𝟖 𝟔𝟒 𝟎𝟎
𝑅𝑒𝑑 𝐺𝑟𝑒𝑒𝑛 𝐵𝑙𝑢𝑒

Step 2: If there are letters in the given, convert it first to numbers.

𝐶 → 12 𝐶8 → 12, 8

Step 3: Multiply each digit by 16𝑛 (𝑤ℎ𝑒𝑟𝑒 𝑛 = 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑑𝑖𝑔𝑖𝑡𝑠),


then add their product to each other.

𝑪𝟖 = (12 × 161 ) + (8 × 160 ) = (12 × 16) + (8 × 1) = 192 + 8 = 𝟐𝟎𝟎

𝟔𝟒 = (6 × 161 ) + (4 × 160 ) = (6 × 16) + (4 × 1) = 96 + 4 = 𝟏𝟎𝟎

𝟎𝟎 = 𝟎

Step 4: Combine all the converted decimal numbers into this format (𝑅𝑒𝑑, 𝐺𝑟𝑒𝑒𝑛, 𝐵𝑙𝑢𝑒).

(𝑅𝑒𝑑, 𝐺𝑟𝑒𝑒𝑛, 𝐵𝑙𝑢𝑒) → (𝟐𝟎𝟎, 𝟏𝟎𝟎, 𝟎)

Answer: (𝟐𝟎𝟎, 𝟏𝟎𝟎, 𝟎)


STEPS INVOLVED IN AN IMAGE PROCESSING PIPELINE

Image processing

➢ A set of techniques that involve manipulating and analyzing digital images to enhance their
quality, extract information, or perform specific tasks. These tasks can be of various types, like
recognizing objects, finding objects that are not visible, and sharpening and restoring the
image.
➢ Widely used in fields such as computer vision, medical imaging, remote sensing, and digital
photography.

Let's take a look at the steps in the image processing pipeline in the diagram below.

1. Image acquisition

➢ The first step in the image processing pipeline.


➢ This step involves capturing the raw image data, including pixel values and metadata, from
cameras, scanners, or other sources and converting them into digital format. The resulting
digital image is a matrix of pixel values, where each pixel is assigned a specific binary code or
numeric value.
➢ The digital image is typically stored in a specific file format, such as JPEG, PNG, TIFF, or
RAW. These formats determine how the pixel values, metadata, and other information are
encoded and stored within the file to preserve image quality or metadata.
2. Image preprocessing

➢ After acquiring the image, it is preprocessed.


➢ Refers to a set of techniques and operations performed on images before they undergo further
analysis.
➢ Its goal is to enhance the quality of the image, remove unwanted artifacts, and prepare the
image for subsequent tasks such as feature extraction, object recognition, or image analysis.
➢ Some basic preprocessing techniques include resizing, scaling, rotating, cropping, and flipping
an image. Next, we will look at a few techniques used in image preprocessing.

• Image enhancement

o It aims to improve the visual quality, clarity, and interpretability of an image by adjusting
the brightness, contrast, and color balance of an image to make it more visually
appealing or highlight specific features.
o Common enhancement techniques include histogram equalization, contrast stretching,
gamma correction, and adaptive filtering.
• Image restoration
o Used to recover or restore degraded or damaged images to improve their quality,
thereby removing the artifacts caused by noise, blurring, compression, or other factors.
o Examples of image restoration techniques include denoising, deblurring, super-
resolution, and inpainting.
• Image denoising
o A technique used to reduce or remove noise from an image.
o Noise in an image can be introduced during image acquisition, transmission, or storage
processes, and it can degrade image quality and affect subsequent analysis or
processing tasks.
o Denoising can be done by spatial filters like mean, median, and the Gaussian filter or
frequency domain filters.
3. Image segmentation

➢ Involves dividing an image into meaningful and distinct regions or objects.


➢ Its techniques can be based on various criteria, such as color, intensity, texture, or edge
information.
➢ It is useful for object detection, tracking, and extracting region-specific information for further
analysis.
➢ Common segmentation methods include thresholding, edge detection, region growing,
clustering, and watershed segmentation.

4. Feature extraction

➢ After processing the image, the useful features are extracted from the image.
➢ Refers to the process of identifying and extracting meaningful and relevant information or
features from an image.
➢ These features capture distinctive characteristics of the image that can be used for various
tasks such as image recognition, object detection, image classification, and image retrieval.
➢ Some commonly used techniques for feature extraction in image processing are edge
detection and texture analysis.
➢ Edge detection algorithms identify and highlight the boundaries or edges of objects in an
image while texture analysis methods capture the spatial arrangement and statistical
properties of texture patterns in an image.

5. Recognition or detection

➢ Involves identifying and classifying objects or patterns of interest within an image.


➢ This step utilizes the extracted features from the previous feature extraction step to make
decisions about the presence, location, or characteristics of specific objects or classes.
EXAMPLE

Consider the scenario of an autonomous vehicle navigating through a busy city road. In this scenario,
the image processing pipeline involves acquiring images from the vehicle's cameras, applying
preprocessing techniques such as enhancing the images, segmenting the scene, detecting and
recognizing objects like traffic signs, detecting lanes, and tracking obstacles. These steps collectively
provide valuable information to the autonomous vehicle system, enabling it to safely navigate through
the city street.

CONCLUSION

In conclusion, the image processing pipeline plays a vital role in various real-world applications, such
as computer vision, medical imaging, autonomous vehicles, surveillance, and more. It enables us to
extract meaningful information from images, make decisions based on visual data, and automate
tasks that would otherwise be time-consuming to perform.

You might also like