|
20 | 20 | [tablecloth.api :as tc] |
21 | 21 | [scicloj.tableplot.v1.plotly :as plotly])) |
22 | 22 |
|
| 23 | +^:kindly/hide-code |
| 24 | +(kind/hiccup |
| 25 | + [:style |
| 26 | + ".clay-dataset { |
| 27 | + max-height:400px; |
| 28 | + overflow-y: auto; |
| 29 | +} |
| 30 | +.printed-clojure { |
| 31 | + max-height:400px; |
| 32 | + overflow-y: auto; |
| 33 | +} |
| 34 | +"]) |
| 35 | + |
23 | 36 | ;; # Introduction: Why dtype-next for Image Processing? |
24 | 37 |
|
25 | 38 | ;; Images are perfect for learning [dtype-next](https://github.com/cnuernber/dtype-next) |
|
61 | 74 |
|
62 | 75 | ;; ## What We'll Build |
63 | 76 |
|
| 77 | +;; - **Working with Tensors** — reshaping, dataset conversion, core operations |
| 78 | +;; - **Tensor Operations Primer** — slicing, element-wise ops, type handling |
64 | 79 | ;; - **Image Statistics** — channel means, ranges, distributions, histograms |
65 | 80 | ;; - **Spatial Analysis** — gradients, edge detection, sharpness metrics |
66 | 81 | ;; - **Enhancement Pipeline** — white balance, contrast adjustment |
67 | 82 | ;; - **Accessibility** — color blindness simulation |
68 | 83 | ;; - **Convolution & Filtering** — blur, sharpen, Sobel edge detection |
69 | | -;; - **Reshape & Downsampling** — pyramids, multi-scale processing |
| 84 | +;; - **Downsampling & Multi-Scale Processing** — pyramids, multi-resolution analysis |
70 | 85 |
|
71 | 86 | ;; Each section demonstrates core dtype-next concepts with immediate practical value. |
72 | 87 |
|
@@ -168,7 +183,8 @@ original-tensor |
168 | 183 |
|
169 | 184 | ;; The [`tech.v3.dataset.tensor`](https://cnuernber.github.io/dtype-next/tech.v3.dataset.tensor.html) |
170 | 185 | ;; namespace provides conversions between tensors and datasets. The `tablecloth.api` |
171 | | -;; namespace also auto-converts 2D tensors. |
| 186 | +;; namespace of [Tablecloth](https://scicloj.github.io/tablecloth/) |
| 187 | +;; also auto-converts 2D tensors. |
172 | 188 |
|
173 | 189 | ;; Two-dimensional tensors convert naturally to tablecloth datasets, enabling |
174 | 190 | ;; tabular operations and plotting. |
@@ -1066,7 +1082,8 @@ gaussian-5x5 |
1066 | 1082 |
|
1067 | 1083 | ;; Visualize each level: |
1068 | 1084 |
|
1069 | | -(mapv bufimg/tensor->image gray-pyramid) |
| 1085 | +(kind/fragment |
| 1086 | + (mapv bufimg/tensor->image gray-pyramid)) |
1070 | 1087 |
|
1071 | 1088 | ;; **Use case**: Multi-scale edge detection for finding features at different sizes. |
1072 | 1089 |
|
@@ -1126,21 +1143,36 @@ gaussian-5x5 |
1126 | 1143 |
|
1127 | 1144 | ;; ## API Coverage |
1128 | 1145 |
|
1129 | | -;; | Function | Use Case | |
1130 | | -;; |----------|----------| |
1131 | | -;; | `dtype/shape` | Inspect tensor dimensions | |
1132 | | -;; | `dtype/elemwise-datatype` | Check element type | |
1133 | | -;; | `dtype/elemwise-cast` | Convert between types | |
1134 | | -;; | `dtype/ecount` | Total element count | |
1135 | | -;; | `tensor/select` | Extract slices, channels | |
1136 | | -;; | `tensor/compute-tensor` | Functionally construct tensors | |
1137 | | -;; | `tensor/mget` | Read single elements | |
1138 | | -;; | `dfn/mean`, `dfn/standard-deviation` | Statistics | |
1139 | | -;; | `dfn/reduce-min`, `dfn/reduce-max` | Range finding | |
1140 | | -;; | `dfn/+`, `dfn/-`, `dfn/*`, `dfn//` | Element-wise arithmetic | |
1141 | | -;; | `dfn/sqrt`, `dfn/sq` | Mathematical operations | |
1142 | | -;; | `dfn/min`, `dfn/max` | Clamping | |
1143 | | -;; | `dfn/sum` | Counting (boolean buffers) | |
| 1146 | +;; Here are the key dtype-next functions we used throughout this tutorial: |
| 1147 | + |
| 1148 | +;; **dtype namespace (tech.v3.datatype):** |
| 1149 | +;; - `dtype/shape` — Inspect tensor dimensions |
| 1150 | +;; - `dtype/elemwise-datatype` — Check element type |
| 1151 | +;; - `dtype/elemwise-cast` — Convert between types |
| 1152 | +;; - `dtype/ecount` — Total element count |
| 1153 | +;; - `dtype/as-reader` — Convert to readable sequence |
| 1154 | +;; - `dtype/get-value` — Extract scalar value |
| 1155 | + |
| 1156 | +;; **tensor namespace (tech.v3.tensor):** |
| 1157 | +;; - `tensor/compute-tensor` — Functionally construct tensors |
| 1158 | +;; - `tensor/select` — Extract slices, channels (zero-copy) |
| 1159 | +;; - `tensor/mget` — Read single elements |
| 1160 | +;; - `tensor/reshape` — Reinterpret tensor shape (zero-copy) |
| 1161 | +;; - `tensor/reduce-axis` — Reduce along specific dimension |
| 1162 | + |
| 1163 | +;; **dfn namespace (tech.v3.datatype.functional):** |
| 1164 | +;; - `dfn/+`, `dfn/-`, `dfn/*`, `dfn//` — Element-wise arithmetic |
| 1165 | +;; - `dfn/mean`, `dfn/standard-deviation` — Statistics |
| 1166 | +;; - `dfn/reduce-min`, `dfn/reduce-max` — Range finding |
| 1167 | +;; - `dfn/sqrt`, `dfn/sq` — Mathematical operations |
| 1168 | +;; - `dfn/min`, `dfn/max` — Clamping |
| 1169 | +;; - `dfn/sum` — Summation |
| 1170 | + |
| 1171 | +;; **bufimg namespace (tech.v3.libs.buffered-image):** |
| 1172 | +;; - `bufimg/load` — Load image file |
| 1173 | +;; - `bufimg/as-ubyte-tensor` — BufferedImage → tensor |
| 1174 | +;; - `bufimg/tensor->image` — tensor → BufferedImage |
| 1175 | +;; - `bufimg/image-type` — Check image format |
1144 | 1176 |
|
1145 | 1177 | ;; ## What Makes This Functional? |
1146 | 1178 |
|
|
0 commit comments