Skip to content

Commit 65fc4ec

Browse files
committedJan 17, 2025·
Comes
1 parent 75097c5 commit 65fc4ec

18 files changed

+450
-27
lines changed
 

‎Project.toml

+3-10
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,20 @@ ArchGDAL = "c9ce4bd3-c3d5-55b8-8973-c0e20141b8c3"
44
Chain = "8be319e6-bccf-4806-a6f7-6fae938471bc"
55
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
66
ColorVectorSpace = "c3611d14-8923-5661-9e6a-0046d554d3a4"
7-
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
87
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
9-
#DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
108
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
119
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
1210
Franklin = "713c75ef-9fc9-4b05-94a9-213340da978e"
1311
GMT = "5752ebe1-31b9-557e-87aa-f909b540aa54"
1412
Gumbo = "708ec375-b3d6-5a57-a7ce-8257bf98657a"
15-
ImageCore = "a09fc81d-aa75-5fe9-8630-4744c3626534"
16-
ImageIO = "82e4d734-157c-48bb-816b-45c225c6df19"
17-
ImageMagick = "6218d12a-5da1-5696-b52f-db25d2ecc6d1"
18-
ImageTransformations = "02fcd773-0e25-5acc-982a-7f6622650795"
13+
#ImageCore = "a09fc81d-aa75-5fe9-8630-4744c3626534"
14+
#ImageIO = "82e4d734-157c-48bb-816b-45c225c6df19"
15+
#ImageMagick = "6218d12a-5da1-5696-b52f-db25d2ecc6d1"
1916
JSServe = "824d6782-a2ef-11e9-3a09-e5662e0c26f9"
20-
#Meshes = "eacbb407-ea5a-433e-ab97-5258b1ca43fa"
2117
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
2218
NodeJS = "2bd173c7-0d6d-553b-b6af-13a54713934c"
2319
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
2420
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
2521
RasterDataSources = "3cb90ccd-e1b6-4867-9617-4276c8b2ca36"
2622
Rasters = "a3a2b9e3-a471-40c9-b274-f788e487c689"
2723
RemoteS = "26020ff4-e92a-488e-a723-09c28e89e04a"
28-
#SatelliteToolboxPropagators = "c2b69894-ea78-4e2b-9ba6-cedbbc3d14d7"
29-
#SatelliteToolboxTle = "7ff27aeb-5fff-4337-a9ee-a9fe6b7ed35e"
30-
#SatelliteToolboxTransformations = "6b019ec1-7a1e-4f04-96c7-a9db1ca5514d"

‎_libs/lunr/lunr_index.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎documentation/all_docs_ref/all_refs.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,14 @@ its use requires resorting to the \myreflink{Monolithic} mode.
5959

6060
{{ generate_tablerefs solids}}
6161

62-
## IP functions
62+
## Image Processing functions
6363

6464
| | | | | | | | |
6565
|:-----|:----|:----|:----|:----|:----|:----|:----|
66-
| \myreflink{binarize} | \myreflink{fillsinks} | \myreflink{imclose} | \myreflink{imcomplement} | \myreflink{imdilate} | \myreflink{imerode} | \myreflink{imfill} | \myreflink{imopen} |
67-
| \myreflink{imreconstruct} | \myreflink{isodata} | \myreflink{padarray} | \myreflink{strel} | \myreflink{rgb2gray} | | \myreflink{rgb2lab} | \myreflink{rgb2ycbcr} | |
68-
66+
| \myreflink{binarize} | \myreflink{bwhitmiss} | \myreflink{bwperim} | \myreflink{bwskell} | \myreflink{fillsinks} | \myreflink{imbothat} | \myreflink{imclose} | \myreflink{imcomplement} |
67+
| \myreflink{imdilate} | \myreflink{imerode} | \myreflink{imfill} | \myreflink{imhdome} | \myreflink{imhmin} | \myreflink{imhmax} | \myreflink{immorphgrad} | \myreflink{imopen} |
68+
| \myreflink{imreconstruct} | \myreflink{imtophat} | \myreflink{isodata} | \myreflink{padarray} | \myreflink{strel} | \myreflink{rgb2gray} | \myreflink{rgb2lab} | \myreflink{rgb2ycbcr} |
69+
6970

7071
## GDAL utility functions
7172

