-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
323 lines (306 loc) · 24.4 KB
/
index.html
File metadata and controls
323 lines (306 loc) · 24.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Digital Image Processing Lab | CSU2543</title>
<meta name="description" content="Digital Image Processing Practical Lab - CSU2543. 8 interactive practicals. Shoolini University.">
<meta name="author" content="Divya Mohan">
<script>(function(){var t=localStorage.getItem('dip-theme');if(!t){t=window.matchMedia&&window.matchMedia('(prefers-color-scheme:dark)').matches?'dark':'light';}document.documentElement.setAttribute('data-theme',t);})();</script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<script async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<link rel="stylesheet" href="./css/base.css">
<link rel="stylesheet" href="./css/components.css">
<style>
.hero { text-align: center; padding: clamp(2rem, 1rem + 4vw, 4rem) 0 clamp(1rem, 0.5rem + 2vw, 2rem); }
.hero h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3.25rem); font-weight: 700; letter-spacing: -0.04em; color: var(--text); margin-bottom: 0.75rem; }
.hero p { color: var(--text-muted); font-size: clamp(0.95rem, 0.85rem + 0.5vw, 1.15rem); max-width: 540px; margin: 0 auto; line-height: 1.6; }
.hero .hero-badge { display: inline-block; padding: 0.3rem 1rem; border-radius: var(--radius-full); background: var(--accent-light); color: var(--accent); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.05em; margin-bottom: 1rem; }
.practical-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; padding: 1rem 0 3rem; }
@media (max-width: 640px) { .practical-grid { grid-template-columns: 1fr; } }
.practical-card { display: flex; flex-direction: column; gap: 0.5rem; padding: 2rem; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg); text-decoration: none; color: var(--text); position: relative; overflow: hidden; transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.25s var(--ease-spring); }
.practical-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent); opacity: 0; transition: opacity 0.2s ease; }
.practical-card:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); transform: translateY(-4px); color: var(--text); text-decoration: none; }
.practical-card:hover::before { opacity: 1; }
.practical-card:active { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.card-number { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.04em; color: var(--accent); opacity: 0.2; line-height: 1; }
.card-chapter { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.card-title { font-size: 1.15rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.02em; }
.card-desc { font-size: 0.875rem; line-height: 1.6; color: var(--text-muted); }
.card-arrow { margin-top: auto; color: var(--accent); font-size: 0.85rem; font-weight: 600; opacity: 0; transform: translateX(-8px); transition: opacity 0.2s, transform 0.2s var(--ease-spring); }
.practical-card:hover .card-arrow { opacity: 1; transform: translateX(0); }
</style>
</head>
<body>
<a href="#main-content" class="skip-link">Skip to main content</a>
<nav class="navbar navbar-expand-lg sticky-top dip-navbar" id="mainNav" aria-label="Main navigation">
<div class="container">
<a class="navbar-brand fw-semibold" href="./index.html">DIP Lab</a>
<button class="navbar-toggler border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto gap-1">
<li class="nav-item"><a class="nav-link" href="./index.html" data-page="index">Home</a></li>
<li class="nav-item"><a class="nav-link" href="./p1.html" data-page="p1">P1</a></li>
<li class="nav-item"><a class="nav-link" href="./p2.html" data-page="p2">P2</a></li>
<li class="nav-item"><a class="nav-link" href="./p3.html" data-page="p3">P3</a></li>
<li class="nav-item"><a class="nav-link" href="./p4.html" data-page="p4">P4</a></li>
<li class="nav-item"><a class="nav-link" href="./p5.html" data-page="p5">P5</a></li>
<li class="nav-item"><a class="nav-link" href="./p6.html" data-page="p6">P6</a></li>
<li class="nav-item"><a class="nav-link" href="./p7.html" data-page="p7">P7</a></li>
<li class="nav-item"><a class="nav-link" href="./p8.html" data-page="p8">P8</a></li>
</ul>
<button id="themeToggle" class="btn btn-sm ms-3 theme-toggle" type="button" aria-label="Toggle theme">
<span class="theme-toggle-label">Dark</span>
</button>
</div>
</div>
</nav>
<!-- Print cover page -->
<div class="print-only print-cover" aria-hidden="true">
<img class="cover-logo" src="https://shooliniuniversity.com/assets/images/logo.png" alt="Shoolini University Logo">
<div class="cover-university">Shoolini University</div>
<div class="cover-dept">Faculty of Engineering & Technology<br>Department of Computer Science & Engineering</div>
<div class="cover-rule"></div>
<div class="cover-subject">Digital Image Processing</div>
<div class="cover-code">Course Code: CSU2543</div>
<div class="cover-practical">Practical Lab Report — Complete</div>
<table class="cover-table">
<tr><td>Submitted by:</td><td>Divya Mohan</td></tr>
<tr><td>Programme:</td><td>B.Tech CSE (Cybersecurity)</td></tr>
<tr><td>Semester:</td><td>8th</td></tr>
<tr><td>Faculty Guide:</td><td>Ishani Sharma</td></tr>
<tr><td>Reference Text:</td><td>Gonzalez & Woods, <em>Digital Image Processing</em>, 3rd Ed.</td></tr>
</table>
<div class="cover-rule-sm"></div>
<div class="cover-session">Academic Session 2025–2026</div>
</div>
<div class="print-only print-header" aria-hidden="true">
<div class="ph-line">Shoolini University · CSU2543 · Digital Image Processing · Divya Mohan</div>
</div>
<main id="main-content">
<div class="container">
<!-- Hero Section -->
<section class="hero">
<span class="hero-badge">CSU2543</span>
<h1>Digital Image Processing Lab</h1>
<p>8 interactive practicals covering Gonzalez & Woods 3rd Edition. Shoolini University.</p>
</section>
<!-- Practical Cards -->
<div class="practical-grid" role="list">
<a href="./p1.html" class="practical-card" role="listitem">
<span class="card-number">01</span>
<span class="card-chapter">G&W Ch 2</span>
<span class="card-title">Loading & Displaying Images</span>
<span class="card-desc">Load digital images, inspect properties, display histograms, and compare multiple images.</span>
<span class="card-arrow">Explore →</span>
</a>
<a href="./p2.html" class="practical-card" role="listitem">
<span class="card-number">02</span>
<span class="card-chapter">G&W Ch 2</span>
<span class="card-title">Impact of Sampling Rate on Spatial Resolution</span>
<span class="card-desc">Progressive downsampling to analyze sampling rate and spatial resolution.</span>
<span class="card-arrow">Explore →</span>
</a>
<a href="./p3.html" class="practical-card" role="listitem">
<span class="card-number">03</span>
<span class="card-chapter">G&W Ch 2–3</span>
<span class="card-title">Negation, Subtraction & Inversion</span>
<span class="card-desc">Image negation, absolute difference subtraction, and intensity inversion with medical imaging.</span>
<span class="card-arrow">Explore →</span>
</a>
<a href="./p4.html" class="practical-card" role="listitem">
<span class="card-number">04</span>
<span class="card-chapter">G&W Ch 3</span>
<span class="card-title">Gamma Correction & Power Law Transformations</span>
<span class="card-desc">Power law transformations, log transforms, and contrast enhancement for dark and bright images.</span>
<span class="card-arrow">Explore →</span>
</a>
<a href="./p5.html" class="practical-card" role="listitem">
<span class="card-number">05</span>
<span class="card-chapter">G&W Ch 3</span>
<span class="card-title">Histogram Equalization</span>
<span class="card-desc">Enhance contrast via CDF-based intensity redistribution, transfer functions, and PDF/CDF analysis.</span>
<span class="card-arrow">Explore →</span>
</a>
<a href="./p6.html" class="practical-card" role="listitem">
<span class="card-number">06</span>
<span class="card-chapter">G&W Ch 3</span>
<span class="card-title">Histogram Matching & Specification</span>
<span class="card-desc">Transform image histograms to match target distributions via CDF inversion and multi-target comparison.</span>
<span class="card-arrow">Explore →</span>
</a>
<a href="./p7.html" class="practical-card" role="listitem">
<span class="card-number">07</span>
<span class="card-chapter">G&W Ch 3</span>
<span class="card-title">2D Correlation & Convolution</span>
<span class="card-desc">Implement correlation and convolution from first principles, demonstrate the impulse response, and apply standard kernels to a real image.</span>
<span class="card-arrow">Explore →</span>
</a>
<a href="./p8.html" class="practical-card" role="listitem">
<span class="card-number">08</span>
<span class="card-chapter">G&W Ch 3</span>
<span class="card-title">Spatial Filtering: Smoothing & Sharpening</span>
<span class="card-desc">Box and median filters for noise smoothing; Laplacian and Sobel operators for sharpening and edge detection.</span>
<span class="card-arrow">Explore →</span>
</a>
</div>
<!-- Print-only Table of Contents -->
<section class="print-only print-toc" aria-hidden="true">
<h2>Table of Contents</h2>
<ol>
<li><a href="#print-p1">Practical 1 — Loading & Displaying Images</a></li>
<li><a href="#print-p2">Practical 2 — Impact of Sampling Rate on Spatial Resolution</a></li>
<li><a href="#print-p3">Practical 3 — Negation, Subtraction & Inversion</a></li>
<li><a href="#print-p4">Practical 4 — Gamma Correction & Power Law Transformations</a></li>
<li><a href="#print-p5">Practical 5 — Histogram Equalization</a></li>
<li><a href="#print-p6">Practical 6 — Histogram Matching & Specification</a></li>
<li><a href="#print-p7">Practical 7 — 2D Correlation & Convolution</a></li>
<li><a href="#print-p8">Practical 8 — Spatial Filtering: Smoothing & Sharpening</a></li>
</ol>
</section>
<!-- Print-only Practical Summaries -->
<section class="print-only print-summary" id="print-p1" aria-hidden="true">
<h2>Practical 1 — Loading & Displaying Images</h2>
<p><strong>Reference:</strong> Gonzalez & Woods, Ch 2</p>
<h3>Objective</h3>
<p>Load digital images, inspect properties such as dimensions, data type, and colour channels, display histograms, and compare multiple images side by side.</p>
<h3>Theory</h3>
<p>A digital image is a two-dimensional function <em>f(x, y)</em> where <em>x</em> and <em>y</em> are spatial coordinates and the amplitude of <em>f</em> at any pair of coordinates is the intensity or grey level. Loading and displaying images is the foundational step in any image processing pipeline. The histogram of an image shows the distribution of pixel intensities, providing insight into contrast, brightness, and dynamic range.</p>
<h3>Key Concepts</h3>
<ul>
<li>Image representation as NumPy arrays (height × width × channels)</li>
<li>Colour spaces: RGB, BGR (OpenCV default), Grayscale</li>
<li>Image properties: shape, dtype, size, min/max intensity</li>
<li>Histogram computation and visualization</li>
</ul>
</section>
<section class="print-only print-summary" id="print-p2" aria-hidden="true">
<h2>Practical 2 — Impact of Sampling Rate on Spatial Resolution</h2>
<p><strong>Reference:</strong> Gonzalez & Woods, Ch 2</p>
<h3>Objective</h3>
<p>Demonstrate how reducing the sampling rate (downsampling) degrades spatial resolution, and observe aliasing artefacts that emerge at lower resolutions.</p>
<h3>Theory</h3>
<p>Spatial resolution is determined by the sampling rate applied during digitization. According to the Nyquist–Shannon sampling theorem, the sampling rate must be at least twice the highest frequency present in the image to avoid aliasing. Progressive downsampling by factors of 2 reveals how detail is lost and artefacts are introduced.</p>
<h3>Key Concepts</h3>
<ul>
<li>Sampling and quantization</li>
<li>Nyquist–Shannon sampling theorem</li>
<li>Spatial resolution vs pixel dimensions</li>
<li>Aliasing artefacts at low sampling rates</li>
<li>Nearest-neighbour vs bilinear interpolation for resizing</li>
</ul>
</section>
<section class="print-only print-summary" id="print-p3" aria-hidden="true">
<h2>Practical 3 — Negation, Subtraction & Inversion</h2>
<p><strong>Reference:</strong> Gonzalez & Woods, Ch 2–3</p>
<h3>Objective</h3>
<p>Apply image negation, absolute difference subtraction between image pairs, and intensity inversion, with applications in medical imaging such as enhancing features in X-ray and mammography images.</p>
<h3>Theory</h3>
<p>Image negation applies the transform <em>s = L − 1 − r</em> where <em>L</em> is the number of intensity levels. This is useful for enhancing white or grey detail in dark regions. Image subtraction computes the absolute difference between two images, useful for change detection and background removal. These point-processing operations form the basis of intensity transformations.</p>
<h3>Key Concepts</h3>
<ul>
<li>Image negative: <em>s = (L − 1) − r</em></li>
<li>Absolute difference: |<em>f</em>(x,y) − <em>g</em>(x,y)|</li>
<li>Applications in medical imaging (mammograms, X-rays)</li>
<li>Bitwise NOT operation for inversion</li>
</ul>
</section>
<section class="print-only print-summary" id="print-p4" aria-hidden="true">
<h2>Practical 4 — Gamma Correction & Power Law Transformations</h2>
<p><strong>Reference:</strong> Gonzalez & Woods, Ch 3</p>
<h3>Objective</h3>
<p>Apply power law (gamma) transformations and logarithmic transforms to adjust image contrast, enhancing detail in dark and bright images.</p>
<h3>Theory</h3>
<p>The power law transformation is defined as <em>s = c · r<sup>γ</sup></em> where <em>c</em> and <em>γ</em> are positive constants. When γ < 1, the mapping expands dark intensities and compresses bright ones (brightening). When γ > 1, the opposite occurs (darkening). The log transform <em>s = c · log(1 + r)</em> compresses the dynamic range, useful for displaying Fourier spectra.</p>
<h3>Key Concepts</h3>
<ul>
<li>Power law: <em>s = c · r<sup>γ</sup></em></li>
<li>Log transform: <em>s = c · log(1 + r)</em></li>
<li>Gamma < 1 for brightening, γ > 1 for darkening</li>
<li>CRT/display gamma correction</li>
<li>Contrast enhancement for under/overexposed images</li>
</ul>
</section>
<section class="print-only print-summary" id="print-p5" aria-hidden="true">
<h2>Practical 5 — Histogram Equalization</h2>
<p><strong>Reference:</strong> Gonzalez & Woods, Ch 3</p>
<h3>Objective</h3>
<p>Enhance image contrast using histogram equalization, analysing the transfer function, and comparing PDF and CDF before and after equalization.</p>
<h3>Theory</h3>
<p>Histogram equalization is a technique that adjusts intensities to produce a more uniform histogram, thereby enhancing global contrast. The transformation function is derived from the cumulative distribution function (CDF) of the original histogram: <em>s<sub>k</sub> = (L − 1) · CDF(r<sub>k</sub>)</em>. The result spreads out the most frequent intensity values, improving contrast in images with narrow histograms.</p>
<h3>Key Concepts</h3>
<ul>
<li>Probability density function (PDF) of intensities</li>
<li>Cumulative distribution function (CDF)</li>
<li>Transfer function: <em>s<sub>k</sub> = (L − 1) · CDF(r<sub>k</sub>)</em></li>
<li>Global vs local (CLAHE) histogram equalization</li>
<li>Contrast-limited adaptive histogram equalization</li>
</ul>
</section>
<section class="print-only print-summary" id="print-p6" aria-hidden="true">
<h2>Practical 6 — Histogram Matching & Specification</h2>
<p><strong>Reference:</strong> Gonzalez & Woods, Ch 3</p>
<h3>Objective</h3>
<p>Transform image histograms to match target distributions via CDF inversion. Compare histogram matching across multiple target images and analyse the transfer function.</p>
<h3>Theory</h3>
<p>Histogram matching (specification) generalises histogram equalization by mapping the source image’s CDF to a desired target CDF. Given source CDF <em>CDF<sub>s</sub></em> and target CDF <em>CDF<sub>t</sub></em>, the mapping is: <em>z = CDF<sub>t</sub><sup>−1</sup>(CDF<sub>s</sub>(r))</em>. For each source intensity <em>r</em>, we find the target intensity <em>z</em> whose CDF value most closely matches <em>CDF<sub>s</sub>(r)</em>.</p>
<h3>Key Concepts</h3>
<ul>
<li>CDF inversion for histogram specification</li>
<li>Lookup table (LUT) construction from CDF matching</li>
<li>Multi-target histogram comparison</li>
<li>Transfer function analysis and verification</li>
</ul>
</section>
<section class="print-only print-summary" id="print-p7" aria-hidden="true">
<h2>Practical 7 — 2D Correlation & Convolution</h2>
<p><strong>Reference:</strong> Gonzalez & Woods, Ch 3</p>
<h3>Aim</h3>
<p>Implement and analyze 2D correlation and convolution from first principles, demonstrate the impulse-response interpretation that distinguishes them, and apply standard kernels to a real image.</p>
<h3>Theory</h3>
<p>For an image <em>f</em> and kernel <em>w</em> of size <em>m×n</em>: correlation is <em>(w ⋆ f)(x,y) = ∑ w(s,t) f(x+s,y+t)</em> and convolution is <em>(w ∗ f)(x,y) = ∑ w(s,t) f(x−s,y−t)</em>. The two satisfy the identity <em>w ∗ f = rot<sub>180</sub>(w) ⋆ f</em>, so a unit impulse reveals correlation as <em>rot<sub>180</sub>(w)</em> and convolution as <em>w</em>.</p>
<h3>Key Concepts</h3>
<ul>
<li>2D correlation and convolution by direct summation</li>
<li>Zero padding and boundary handling</li>
<li>Impulse-response interpretation as the operational definition</li>
<li>Symmetric kernels: when correlation equals convolution</li>
<li>Standard kernels: box, Laplacian, Sobel</li>
</ul>
</section>
<section class="print-only print-summary" id="print-p8" aria-hidden="true">
<h2>Practical 8 — Spatial Filtering: Smoothing and Sharpening</h2>
<p><strong>Reference:</strong> Gonzalez & Woods, Ch 3</p>
<h3>Aim</h3>
<p>Implement and analyze the four canonical spatial-domain filters: box and median filters for smoothing, and Laplacian and Sobel operators for sharpening and edge detection.</p>
<h3>Theory</h3>
<p>The box filter <em>&hat;f = (1/mn)∑ f</em> is a linear smoother. The median filter <em>&hat;f = median{f}</em> is non-linear and edge-preserving, ideal for impulse noise. The Laplacian <em>∇<sup>2</sup>f ≈ f<sub>N</sub>+f<sub>S</sub>+f<sub>E</sub>+f<sub>W</sub> − 4f</em> sharpens via <em>g = f − ∇<sup>2</sup>f</em>. The Sobel operator combines first-derivative kernels <em>G<sub>x</sub>, G<sub>y</sub></em>, with magnitude <em>|G| ≈ |G<sub>x</sub>|+|G<sub>y</sub>|</em> and direction <em>θ = arctan(G<sub>y</sub>/G<sub>x</sub>)</em>.</p>
<h3>Key Concepts</h3>
<ul>
<li>Box (mean) filter and its low-pass behaviour</li>
<li>Median filter as an order-statistic, edge-preserving smoother</li>
<li>Edge preservation: median vs box under impulse noise</li>
<li>Laplacian sharpening (4-neighbour and 8-neighbour kernels)</li>
<li>Sobel gradient: magnitude, direction, and threshold</li>
</ul>
</section>
</div>
</main>
<footer class="site-footer" aria-label="Site footer">
<div class="container">
<p>CSU2543 Digital Image Processing · Shoolini University · Divya Mohan · Ishani Sharma</p>
</div>
</footer>
<div id="toast" class="toast" role="status" aria-live="polite" aria-atomic="true"></div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="./js/core.js"></script>
<script src="./js/theme.js"></script>
<script src="./js/nav.js"></script>
<script src="./js/interactive.js"></script>
</body>
</html>