UNIT 2: CYBER LAWS AND FORENSICS - COMPREHENSIVE NOTES
A. INTERNET OF THINGS (IoT)
1. Introduction to IoT
Definition: IoT is a network of physical objects ("things") embedded with sensors, software, and other technologies for the purpose of connecting and exchanging data with other devices and systems over the internet.
Key Characteristics (Core "V's"):
-
Variety: Diverse devices with different capabilities.
-
Velocity: High-speed data generation and transmission.
-
Volume: Massive amounts of data produced.
-
Veracity: Uncertainty and noise in data quality.
-
Value: Extraction of meaningful insights from data.
-
Visualization: Representing data for human understanding.
[!TIP] Exam Focus: Distinguish IoT (Internet of Things - device-to-cloud/internet) from WoT (Web of Things - applying Web standards like HTTP/URI to IoT for seamless integration). IoT is about connectivity; WoT is about making IoT data usable on the Web.
Practical Applications (7m Question Pattern):
-
Smart Homes: Automated lighting, HVAC, security.
-
Smart Cities: Traffic management, waste management, smart grids.
-
Healthcare: Remote patient monitoring, wearable fitness trackers.
-
Industrial IoT (IIoT): Predictive maintenance, supply chain optimization.
-
Agriculture: Precision farming, soil/crop monitoring.
2. IoT Architecture and Design
Conceptual Framework (3-Layer Model):
-
Perception Layer: Physical sensors/actuators for data collection/action.
-
Network Layer: Data transmission via various communication protocols (Wi-Fi, BLE, etc.).
-
Application Layer: User-facing applications, data analytics, cloud integration.
Service-Oriented Architecture (SOA) for IoT:
-
Significance: Promotes interoperability, reusability, and modularity. Devices expose their functionality as "services" (e.g., "read temperature service") that can be discovered and invoked by other devices/applications.
-
Components: Service provider (device), service registry (directory), service consumer (application/other device).
Physical vs. Logical Design:
-
Physical Design: Deals with hardware components (sensors, actuators, microcontrollers, communication modules).
-
Logical Design: Deals with software layers, protocols, data formats, and system interactions.
Key Components of an IoT Network:
-
Things/End Devices: Sensors, actuators, embedded systems.
-
Gateways/Hubs: Protocol translation, local processing, security edge.
-
Communication Infrastructure: Networks (LPWAN, PAN, LAN).
-
IoT Platform/Cloud: Data ingestion, storage, processing, device management.
-
Applications & Analytics: End-user interfaces, business logic, AI/ML models.
3. Sensors and Actuators
Sensor Evolution & Importance:
-
Evolution: From mechanical/analog (e.g., mercury thermometer) → electronic/analog → digital/smart sensors with on-board processing, calibration, and communication.
-
Importance: The primary source of real-world data. Advances (MEMS, nanotech) have made them smaller, cheaper, more accurate, and energy-efficient, enabling ubiquitous deployment.
Types of Sensors:
| Type | Definition | Examples |
|---|---|---|
| Scalar | Measures a single, scalar quantity (magnitude only). | Temperature sensor (LM35), pressure sensor, light sensor (LDR). |
| Vector | Measures both magnitude and direction. | Accelerometer, gyroscope, magnetometer (9-DOF IMU). |
Analog vs. Digital Sensors:
| Feature | Analog Sensor | Digital Sensor |
|---|---|---|
| Output | Continuous voltage/current signal proportional to measurand. | Discrete digital values (binary, I2C, SPI, UART). |
| Interference | Susceptible to noise and signal degradation over distance. | More immune to noise; signal integrity maintained. |
| Processing | Requires external ADC (Analog-to-Digital Converter). | Has built-in ADC and often processing (calibration, linearization). |
| Integration | Less direct with digital systems/microcontrollers. | Plug-and-play with microcontrollers (e.g., Arduino, RPi). |
Sensor Node Key Features:
-
Sensing element, transducer, signal conditioning.
-
Microcontroller/processor for local computation.
-
Memory for data/software.
-
Communication interface (radio transceiver).
-
Power source (battery, energy harvesting).
-
Often part of a Wireless Sensor Network (WSN).
Common Sensor Errors:
-
Bias: Systematic, constant offset from true value (e.g., calibration error).
-
Drift: Gradual change in output over time for a constant input (e.g., sensor aging).
-
Hysteresis Error: Difference in output for the same input depending on whether input increased or decreased to that point.
-
Quantization Error: Error due to finite resolution of digital sensor/ADC. The smallest change the sensor can detect. For an N-bit ADC, max error = ±1/2 LSB.
Actuators:
-
Role: Convert electrical/control signals into physical action (the "do" part of IoT). They are the effectors.
-
Types:
-
Electrical: Relays, solenoids, motors (DC, stepper, servo).
-
Hydraulic: Use fluid pressure.
-
Pneumatic: Use compressed air.
-
Thermal/Magnetic: Shape-memory alloys, piezoelectric.
-
4. Communication Technologies and Protocols
M2M (Machine-to-Machine) Communication:
-
Working Principle: Direct communication between devices without human intervention. Typically uses point-to-point or cellular networks (GSM, LTE-M, NB-IoT). A device (e.g., a vending machine) with a SIM card sends data (inventory status) directly to a server.
-
IoT vs. M2M: M2M is often a subset/older paradigm of IoT, typically using proprietary or cellular networks with a central server. IoT is broader, encompassing IP-based networks, diverse protocols, and cloud platforms.
Wireless Communication Methods & Contribution:
-
Short-Range (PAN/LAN): Wi-Fi, Bluetooth/BLE, ZigBee, Z-Wave. For local, high-bandwidth, low-power connectivity (homes, buildings).
-
Long-Range (LPWAN): LoRaWAN, Sigfox, NB-IoT. For wide-area, low-power, low-bandwidth, long-battery-life applications (smart agriculture, city-wide sensors).
-
Cellular: 4G/5G, LTE-M. For high-bandwidth, mobile, or critical applications requiring wide coverage and QoS.
Specific Protocols:
6LoWPAN (IPv6 over Low-Power Wireless Personal Area Networks):
- Role: Enables IPv6 packets to be carried efficiently over IEEE 802.15.4 (low-power, low-rate networks like ZigBee). It adapts large IPv6 headers to small MTU via header compression and fragmentation. Crucial for connecting resource-constrained IoT devices directly to the Internet.
RFID (Radio Frequency Identification):
-
Working Principle: Uses radio waves to automatically identify and track tags attached to objects. Components: Tag (passive/active, with ID), Reader (emits RF, receives tag response), Antenna, Backend Database.
-
Applications: Inventory management, access control, asset tracking, contactless payment (NFC is a subset).
Bluetooth for IoT:
-
Bluetooth Classic: Higher throughput, higher power (audio streaming).
-
Bluetooth Low Energy (BLE / Bluetooth Smart): Primary for IoT. Low power, supports star and mesh topologies (Bluetooth Mesh). Used in beacons, wearables, home automation.
ZigBee:
-
Types:
-
ZigBee PRO (ZigBee 2007/Pro): Standard for general IoT/mesh networking (lighting, home automation).
-
ZigBee IP: Uses IPv6 and 6LoWPAN for direct internet integration.
-
ZigBee RF4CE: Designed for consumer electronics (remote controls).
-
-
Features: Low power, low data rate, large mesh network (65,000+ nodes), self-healing.
NFC (Near Field Communication):
- Use in IoT: Very short-range (≤10 cm), instant pairing/configuration. Used for device commissioning (tapping a phone to a smart plug to configure Wi-Fi), contactless access, payment, and simple data exchange.
Messaging & Data Protocols:
MQTT (Message Queuing Telemetry Transport):
-
Key Components:
-
Publisher: Sends messages to a Topic.
-
Subscriber: Receives messages from topics it's subscribed to.
-
Broker: Central server that handles message routing, authentication, and session management.
-
-
Model: Publish/Subscribe. Lightweight, uses TCP, ideal for constrained networks. QoS levels (0,1,2).
AMQP (Advanced Message Queuing Protocol):
-
Features: Binary, application-layer protocol. Reliable, secure, interoperable. Works in Publish/Subscribe and Message Queueing models.
-
Components: Publisher/Subscriber, Exchange (routes messages to queues based on rules), Queue (stores messages), Binding (link between exchange and queue), Consumer.
-
Frame Types:
OPEN(connection),BEGIN(session),ATTACH(link),FLOW(credit),TRANSFER(message),DISPOSITION(settlement),CLOSE/END(termination).
XMPP (Extensible Messaging and Presence Protocol):
- Role in IoT: XML-based, decentralized (client-server, like Jabber). Good for presence (device status online/offline) and real-time messaging between devices. Can be heavy for constrained nodes.
CoAP (Constrained Application Protocol):
-
Concept: RESTful protocol for constrained nodes/networks. Uses UDP (lightweight), mimics HTTP methods (GET, PUT, POST, DELETE) but with smaller headers.
-
Message Types:
-
Confirmable (CON): Requires ACK response.
-
Non-Confirmable (NON): No ACK required (fire-and-forget).
-
Acknowledgment (ACK): Response to CON.
-
Reset (RST): Indicates message not understood or cannot be processed.
-
-
Request-Response Model: Similar to HTTP. Client sends request (CON/NON) to server. Server responds with ACK/NON containing response code (e.g., 2.05 Content).
SMQTT (Secure MQTT):
- Extension of MQTT that incorporates lightweight cryptographic mechanisms (like symmetric key cryptography) for message confidentiality and integrity, addressing MQTT's lack of built-in security.
Communication APIs:
- Role: Provide standardized software interfaces (libraries, SDKs) for applications to interact with underlying communication hardware/modems (e.g., cellular, Wi-Fi, BLE). They abstract low-level complexity, enabling developers to focus on application logic (e.g., send data, connect to network).
5. Hardware Platforms
Arduino:
-
Basic Features: Open-source electronics platform. Simple microcontroller board (ATmega328P etc.). Limited RAM/Flash. No native OS. Easy I/O pin control. Programmed via Arduino IDE (C/C++).
-
Role in IoT: Ideal for sensor data acquisition, simple control, prototyping. Low cost, large community, vast shield ecosystem. Acts as a sensor node/edge device.
Raspberry Pi:
-
Basic Features: Single-board computer (SBC). Has a full-fledged microprocessor (SoC), runs a full OS (Linux/Raspbian). Significant RAM/Storage (SD card). Multiple USB, HDMI, Ethernet ports.
-
Role in IoT: Acts as a gateway/hub or a more powerful edge node. Handles protocol translation, local data processing/analytics, complex applications, UI/display. More computational power than Arduino.
[!TIP] Key Distinction: Arduino = Microcontroller (simple, real-time control). Raspberry Pi = Microprocessor/Computer (complex processing, multitasking, OS). Often used together: Pi as gateway, Arduino as sensor node.
6. IoT Platforms and Cloud Integration
IoT Platform Definition:
A middleware layer that provides tools/services for device management, data ingestion, storage, processing, analytics, and application development. Examples: AWS IoT, Azure IoT, Google Cloud IoT Core, ThingWorx.
How They Facilitate Development/Management:
-
Device Onboarding & Management: Secure provisioning, monitoring, firmware updates (OTA).
-
Data Ingestion: Scalable endpoints (MQTT/HTTP) to receive device data.
-
Rules Engine: Trigger actions based on data (e.g., "if temp>30°C, send alert").
-
Data Storage & Processing: Time-series databases, stream processing (e.g., AWS IoT Analytics).
-
Visualization & Dashboards: Build custom UIs.
-
Security: Device authentication, end-to-end encryption.
Role of Cloud Computing in IoT:
-
Storage: Provides virtually unlimited, scalable, durable storage for massive IoT data streams (object storage, time-series DBs).
-
Processing: Offers on-demand compute power (VMs, serverless functions, containers) for batch analytics, real-time stream processing, and complex ML/AI model training/inference that local devices cannot handle.
-
Enables Scalability: Cloud's elasticity handles unpredictable IoT data volumes.
Cloud Storage Models:
-
Public Cloud: Multi-tenant, pay-as-you-go (AWS S3, Azure Blob). Most common for IoT.
-
Private Cloud: Single-tenant, on-premises or hosted. For strict data sovereignty/security.
-
Hybrid Cloud: Combination of public and private. Sensitive data on private, analytics on public.
7. Data Management
Role of Data Analytics in IoT:
-
Extracting Insights: Transforms raw, high-volume, often noisy IoT data into actionable information.
-
Functions:
-
Descriptive Analytics: What happened? (Dashboards, reports).
-
Diagnostic Analytics: Why did it happen? (Root cause analysis).
-
Predictive Analytics: What will happen? (ML models for failure prediction, demand forecasting).
-
Prescriptive Analytics: What should we do? (Recommendations, automated control).
-
-
Enables: Operational efficiency, new business models, predictive maintenance, enhanced user experiences.
8. Security and Privacy
Major Issues:
-
Device/Endpoint Security: Weak/default passwords, lack of secure boot, unpatched firmware, physical tampering.
-
Communication Security: Lack of encryption, use of insecure protocols, man-in-the-middle attacks.
-
Data Security & Privacy: Massive data collection (often personal/sensitive), insecure storage, lack of user consent, data misuse, re-identification risks.
-
Cloud/Platform Security: Vulnerabilities in IoT platform APIs, insecure cloud configurations.
-
Lifecycle Management: Long device lifespans with no security update path.
-
Scalability: Securing millions of heterogeneous devices is immensely complex.
[!TIP] Common Pitfall: Students often list generic IT security issues. Focus on IoT-specific challenges: resource constraints (can't run heavy crypto), physical accessibility of devices, heterogeneity, and long lifecycles.
B. SOCIAL NETWORKS
1. Introduction to Social Networks and the Social Web
Emergence of the Social Web (Web 2.0):
Shift from static, read-only web pages (Web 1.0) to interactive, user-generated content, participatory, and social platforms. Enabled by technologies like AJAX, APIs, and broadband. Characterized by folksonomies (user tagging), wikis, blogs, and social networking sites (Facebook, Twitter).
Types of Web-Based Networks:
-
Email Groups / Mailing Lists: Asynchronous group communication via email (e.g., Google Groups).
-
RSS Feeds (Really Simple Syndication): Push-based content distribution. Users subscribe to feeds from websites/blogs to get updates. Enables content aggregation.
-
Social Networking Sites (SNS): Profile-based, explicit relationship management (Facebook, LinkedIn).
-
Microblogging: Short, frequent updates (Twitter, Tumblr).
-
Photo/Video Sharing: Flickr, YouTube.
-
Collaborative Projects: Wikis (Wikipedia), open-source platforms (GitHub).
2. Social Network Analysis (SNA)
Importance: Quantitatively studies social structures using graph theory. Used to:
-
Identify influential actors/influencers.
-
Detect communities/ subgroups.
-
Understand information diffusion.
-
Analyze organizational structure.
-
Combat fraud/cybercrime in OSNs.
Key Metrics:
-
Centrality: Measures node importance.
-
Degree Centrality: Number of direct connections.
C_D(v) = deg(v) / (n-1). -
Betweenness Centrality: Frequency a node lies on shortest paths between others.
C_B(v) = Σ_{s≠v≠t} (σ_{st}(v) / σ_{st}). -
Closeness Centrality: Inverse of average shortest path to all others.
C_C(v) = (n-1) / Σ_{u} d(v,u). -
Eigenvector Centrality: Importance of a node's neighbors. A node is important if connected to other important nodes.
Ax = λx(A=adjacency matrix, x=eigenvector, λ=largest eigenvalue).
-
-
Clustering:
-
Clustering Coefficient (Local): Likelihood that two associates of a node are themselves associates.
C_i = 2T_i / (k_i(k_i-1))(T_i=triangles through i, k_i=degree). -
Average Clustering Coefficient: Mean of all local C_i.
-
Transitivity: Global clustering coefficient.
C = 3 × number of triangles / number of connected triples.
-
Matrix Representation:
-
Adjacency Matrix (A):
n x nmatrix whereA[i][j] = 1if link from i to j (directed), else 0. For undirected, symmetric. -
Incidence Matrix:
n x mmatrix (n=nodes, m=edges) showing node-edge incidence. -
Laplacian Matrix:
L = D - A(D=degree matrix). Used in spectral graph theory.
Network Reduction Techniques:
-
Goal: Simplify large networks while preserving key structural properties.
-
Methods:
-
k-Core Decomposition: Recursively removes nodes with degree < k. Reveals dense core.
-
k-Shell Decomposition: Similar, nodes removed based on remaining degree.
-
Community Collapse: Replace each detected community with a "supernode" for higher-level analysis.
-
Bipartite Projection: Project bipartite networks (e.g., users & groups) onto one set (user-user co-membership).
-
3. Semantic Web and Ontologies
RDF (Resource Description Framework) & RDF Schema:
-
RDF: Data model for the Semantic Web. Represents information as Subject-Predicate-Object triples (statements). All are URIs or literals. Serialized in RDF/XML, Turtle, etc.
- Example:
<http://example.org/alice> <http://xmlns.com/foaf/0.1/knows> <http://example.org/bob>.
- Example:
-
RDF Schema (RDFS): Provides basic vocabulary for defining RDF resources:
rdfs:Class,rdfs:subClassOf,rdfs:subPropertyOf,rdfs:domain,rdfs:range. Enables simple ontologies/taxonomies.
OWL (Web Ontology Language):
-
Unique Features (over RDFS):
-
Richer Expressivity: Can define complex class relationships (union, intersection, complement), property characteristics (transitive, symmetric, inverseOf, functional), cardinality restrictions (owl:cardinality, minCardinality, maxCardinality).
-
Formal Semantics: Based on Description Logics, enabling logical reasoning (inference).
-
Two Main Species: OWL DL (Decidable, most used), OWL Lite (Simpler subset).
-
FOAF (Friend of a Friend):
-
Foundational Ontology: An RDF-based vocabulary for describing people, their activities, and relationships.
-
Key Classes:
foaf:Person,foaf:Organization. -
Key Properties:
foaf:name,foaf:knows(social link),foaf:mbox(email),foaf:homepage,foaf:depicts(image). -
Significance: Provides a standard, machine-readable way to represent social profiles and connections across different sites, enabling decentralized social networks and data portability.
4. Community Analysis
Definitions of Community:
-
Local Definition: A group where every member is connected to every other member (clique). Too strict for real networks.
-
Global Definition: Partition of the network into groups with high internal density and low external density (e.g., modularity-based communities).
-
Vertex-Based Definition: A community is the set of vertices reachable from a starting vertex via internal edges more than external ones (e.g., k-clique percolation, label propagation).
Measuring Evolution Metrics from Web Archives:
To track how a web community (e.g., a topic forum) evolves over time using archived snapshots:
-
Growth Metrics: Number of new members, new posts, new threads over time.
-
Activity Metrics: Average posts per user, thread length, response time.
-
Structural Metrics: Change in network density, average path length, clustering coefficient over time.
-
Topic Evolution: Use text mining (LDA) on posts to track shifting discussion topics.
-
Membership Turnover: Rate of user joining/leaving (churn).
5. Applications and Human Experiences
Enabling New Human Experiences:
-
Social Networks: Connect people globally, share experiences, maintain relationships, identity construction.
-
Reality Mining: Using data from mobile phones/sensors to infer real-world human behavior, relationships, and patterns (e.g., proximity data to model social interactions, mobility patterns).
-
Context Awareness: Systems that adapt based on user's context (location, activity, time, social setting). Enabled by sensors and social data (e.g., phone silencing in meeting, location-based recommendations from friends).
6. Privacy and Security in Online Social Networks (OSNs)
Privacy Concerns:
-
Data Collection: Excessive personal data (location, contacts, habits) collected by platforms.
-
Lack of Control: Complex privacy settings; difficulty in managing who sees what.
-
Secondary Use: Data sold/shared with advertisers/third parties.
-
Profile Inference: Sensitive attributes (sexual orientation, health) inferred from "likes" or network.
-
Persistence: Data never truly deleted ("digital footprint").
-
Context Collapse: Different audiences (family, friends, employers) merged into one network.
Attack Spectrum & Countermeasures:
| Attack | Description | Countermeasures |
|---|---|---|
| Plain Impersonation | Creating a fake profile pretending to be someone else. | Profile verification, user reporting, AI-based fake detection, strong identity proofing. |
| Profile Cloning | Copying a real user's profile info (name, photo) to create a duplicate fake account. | Platform detection of duplicate info, user alerts, unique identifiers, watermarking profile images. |
| Profile Hijacking | Gaining unauthorized access to a legitimate user's account (password theft, session hijack). | Strong 2FA, login alerts, secure session management, password hygiene education. |
| Profile Porting | In DOSNs, migrating a user's profile (identity, connections) from one server to another without consent. | Cryptographic signatures on profile data, server-to-server trust protocols, user consent during migration. |
Challenges for Decentralized OSNs (DOSNs):
-
Identity Management: No central authority; how to verify unique identities & prevent Sybil attacks.
-
Data Portability & Interoperability: Different servers using different data schemas/protocols.
-
Content Moderation: No central entity to remove illegal/harmful content.
-
Spam & Abuse: Distributed spam filtering is harder.
-
Consistency & Availability: Ensuring data availability across a distributed network.
-
Monetization: Sustainable business models without centralized advertising.
Censorship Attacks:
-
Goal: Suppress specific information or voices in a network.
-
Methods: Mass reporting of content/accounts to trigger automated takedowns, DDoS attacks on dissenting groups, infiltration and flooding with spam/off-topic posts to disrupt discussions (trolling), exploiting platform policies.
-
Countermeasures: Robust appeal processes, human moderation review, decentralized hosting (harder to takedown), censorship-resistant networks (e.g., using blockchain or F2F networks).
C. DIGITAL IMAGE PROCESSING
1. Fundamentals
Image Formation in the Human Eye:
-
Cornea & Lens: Refract light onto the retina.
-
Retina: Contains rods (low-light, no color) and cones (color, bright light).
-
Brightness Adaptation: The eye's ability to adjust sensitivity over a wide range of luminance (≈10^10:1). Done by pupil dilation/constriction and retinal photochemical adaptation.
-
Brightness Discrimination: The ability to distinguish between slightly different luminance levels. Weber's Law:
ΔI / I = constant(just noticeable difference ΔI is proportional to background intensity I). Explains why we see more shades in mid-tones than in very dark/bright areas.
Image Sampling & Quantization:
-
Sampling (Spatial Discretization): Digitizing the continuous (x,y) coordinates. Sampling Rate (samples per unit distance). Aliasing occurs if sampling rate < 2× highest spatial frequency (Nyquist criterion).
-
Quantization (Amplitude Discretization): Digitizing the continuous intensity (f(x,y)). Number of Gray Levels (L) = 2^k (k=bits/pixel). Quantization Error = ±1/2 LSB.
-
Result: An M x N image with k bits/pixel is an MxN matrix of integers in [0, L-1].
Properties of Fourier Transform (Proof of Linearity): 2-D Continuous Fourier Transform (CFT):
F(u,v) = ∫∫_{-∞}^{∞} f(x,y) e^{-j2π(ux+vy)} dx dy
Linearity: If f(x,y) = a*g(x,y) + b*h(x,y), then
F(u,v) = a*G(u,v) + b*H(u,v).
Proof: Direct substitution and linearity of integral.
2-D Discrete Fourier Transform (DFT):
F(u,v) = Σ_{x=0}^{M-1} Σ_{y=0}^{N-1} f(x,y) e^{-j2π(ux/M + vy/N)}
Linearity: If f(x,y) = a*g(x,y) + b*h(x,y), then
F(u,v) = a*G(u,v) + b*H(u,v).
Proof: Direct substitution and linearity of summation.
2. Image Enhancement
Histogram Processing of Color Images:
-
Approach 1 (Independent): Apply histogram processing (equalization, stretching) to each R, G, B channel separately. Simple but may cause color distortion.
-
Approach 2 (HSV/HSI): Convert to Hue-Saturation-Intensity (or Value) space. Process only the Intensity (V/I) channel (preserving color). Convert back to RGB.
-
Approach 3 (Cumulative Histogram): Process based on luminance histogram while maintaining color ratios.
Image Point Operations:
-
Definition: Operation where output pixel
g(x,y)depends only on input pixelf(x,y).g(x,y) = T[f(x,y)]. -
Examples: Contrast stretching, thresholding, negative (
s = L-1 - r), log transformation (s = c log(1+r)), power-law (gamma) correction (s = c r^γ). -
Histogram Manipulation: Point ops directly modify the histogram shape.
Frequency Domain Filtering:
-
Homomorphic Filtering:
-
Goal: Simultaneous dynamic range compression (reduce illumination variations) and contrast enhancement (highlight details).
-
Model: Image
f(x,y) = i(x,y) * r(x,y)(illuminationi× reflectancer). Multiplicative components. -
Process:
-
Take log:
ln(f) = ln(i) + ln(r)(converts multiplication to addition). -
Compute DFT:
F(u,v) = I(u,v) + R(u,v). -
Apply filter
H(u,v)(high-pass for reflectance, low-pass for illumination). Typically:H(u,v) = (γ_H - γ_L) * [1 - e^{-k(D(u,v)/D_0)^2}] + γ_L. -
Inverse DFT:
ln(ĝ) = H(u,v)*F(u,v). -
Exponentiate:
ĝ(x,y) = exp(ln(ĝ)).
-
-
Equation:
ĝ(x,y) = exp{ ℱ^{-1}[ H(u,v) * ℱ[ln(f(x,y))] ] }
-
-
Image Sharpening using Highpass Filters:
-
Butterworth Highpass Filter (BHPF):
H(u,v) = 1 / [1 + (D_0 / D(u,v))^{2n}](for HPF, subtract from 1:H_hp = 1 - H_lp).Order
ncontrols roll-off.D_0= cutoff radius. -
Gaussian Highpass Filter (GHPF):
H(u,v) = 1 - e^{-D^2(u,v) / (2 D_0^2)}.No ringing artifacts (unlike Butterworth/ideal).
-
Sharpening:
g_sharp(x,y) = f(x,y) - f_blurred(x,y). In frequency domain:G_sharp(u,v) = F(u,v) - F_blurred(u,v) = F(u,v) * [1 - H_lp(u,v)] = F(u,v) * H_hp(u,v).
-
3. Image Restoration
Approaches to Estimate Noise Parameters:
-
Using Noise-Free Image (if available): Subtract noisy image from noise-free to get noise estimate.
-
Using Flat Regions: Identify uniform areas (e.g., sky) in the noisy image; assume variation is due to noise. Compute mean, variance.
-
Using Multiple Images: Average several noisy images of the same scene; noise averages to zero, signal adds up.
-
Statistical Modeling: Assume noise follows a distribution (Gaussian, Rayleigh, Erlang). Estimate parameters (mean μ, variance σ²) from histogram of pixel intensities or from image gradients.
Wiener Filtering:
-
Goal: Minimize Mean Square Error (MSE) between estimated true image
f̂and originalf. -
Filter in Frequency Domain:
W(u,v) = [H*(u,v) / (|H(u,v)|^2 + K)]where:
-
H(u,v)= degradation function (PSF). -
H*= complex conjugate. -
K = η / σ_f^2(η = noise power spectral density, σ_f^2 = image power spectral density). If unknown, useK ≈ 1 / SNR.
-
-
Result:
G_w(u,v) = W(u,v) * G(u,v)(G=degraded image DFT). Inverse DFT givesf̂.
Image Restoration using MMSE Filtering:
-
Wiener filter IS the MMSE filter for linear, shift-invariant degradation with additive noise, under the assumption of stationarity and known second-order statistics. It finds the linear filter that minimizes
E[(f - f̂)^2]. -
General MMSE: Can be extended to nonlinear filters (e.g., using Bayesian estimation) but Wiener is the canonical linear MMSE solution.
4. Segmentation
Region-Based Segmentation:
-
Principle: Group pixels into regions based on similarity (intensity, color, texture) and discontinuity (edges).
-
Methods:
-
Thresholding: Global (single T), variable (local T), multi-level.
-
Region Growing: Start with "seeds", add neighboring pixels with similar properties.
-
Region Splitting & Merging: Start with whole image, recursively split heterogeneous regions, then merge similar adjacent regions (quad-tree).
-
Watershed: Treat gradient magnitude as topography; "flood" from markers to segment basins.
-
Motion-Based Segmentation (vs. Region-Oriented):
-
Region-Oriented: Based on static image properties (intensity, texture).
-
Motion-Based: Uses temporal information from image sequences (video). Segments objects based on optical flow (apparent motion field). Assumes objects have coherent motion different from background/other objects. Useful for video surveillance, object tracking.
Morphological Operations (on binary images):
-
Structuring Element (SE): Simple shape (e.g., 3x3 square) used to probe and modify image.
-
Erosion:
A ⊖ B = { z | (B̂)_z ⊆ A }. Shrinks foreground. Removes small objects, separates objects.f(x,y) = min_{(s,t)∈B} g(x+s, y+t). -
Dilation:
A ⊕ B = { z | (B̂)_z ∩ A ≠ ∅ }. Expands foreground. Fills small holes/gaps.f(x,y) = max_{(s,t)∈B} g(x+s, y+t).
Morphological Algorithms:
-
Boundary Extraction:
Boundary(A) = A - (A ⊖ B). Erosion subtracted from original gives outer boundary. -
Hole Filling: For binary image with background=0, foreground=1.
-
Start with complement of object:
X_0 = complement(A). -
Let
Bbe a structuring element. -
Iterate:
X_{k+1} = (X_k ⊕ B) ∩ Auntil convergenceX_k = X_{k+1}. -
Resulting
X_kis the filled hole(s). Final filled object =A ∪ X_k.
-
5. Compression
Need for Compression:
-
Reduce storage requirements.
-
Reduce transmission bandwidth/time.
-
Enable real-time applications (video conferencing, streaming).
-
Trade-off: Compression Ratio vs. Distortion/Quality (lossy vs. lossless).
Vector Quantization (VQ) Method:
-
Principle: Lossy compression. Groups pixel blocks (vectors) into clusters.
-
Steps:
-
Training: From a set of training images, extract all image blocks (e.g., 4x4 pixels = 16-D vector). Use Lloyd-Max algorithm (or k-means) to cluster vectors into
kcodebook vectors (codewords). -
Encoding: For each new image block, find the nearest codeword (using Euclidean distance). Transmit only the index of that codeword.
-
Decoding: Use received index to look up the codeword from the same codebook and place it in the reconstructed image.
-
-
Advantage: High compression at low complexity. Disadvantage: Codebook must be known at decoder; "blocking" artifacts.
Lossy Predictive Coding:
-
Working Principle: Predict current pixel from previous (causal) pixels. Encode the prediction error (difference), which has lower entropy than the original signal.
-
Encoder Block Diagram:
Input f(n) → Predictor (from past f̂) → Subtract → Error e(n) → Quantizer → Symbol Encoder → BitstreamAlso:
Quantized error e_q(n) → Add to prediction → Reconstructed f̂(n) (for feedback). -
Decoder Block Diagram:
Bitstream → Symbol Decoder → Dequantizer → Add → Predictor (same as encoder) → Output f̂(n). -
Predictor Types: DPCM (1-D, 2-D), where prediction is linear combination of neighboring pixels.
f̂(x,y) = Σ a_i * f(x-i, y-i).
6. Advanced Topics
Texture Analysis:
-
Goal: Quantify visual patterns (smoothness, coarseness, regularity).
-
Methods:
-
Statistical: Gray-Level Co-occurrence Matrix (GLCM) → features: Contrast, Correlation, Energy, Homogeneity.
-
Model-Based: Fractal dimension, Markov random fields.
-
Filter-Based: Gabor filters, wavelet transforms (capture frequency/orientation).
-
Object Recognition:
-
Steps:
-
Segmentation: Isolate object from background.
-
Feature Extraction: Describe object (shape: moments, Fourier descriptors; color histograms; texture: GLCM; keypoints: SIFT, SURF).
-
Classification/Recognition: Match features to stored models/classes.
-
Template Matching: Direct pixel comparison.
-
Geometric Hashing: For affine invariant matching.
-
Machine Learning: Train classifiers (SVM, Neural Networks) on feature vectors.
-
-
-
Challenges: Scale, rotation, illumination variation, occlusion, viewpoint change.
[!TIP] Exam Focus: Be ready to draw block diagrams (predictive coding) and write key equations (Wiener filter, homomorphic filtering, Fourier linearity proof). For segmentation, clearly differentiate region vs. motion-based. For morphology, know the set-theoretic definitions and simple algorithms.