‎documentation/utilities/bwhitmiss.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# bwhitmiss
2+
3+
```julia
4+
J = bwhitmiss(I::Union{GMTimage{<:UInt8, 2}, GMTimage{<:Bool, 2}}, interval::Matrix{<:Integer})::GMTimage
5+
```
6+
7+
*keywords: GMT, Julia, image morphology, Hit-Miss*
8+
9+
Performs the hit-miss operation on a binary image defined in terms of a matrix called an _interval_.
10+
11+
An _interval_ is a matrix whose elements are 0 or 1 or 2 and results from _joining_ two structural
12+
elements SE1 and SE2. 0's are ignored. The 1's make up the domain of SE1 and the 2's the domain of SE2.
13+
14+
### Args
15+
- `I::Union{GMTimage{<:UInt8, 2}, GMTimage{<:Bool, 2}}`: Input image.
16+
17+
### Kwargs
18+
- `hsize::Int=3`: Horizontal size of the 'box' structuring element.
19+
20+
- `vsize::Int=3`: Vertical size of the 'box' structuring element.
21+
22+
- `smooth::Int=0`: Half-width of convolution smoothing filter. The width is (2 * smoothing + 1), so 0 is a no-op.
23+
24+
### Returns
25+
A new \myreflink{GMTimage} of the same type as `I` with the hitmiss applied.
26+
27+
Example
28+
-------
29+
30+
Consider the task of locating upper-left corner pixels of objects in an bw image. We want to locate
31+
foreground pixels that have east and south neighbors (these are 'hits') and that have no northeast, northwest,
32+
west or southwest neighbors (these are 'misses'). These requirements lead to the following interval matrix:
33+
34+
\begin{examplefig}{}
35+
```julia
36+
using GMT
37+
38+
interval = [2 2 2; 2 1 1; 2 1 0];
39+
I = gmtread(TESTSDIR * "assets/small_squares.png");
40+
J = bwhitmiss(I, interval);
41+
grdimage(I, figsize=6)
42+
grdimage!(J, figsize=6, xshift=6.05, show=true)
43+
```
44+
\end{examplefig}
45+
46+
47+
See Also
48+
--------
49+
50+
\myreflink{imdilate}, \myreflink{imerode}

‎documentation/utilities/bwperim.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# bwperim
2+
3+
```julia
4+
J = bwperim(I::Union{GMTimage{<:UInt8, 2}, GMTimage{<:Bool, 2}}; hsize=3, vsize=3, sel=nothing)::GMTimage
5+
```
6+
7+
*keywords: GMT, Julia, image morphology, Gradient Morphology*
8+
9+
Find perimeter of objects in binary image I.
10+
11+
A pixel is part of the perimeter if it is nonzero and it is connected to at least one zero-valued pixel.
12+
To detect the image's perimeter, the structuring element should a box of size `3 x 3` (or, better, use the defaults),
13+
but a different sizes can be provided. This operation, consisting on subtracting an erosion of `I` from `I`,
14+
is alsoknown as a morphological `internal gradient`.
15+
16+
### Args
17+
- `I::Union{GMTimage{<:UInt8, 2}, GMTimage{<:Bool, 2}}`: Input image.
18+
19+
### Kwargs
20+
- `hsize::Int=3`: Horizontal size of the 'box' structuring element.
21+
22+
- `vsize::Int=3`: Vertical size of the 'box' structuring element.
23+
24+
- `sel=nothing`: Structuring element (See \myreflink{strel} function). An alternative to `hsize` and `vsize` options.
25+
If equal to `nothing`, a structuring box of size `hsize` x `vsize` is used.
26+
27+
### Returns
28+
A new \myreflink{GMTimage} of the same type as `I` with the perimeter.
29+
30+
Example
31+
-------
32+
33+
The result will look like the outline of the object.
34+
35+
\begin{examplefig}{}
36+
```julia
37+
using GMT
38+
39+
I = gmtread(TESTSDIR * "assets/circles.png");
40+
J = bwperim(I);
41+
grdimage(I, figsize=6)
42+
grdimage!(J, figsize=6, xshift=6, show=true)
43+
```
44+
\end{examplefig}
45+
46+
47+
See Also
48+
--------
49+
50+
\myreflink{imdilate}, \myreflink{imerode}, \myreflink{strel}

‎documentation/utilities/bwskell.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# bwskell
2+
3+
```julia
4+
J = bwskell(I::Union{GMTimage{<:UInt8, 2}, GMTimage{<:Bool, 2}}; type::Int=1, maxiters::Int=0, conn::Int=4)::GMTimage
5+
```
6+
7+
*keywords: GMT, Julia, image morphology, Thinning, Skeletonize*
8+
9+
Reduce all objects to lines in 2-D binary image.
10+
11+
Reduces all objects in the 2-D binary image `I` to 1-pixel wide curved lines, without changing the essential
12+
structure of the image. This process, called skeletonization, extracts the centerline while preserving the topology.
13+
14+
### Args
15+
- `I::Union{GMTimage{<:UInt8, 2}, GMTimage{<:Bool, 2}}`: Input image.
16+
17+
### Kwargs
18+
- `type::Int=1`: 1 To thin the foreground (normal situation), or 2 to thin the background.
19+
20+
- `maxiters::Int=0`: Maximum number of iterations allowed. Use 0 to iterate untill completion.
21+
22+
- `conn::Int=4`: 4 for 4-connectivity, 8 for 8-connectivity.
23+
24+
### Returns
25+
A new \myreflink{GMTimage} of the same type as `I` with the skeleton.
26+
27+
Example
28+
-------
29+
30+
Skeletonize a binary image.
31+
32+
\begin{examplefig}{}
33+
```julia
34+
using GMT
35+
36+
I = gmtread(TESTSDIR * "assets/bone.png");
37+
J = bwskell(I);
38+
grdimage(I, figsize=6)
39+
grdimage!(J, figsize=6, xshift=6, show=true)
40+
```
41+
\end{examplefig}

