forked from Aditya-ds-1806/DIP-Algorithms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
98 lines (95 loc) · 4.86 KB
/
index.html
File metadata and controls
98 lines (95 loc) · 4.86 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
<link rel="stylesheet" href="index.css">
<title>DIP Algorithms Demo</title>
</head>
<body>
<header class="text-center my-5 py-5">
<h1 class="display-4 fw-bolder">Implementation of DIP Algorithms in JS</h1>
</header>
<main class="container pb-5 mb-5">
<section>
<header>
<h2>Transform an image \( f:X\times Y \to \{a,\dots, b\} \) to \( g:X\times Y \to \{c,\dots, d\} \)</h2>
<hr>
</header>
<main>
<div class="mb-4">
<h4>Algorithm</h4>
<ol class="list-unstyled fw-bold">
<li>Step 1: \( min = Min\{f(x,y) | 0 \leq x \leq m-1, 0 \leq y \leq n-1 \} \)</li>
<li>Step 2: \( g(x,y) = f(x, y) - min \)</li>
<li>Step 3: \( max = Max\{g(x,y) | 0 \leq x \leq m-1, 0 \leq y \leq n-1 \} \)</li>
<li>Step 4: \( g(x,y) = \dfrac{g(x, y)}{max} \)</li>
<li>Step 5: \( g(x,y) = (d-c)\cdot g(x,y) \)</li>
<li>Step 6: \( g(x,y) = g(x,y) + c \)</li>
</ol>
</div>
<div class="row">
<h4>Demo</h4>
<div class="col-md-4 mb-4">
<figure class="figure">
<canvas class="figure-img img-fluid rounded base-image"></canvas>
<figcaption class="figure-caption text-center fs-6">Base Image</figcaption>
</figure>
</div>
<div class="col-md-4 mb-4">
<figure class="figure">
<canvas class="figure-img img-fluid rounded greyscale-image"></canvas>
<figcaption class="figure-caption text-center fs-6">Greyscale Image</figcaption>
</figure>
</div>
<div class="col-md-4 mb-4">
<figure class="figure">
<canvas class="figure-img img-fluid rounded processed-image"></canvas>
<figcaption class="figure-caption text-center fs-6">Processed Image</figcaption>
</figure>
</div>
</div>
</main>
<footer>
<p>Enter min and max pixel values in processed image \( (min \geq 0 \) and \( max \leq 255)\)</p>
<div class="input-group mb-3">
<input type="file" class="form-control" accept="image/*" id="customImage">
<label class="input-group-text" for="customImage">Upload</label>
</div>
<p class="text-center fw-bold">OR</p>
<div class="input-group mb-3">
<label class="input-group-text" for="URLImage">Paste Image URL</label>
<input type="url" class="form-control" placeholder="https://picsum.photos/200/300" id="URLImage">
</div>
<div class="input-group my-3">
<span class="input-group-text">Minimum \( (c) \)</span>
<input type="number" id="min" class="form-control" min="0" max="255" value="20" placeholder="0">
<span class="input-group-text">Maximum \( (d) \)</span>
<input type="number" id="max" class="form-control" min="0" max="255" value="70" placeholder="50">
</div>
</footer>
</section>
</main>
<footer class="text-center alert-danger py-5">
<div class="py-3">
<p>
Made with ❤️ and
<a href="http://vanilla-js.com/" class="text-decoration-none">
<img src="http://vanilla-js.com/assets/button.png">
</a>
in 🇮🇳
</p>
<a href="https://github.com/Aditya-ds-1806/DIP-Algorithms" class="text-reset text-decoration-none">
<img class="img-fluid" width="100"
src="https://github.githubassets.com/images/modules/logos_page/GitHub-Logo.png" alt="GitHub">
<img class="img-fluid" width="50"
src="https://github.githubassets.com/images/modules/logos_page/Octocat.png" alt="GitHub">
</a>
</div>
</footer>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<script src="index.js"></script>
</body>
</html>