1
1
# [ Quickstart] (@id page_quickstart)
2
2
3
+ ``` @setup array
4
+ using Images, ImageDraw
5
+
6
+ make_roi(tl::Point, br::Point) = Polygon([tl, Point(br.x, tl.y), br, Point(tl.x, br.y)])
7
+ make_roi(xs::UnitRange, ys::UnitRange) = make_roi(Point(ys[1], xs[1]), Point(ys[end], xs[end]))
8
+ ```
9
+
3
10
If you're comfortable with Julia or have used another image-processing
4
11
package before, this page may help you get started quickly. If some of
5
12
the terms or concepts here seem strange, don't worry---there are much
6
13
more detailed explanations in the following sections.
7
14
8
- ## Images are just arrays
9
-
10
- ``` @setup array
11
- using Images, ImageDraw
15
+ To start with, let's load the ` Images.jl ` package:
12
16
13
- make_roi(tl::Point, br::Point) = Polygon([tl, Point(br.x, tl.y), br, Point(tl.x, br.y)])
14
- make_roi(xs::UnitRange, ys::UnitRange) = make_roi(Point(ys[1], xs[1]), Point(ys[end], xs[end]))
17
+ ``` @repl array
18
+ using Images
15
19
```
16
20
21
+ ## Images are just arrays
22
+
17
23
For most purposes, any ` AbstractArray ` can be treated as an image. For example, numeric array can be interpreted as a grayscale image.
18
24
19
25
``` @repl array
@@ -23,6 +29,9 @@ img = rand(4, 3)
23
29
Gray.(img) #hide
24
30
```
25
31
32
+ Don't worry if you don't get the "image" result, that's expected because it's actually recognized as a numerical array
33
+ and not an image. You will learn how to automatically display an image later in JuliaImages.
34
+
26
35
We could also select a region-of-interest from a larger image
27
36
28
37
``` @example array
@@ -69,9 +78,6 @@ draw!(out, roi_v_boundary, RGB{Float64}(0, 0, 1)) # hide
69
78
draw!(out, roi_v, RGB{Float64}(0, 0, 1)) # hide
70
79
```
71
80
72
- Don't worry if you don't get the "image" result, that's expected and you'll
73
- learn how to automatically display an image later in JuliaImages.
74
-
75
81
Some add-on packages enable additional behavior. For example,
76
82
77
83
``` @example array
0 commit comments