‎documentation/utilities/imbothat.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# imbothat
2+
3+
```julia
4+
J = imbothat(I::Union{GMTimage{<:UInt8, 2}, GMTimage{<:Bool, 2}}; hsize=3, vsize=3)::GMTimage
5+
```
6+
7+
*keywords: GMT, Julia, image morphology, bothat*
8+
9+
Do a morphological bop-hat operation on a grayscale or binary image.
10+
11+
Bottom-hat computes the morphological closing of the image and does a: `closing - orig_image`
12+
This transform isolates pixels that are darker than other pixels in their neighborhood.
13+
14+
### Args
15+
- `I::Union{GMTimage{<:UInt8, 2}, GMTimage{<:Bool, 2}}`: Input image.
16+
17+
### Kwargs
18+
- `hsize::Int=3`: Horizontal size of the 'box' structuring element.
19+
20+
- `vsize::Int=3`: Vertical size of the 'box' structuring element.
21+
22+
### Returns
23+
A new \myreflink{GMTimage} of the same type as `I` with the bothat applied.
24+
25+
26+
See Also
27+
--------
28+
29+
\myreflink{imdilate}, \myreflink{imerode}, \myreflink{imopen}, \myreflink{imtophat}

‎documentation/utilities/imclose.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,24 @@ The closing is performed with a matrix of 0’s and 1’s with width `hsize` and
1414
with the structuring element \myreflink{strel}. Later case is faster but it is only available for binary images, where by
1515
_binary_ images we mean Boolean images or images with only 0’s and 1’s of UInt8 type.
1616

17+
### Args
18+
- `I::Union{GMTimage{<:UInt8, 2}, GMTimage{<:Bool, 2}}`: Input image.
19+
20+
### Kwargs
21+
- `hsize::Int=3`: Horizontal size of the 'box' structuring element.
22+
23+
- `vsize::Int=3`: Vertical size of the 'box' structuring element.
24+
25+
- `sel=nothing`: Structuring element (See \myreflink{strel} function). An alternative to `hsize` and `vsize` options.
26+
If equal to ``nothing``, a structuring box of size `hsize` x `vsize` is used.
27+
1728
### Returns
1829
A new \myreflink{GMTimage} of the same type as `I` with the closing applied.
1930

2031
Example
2132
-------
2233

23-
Erosion with a disk radius of 10, 5 and 20
34+
Illustration of closing with a structuring box of width 20
2435

2536
\begin{examplefig}{}
2637
```julia
@@ -37,4 +48,4 @@ grdimage!(J, figsize=7, xshift=7.1, show=true)
3748
See Also
3849
--------
3950

40-
\myreflink{imdilate}, \myreflink{imerode}, \myreflink{imopeb}, \myreflink{strel}
51+
\myreflink{imdilate}, \myreflink{imerode}, \myreflink{imopen}, \myreflink{strel}

‎documentation/utilities/imdilate.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ The dilation is performed with a matrix of 0’s and 1’s with width `hsize` an
1212
with the structuring element \myreflink{strel}. Later case is faster but it is only available for binary images,
1313
where by _binary_ images we mean Boolean images or images with only 0’s and 1’s of UInt8 type.
1414

15+
### Args
16+
- `I::Union{GMTimage{<:UInt8, 2}, GMTimage{<:Bool, 2}}`: Input image.
17+
18+
### Kwargs
19+
- `hsize::Int=3`: Horizontal size of the 'box' structuring element.
20+
21+
- `vsize::Int=3`: Vertical size of the 'box' structuring element.
22+
23+
- `sel=nothing`: Structuring element (See \myreflink{strel} function). An alternative to `hsize` and `vsize` options.
24+
If equal to ``nothing``, a structuring box of size `hsize` x `vsize` is used.
25+
1526
### Returns
1627
A new \myreflink{GMTimage} of the same type as `I` with the dilation applied.
1728

@@ -21,7 +32,7 @@ Dilation with a square of width 3 (the default when neither `sel`, nor `hsize` o
2132
Examples
2233
--------
2334

24-
Erosion with a disk radius of 10, 5 and 20
35+
Dilation with a square of width 3 (the default when neither `sel`, nor `hsize` or `vsize` are specified)
2536

2637
\begin{examplefig}{}
2738
```julia

