You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This notably defines 3 multiplication operators for RGB colors.
It also un-defines `abs2`, because how that should work is a bit ambiguous.
Finally, it defines a new `varmult` function, which allows one to
compute variance using a specific multiplication operator.
There are some compatibility definitions for current releases of ColorTypes.
Co-authored-by: Johnny Chen <johnnychen94@hotmail.com>
Note that `c1⋅c2 = (c1.r*c2.r + c1.g*c2.g + c1.b*c2.b)/3`, where the division by 3 ensures the equivalence `norm(x) == norm(Gray(x)) == norm(RGB(x, x, x))`.
82
+
83
+
It is designed to not support the ordinary multiplication operation `*` because it is not obvious which one of these should be the default option.
84
+
85
+
However, `*` is defined for grayscale since all these three multiplication operations (i.e., `⋅`, `⊙` and `⊗`) are equivalent in the 1D vector space.
86
+
87
+
### Variance
88
+
89
+
The variance `v = E((c - μ)^2)` (or its bias-corrected version) involves a multiplication,
90
+
and to be consistent with the above you must specify which sense of multiplication you wish to use:
91
+
92
+
```julia
93
+
julia> cs = [c1, c2]
94
+
2-element Array{RGB{Float64},1} with eltype RGB{Float64}:
0 commit comments