Skip to content

Commit a6e6da2

Browse files
authored
update doctest reference for Rotation and Clustering (#149)
1 parent 94bb683 commit a6e6da2

File tree

6 files changed

+16
-19
lines changed

6 files changed

+16
-19
lines changed

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ MappedArrays = "dbb5928d-eab1-5f90-85c2-b9b0edb7c900"
2424
MosaicViews = "e94cdb99-869f-56ef-bcf0-1ae2bcbe0389"
2525
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
2626
PaddedViews = "5432bcbf-9aad-5242-b902-cca2824c8663"
27+
Rotations = "6038ab10-8711-5258-84ad-4b1120ba62dc"
2728
SimpleTraits = "699a6c99-e7fa-54fc-8d76-47d257e15c1d"
2829
TestImages = "5e47fb64-e119-507b-a336-dd2b206d9990"
2930
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
@@ -54,6 +55,7 @@ MappedArrays = "0"
5455
MosaicViews = "0"
5556
OffsetArrays = "1.0"
5657
PaddedViews = "0"
58+
Rotations = "1"
5759
SimpleTraits = "0"
5860
TestImages = "0, 1.0"
5961
Unitful = "0, 1.0"

docs/src/pkgs/features/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ this example.
2929
First, let us create the two images we will match using BRISK.
3030

3131
```@example 3
32-
using ImageFeatures, TestImages, Images, ImageDraw, CoordinateTransformations
32+
using ImageFeatures, TestImages, Images, ImageDraw, CoordinateTransformations, Rotations
3333
3434
img = testimage("lighthouse")
3535
img1 = Gray.(img)

docs/src/pkgs/segmentation/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ julia> length(segment_labels(segments))
6262
6363
julia> segment_mean(segments)
6464
Dict{Int64,RGB{Float64}} with 3 entries:
65-
2 => RGB{Float64}(0.793679,0.839473,0.932494)
66-
3 => RGB{Float64}(0.329867,0.357842,0.237361)
67-
1 => RGB{Float64}(0.0650002,0.0586348,0.074091)
65+
2 => RGB{Float64}(0.793598,0.839543,0.932374)
66+
3 => RGB{Float64}(0.329863,0.35779,0.237457)
67+
1 => RGB{Float64}(0.0646509,0.0587034,0.0743471)
6868
```
6969

7070
We can visualize each segment using its mean color:
@@ -106,7 +106,7 @@ Segmented Image with:
106106
julia> segments = felzenszwalb(img, 10) #smaller segments but noisy segmentation
107107
Segmented Image with:
108108
labels map: 240×360 Array{Int64,2}
109-
number of labels: 275
109+
number of labels: 312
110110
```
111111

112112
| k = 100 | k = 10 |
@@ -242,7 +242,7 @@ julia> img = load("src/pkgs/segmentation/assets/tree.jpg");
242242
julia> seg = unseeded_region_growing(img, 0.05) # here 0.05 is the threshold
243243
Segmented Image with:
244244
labels map: 320×480 Array{Int64,2}
245-
number of labels: 774
245+
number of labels: 698
246246
```
247247

248248
| Threshold | Output | Compression percentage|
@@ -297,7 +297,7 @@ julia> img = imresize(img, (128, 128));
297297
julia> segments = meanshift(img, 16, 8/255) # parameters are smoothing radii: spatial=16, intensity-wise=8/255
298298
Segmented Image with:
299299
labels map: 128×128 Array{Int64,2}
300-
number of labels: 42
300+
number of labels: 44
301301
```
302302
![img1](assets/small_house.jpg) ![img2](assets/meanshift.jpg)
303303

@@ -329,7 +329,7 @@ julia> img = testimage("camera");
329329
julia> seg = fast_scanning(img, 0.1) # threshold = 0.1
330330
Segmented Image with:
331331
labels map: 512×512 Array{Int64,2}
332-
number of labels: 2536
332+
number of labels: 2538
333333
334334
julia> seg = prune_segments(seg, i->(segment_pixel_count(seg,i)<50), (i,j)->(-segment_pixel_count(seg,j)))
335335
Segmented Image with:

docs/src/tutorials/arrays_colors.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -309,14 +309,9 @@ However, you should be aware that for *integer* inputs, the default is
309309
to use the `N0f8` element type, and this type cannot represent values
310310
outside the range from 0 to 1:
311311

312-
```jldoctest; setup = :(using ColorTypes), filter = r"at \(.*\)"
313-
julia> RGB(8,2,0)
314-
ERROR: ArgumentError: (8, 2, 0) are integers in the range 0-255, but integer inputs are encoded with the N0f8
315-
type, an 8-bit type representing 256 discrete values between 0 and 1.
316-
Consider dividing your input values by 255, for example: RGB{N0f8}(8/255,2/255,0/255)
317-
See the READMEs for FixedPointNumbers and ColorTypes for more information.
318-
Stacktrace:
319-
[...]
312+
```@repl
313+
using ColorTypes # hide
314+
RGB(8,2,0)
320315
```
321316

322317
The error message here reminds you how to resolve a common mistake,

docs/src/tutorials/conversions_views.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ which may be somewhat easier to read than the type:
501501

502502
```jldoctest; setup = :(using Images; A = rand(UInt8, 5, 6, 3, 10); mov = colorview(RGB, normedview(PermutedDimsArray(A, (3,1,2,4))))), filter=r"Symbol\(.*\)"
503503
julia> typeof(mov)
504-
Base.ReshapedArray{RGB{Normed{UInt8,8}},3,Base.ReinterpretArray{RGB{Normed{UInt8,8}},4,Normed{UInt8,8},MappedArrays.MappedArray{Normed{UInt8,8},4,PermutedDimsArray{UInt8,4,(3, 1, 2, 4),(2, 3, 1, 4),Array{UInt8,4}},getfield(ImageCore, Symbol("##36#37")){Normed{UInt8,8}},typeof(reinterpret)}},Tuple{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64}}}
504+
Base.ReshapedArray{RGB{Normed{UInt8,8}},3,Base.ReinterpretArray{RGB{Normed{UInt8,8}},4,Normed{UInt8,8},MappedArrays.MappedArray{Normed{UInt8,8},4,PermutedDimsArray{UInt8,4,(3, 1, 2, 4),(2, 3, 1, 4),Array{UInt8,4}},ImageCore.var"#37#38"{Normed{UInt8,8}},typeof(reinterpret)}},Tuple{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64}}}
505505
```
506506

507507
While there is little or no performance cost to making use of

docs/src/tutorials/indexing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ overlay the two images
2323
doing.
2424

2525
```jldoctest; setup = :(using Images; img = load(joinpath(@__DIR__, "src/tutorials/assets/indexing/cmrot.png")))
26-
julia> using Images, CoordinateTransformations
26+
julia> using Images, CoordinateTransformations, Rotations
2727
2828
julia> tfm = recenter(RotMatrix(pi/8), center(img))
29-
AffineMap([0.92388 -0.382683; 0.382683 0.92388], [88.7786, -59.3199])
29+
AffineMap([0.9238795325112867 -0.3826834323650898; 0.3826834323650898 0.9238795325112867], [88.7785546217109, -59.31993370357884])
3030
3131
julia> imgrot = warp(img, tfm);
3232

0 commit comments

Comments
 (0)