‎documentation/utilities/imerode.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ The erosion is performed with a matrix of 0’s and 1’s with width `hsize` and
1212
with the structuring element \myreflink{strel}. Later case is faster but it is only available for binary images,
1313
where by _binary_ images we mean Boolean images or images with only 0’s and 1’s of UInt8 type.
1414

15+
### Args
16+
- `I::Union{GMTimage{<:UInt8, 2}, GMTimage{<:Bool, 2}}`: Input image.
17+
18+
### Kwargs
19+
- `hsize::Int=3`: Horizontal size of the 'box' structuring element.
20+
21+
- `vsize::Int=3`: Vertical size of the 'box' structuring element.
22+
23+
- `sel=nothing`: Structuring element (See \myreflink{strel} function). An alternative to `hsize` and `vsize` options.
24+
If equal to ``nothing``, a structuring box of size `hsize` x `vsize` is used.
25+
1526
### Returns
1627
A new \myreflink{GMTimage} of the same type as `I` with the erosion applied.
1728

@@ -31,7 +42,7 @@ J3 = imerode(I, sel=strel("disk", 20));
3142
grdimage(I, figsize=6)
3243
grdimage!(J1, figsize=6, xshift=6.1)
3344
grdimage!(J2, figsize=6, xshift=-6.1, yshift=-6.1)
34-
grdimage!(J3, figsize=6, xshift=-6.1, show=true)
45+
grdimage!(J3, figsize=6, xshift=6.1, show=true)
3546
```
3647
\end{examplefig}
3748

‎documentation/utilities/imhdome.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# imhdome
2+
3+
```julia
4+
J = imhdome(I::GMTimage{<:UInt8, 2}, H; conn=4)::GMTimage
5+
```
6+
7+
*keywords: GMT, Julia, image morphology, HDome transform*
8+
9+
Suppress regional minima in image using H-minima transform.
10+
11+
The H-minima transform decreases the depth of all regional minima by an amount up to `H`. As a result,
12+
the transform fully suppresses regional minima whose depth is less than `H`. Regional minima are
13+
connected pixels with the same intensity value, t, that are surrounded by pixels with an intensity
14+
value greater than t.
15+
16+
### Args
17+
- `I::GMTimage{<:UInt8, 2}`: Input image.
18+
19+
- `H`: height below the filling maskhdome; must be >= 0 (words of the Leptonica pixHDome() docs)
20+
21+
### Kwargs
22+
- `conn::Int=4`: Connectivity value used to identify the regional maxima in I (4 or 8). Default is 4.
23+
24+
### Returns
25+
A new \myreflink{GMTimage} of the same type as `I`.
26+
27+
28+
See Also
29+
--------
30+
31+
\myreflink{imhmax}, \myreflink{imhmin}

‎documentation/utilities/imhmax.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# imhmax
2+
3+
```julia
4+
J = imhmax(I::GMTimage{<:UInt8, 2}, H; conn=4)::GMTimage
5+
```
6+
7+
*keywords: GMT, Julia, image morphology, H-maxima transform*
8+
9+
Suppress regional maxima in image using H-maxima transform.
10+
11+
The H-maxima transform decreases the height of all regional maxima by an amount up to `H`. As a result,
12+
the transform fully suppresses regional maxima whose height is less than `H`. Regional maxima are connected
13+
pixels with the same intensity value, t, that are surrounded by pixels with an intensity value less than t.
14+
15+
### Args
16+
- `I::GMTimage{<:UInt8, 2}`: Input image.
17+
18+
- `H`: Bump's maximum regional height.
19+
20+
### Kwargs
21+
- `conn::Int=4`: Connectivity value used to identify the regional maxima in I (4 or 8). Default is 4.
22+
23+
### Returns
24+
A new \myreflink{GMTimage} of the same type as `I`.
25+
26+
Example
27+
-------
28+
29+
The result will look like the outline of the object.
30+
31+
```julia
32+
using GMT
33+
34+
a = fill(UInt8(10),10,10);
35+
a[2:4,2:4] .= UInt8(13);
36+
a[6:8,6:8] .= UInt8(18);
37+
I = imhmax(mat2img(a), 4);
38+
```
39+
40+
41+
See Also
42+
--------
43+
44+
\myreflink{imhdome}, \myreflink{imhmin}

0 commit comments

Comments
 (0)
Please sign in to comment.