Operators (View)

Include <mln/core/image/view/operators.hpp>

Arithmetical

  1. auto operator+(Image ima1, Image ima2)
  2. auto operator+(Image ima1, Scalar s)
  3. auto operator+(Scalar s, Image ima1)
    1. Makes a view where for each pixel value evals to out(p) = ima1(p) + ima2(p)

    2. Makes a view where for each pixel value evals to out(p) = ima1(p) + s.

    3. Makes a view where for each pixel value evals to out(p) = s + ima1(p).

    Parameters:
    • ima1 – Input range

    • ima2 – Input range

    • s – Scalar value

    mln::image2d<mln::rgb8> ima1 = ...;
    mln::image2d<mln::rgb8> ima2 = ...;
    auto g1 = ima1 + ima2;
    double s = 5.5;
    auto g1 = ima1 + s;
    auto g1 = s + ima1;
    
  1. auto operator-(Image ima1, Image ima2)
  2. auto operator-(Image ima1, Scalar s)
  3. auto operator-(Scalar s, Image ima1)
    1. Makes a view where for each pixel value evals to out(p) = ima1(p) - ima2(p)

    2. Makes a view where for each pixel value evals to out(p) = ima1(p) - s.

    3. Makes a view where for each pixel value evals to out(p) = s - ima1(p).

    Parameters:
    • ima1 – Input range

    • ima2 – Input range

    • s – Scalar value

    mln::image2d<mln::rgb8> ima1 = ...;
    mln::image2d<mln::rgb8> ima2 = ...;
    auto g1 = ima1 - ima2;
    double s = 5.5;
    auto g1 = ima1 - s;
    auto g1 = s - ima1;
    
  1. auto operator*(Image ima1, Image ima2)
  2. auto operator*(Image ima1, Scalar s)
  3. auto operator*(Scalar s, Image ima1)
    1. Makes a view where for each pixel value evals to out(p) = ima1(p) * ima2(p)

    2. Makes a view where for each pixel value evals to out(p) = ima1(p) * s.

    3. Makes a view where for each pixel value evals to out(p) = s * ima1(p).

    Parameters:
    • ima1 – Input range

    • ima2 – Input range

    • s – Scalar value

    mln::image2d<mln::rgb8> ima1 = ...;
    mln::image2d<mln::rgb8> ima2 = ...;
    auto g1 = ima1 * ima2;
    double s = 5.5;
    auto g1 = ima1 * s;
    auto g1 = s * ima1;
    
  1. auto operator/(Image ima1, Image ima2)
  2. auto operator/(Image ima1, Scalar s)
  3. auto operator/(Scalar s, Image ima1)
    1. Makes a view where for each pixel value evals to out(p) = ima1(p) / ima2(p)

    2. Makes a view where for each pixel value evals to out(p) = ima1(p) / s.

    3. Makes a view where for each pixel value evals to out(p) = s / ima1(p).

    Parameters:
    • ima1 – Input range

    • ima2 – Input range

    • s – Scalar value

    Warning

    Mind the division by zero.

    mln::image2d<mln::rgb8> ima1 = ...;
    mln::image2d<mln::rgb8> ima2 = ...;
    auto g1 = ima1 / ima2;
    double s = 5.5;
    auto g1 = ima1 / s;
    auto g1 = s / ima1;
    
  1. auto operator%(Image ima1, Image ima2)
  2. auto operator%(Image ima1, Scalar s)
  3. auto operator%(Scalar s, Image ima1)
    1. Makes a view where for each pixel value evals to out(p) = ima1(p) % ima2(p)

    2. Makes a view where for each pixel value evals to out(p) = ima1(p) % s.

    3. Makes a view where for each pixel value evals to out(p) = s % ima1(p).

    Parameters:
    • ima1 – Input range

    • ima2 – Input range

    • s – Scalar value

    mln::image2d<mln::rgb8> ima1 = ...;
    mln::image2d<mln::rgb8> ima2 = ...;
    auto g1 = ima1 % ima2;
    double s = 5.5;
    auto g1 = ima1 % s;
    auto g1 = s % ima1;
    

Logical

  1. auto operator&&(Image ima1, Image ima2)
  2. auto operator&&(Image ima1, Scalar s)
  3. auto operator&&(Scalar s, Image ima1)
    1. Makes a view where for each pixel value evals to out(p) = ima1(p) && ima2(p)

    2. Makes a view where for each pixel value evals to out(p) = ima1(p) && s.

    3. Makes a view where for each pixel value evals to out(p) = s && ima1(p).

    Parameters:
    • ima1 – Input range

    • ima2 – Input range

    • s – Scalar value

    mln::image2d<mln::rgb8> ima1 = ...;
    mln::image2d<mln::rgb8> ima2 = ...;
    auto g1 = ima1 && ima2;
    double s = 5.5;
    auto g1 = ima1 && s;
    auto g1 = s && ima1;
    
  1. auto operator||(Image ima1, Image ima2)
  2. auto operator||(Image ima1, Scalar s)
  3. auto operator||(Scalar s, Image ima1)
    1. Makes a view where for each pixel value evals to out(p) = ima1(p) || ima2(p)

    2. Makes a view where for each pixel value evals to out(p) = ima1(p) || s.

    3. Makes a view where for each pixel value evals to out(p) = s || ima1(p).

    Parameters:
    • ima1 – Input range

    • ima2 – Input range

    • s – Scalar value

    mln::image2d<mln::rgb8> ima1 = ...;
    mln::image2d<mln::rgb8> ima2 = ...;
    auto g1 = ima1 || ima2;
    double s = 5.5;
    auto g1 = ima1 || s;
    auto g1 = s || ima1;
    
  1. auto operator!(Image ima)
    1. Makes a view where for each pixel value evals to out(p) = !ima(p)

    Parameters:

    ima – Input range

    mln::image2d<mln::rgb8> ima = ...;
    auto g = !ima;
    

Comparison

  1. auto operator<(Image ima1, Image ima2)
  2. auto operator<(Image ima1, Scalar s)
  3. auto operator<(Scalar s, Image ima1)
    1. Makes a view where for each pixel value evals to out(p) = ima1(p) < ima2(p)

    2. Makes a view where for each pixel value evals to out(p) = ima1(p) < s.

    3. Makes a view where for each pixel value evals to out(p) = s < ima1(p).

    Parameters:
    • ima1 – Input range

    • ima2 – Input range

    • s – Scalar value

    mln::image2d<mln::rgb8> ima1 = ...;
    mln::image2d<mln::rgb8> ima2 = ...;
    auto g1 = ima1 < ima2;
    double s = 5.5;
    auto g1 = ima1 < s;
    auto g1 = s < ima1;
    
  1. auto operator<=(Image ima1, Image ima2)
  2. auto operator<=(Image ima1, Scalar s)
  3. auto operator<=(Scalar s, Image ima1)
    1. Makes a view where for each pixel value evals to out(p) = ima1(p) <= ima2(p)

    2. Makes a view where for each pixel value evals to out(p) = ima1(p) <= s.

    3. Makes a view where for each pixel value evals to out(p) = s <= ima1(p).

    Parameters:
    • ima1 – Input range

    • ima2 – Input range

    • s – Scalar value

    mln::image2d<mln::rgb8> ima1 = ...;
    mln::image2d<mln::rgb8> ima2 = ...;
    auto g1 = ima1 <= ima2;
    double s = 5.5;
    auto g1 = ima1 <= s;
    auto g1 = s <= ima1;
    
  1. auto operator==(Image ima1, Image ima2)
  2. auto operator==(Image ima1, Scalar s)
  3. auto operator==(Scalar s, Image ima1)
    1. Makes a view where for each pixel value evals to out(p) = ima1(p) == ima2(p)

    2. Makes a view where for each pixel value evals to out(p) = ima1(p) == s.

    3. Makes a view where for each pixel value evals to out(p) = s == ima1(p).

    Parameters:
    • ima1 – Input range

    • ima2 – Input range

    • s – Scalar value

    mln::image2d<mln::rgb8> ima1 = ...;
    mln::image2d<mln::rgb8> ima2 = ...;
    auto g1 = ima1 == ima2;
    double s = 5.5;
    auto g1 = ima1 == s;
    auto g1 = s == ima1;
    
  1. auto equalFP(Image ima1, Image ima2, double eps)
  2. auto equalFP(Image ima1, Scalar s, double eps)
  3. auto equalFP(Scalar s, Image ima1, double eps)
    1. Makes a view where for each pixel value evals to out(p) = abs(ima1(p) - ima2(p)) < eps

    2. Makes a view where for each pixel value evals to out(p) = abs(ima1(p) - s) < eps.

    3. Makes a view where for each pixel value evals to out(p) = abs(s - ima1(p)) < eps.

    Parameters:
    • ima1 – Input range

    • ima2 – Input range

    • s – Scalar value

    • eps – Epsilon precision

    mln::image2d<mln::rgb8> ima1 = ...;
    mln::image2d<mln::rgb8> ima2 = ...;
    auto g1 = equalFP(ima1, ima2, 10e-6);
    double s = 5.5;
    auto g1 = equalFP(ima1, s, 10e-6);
    auto g1 = equalFP(s, ima1, 10e-6);
    
  1. auto operator!=(Image ima1, Image ima2)
  2. auto operator!=(Image ima1, Scalar s)
  3. auto operator!=(Scalar s, Image ima1)
    1. Makes a view where for each pixel value evals to out(p) = ima1(p) != ima2(p)

    2. Makes a view where for each pixel value evals to out(p) = ima1(p) != s.

    3. Makes a view where for each pixel value evals to out(p) = s != ima1(p).

    Parameters:
    • ima1 – Input range

    • ima2 – Input range

    • s – Scalar value

    mln::image2d<mln::rgb8> ima1 = ...;
    mln::image2d<mln::rgb8> ima2 = ...;
    auto g1 = ima1 != ima2;
    double s = 5.5;
    auto g1 = ima1 != s;
    auto g1 = s != ima1;
    
  4. auto operator>(Image ima1, Image ima2)
  5. auto operator>(Image ima1, Scalar s)
  6. auto operator>(Scalar s, Image ima1)
    1. Makes a view where for each pixel value evals to out(p) = ima1(p) > ima2(p)

    2. Makes a view where for each pixel value evals to out(p) = ima1(p) > s.

    3. Makes a view where for each pixel value evals to out(p) = s > ima1(p).

    Parameters:
    • ima1 – Input range

    • ima2 – Input range

    • s – Scalar value

    mln::image2d<mln::rgb8> ima1 = ...;
    mln::image2d<mln::rgb8> ima2 = ...;
    auto g1 = ima1 > ima2;
    double s = 5.5;
    auto g1 = ima1 > s;
    auto g1 = s > ima1;
    
  1. auto operator>=(Image ima1, Image ima2)
  2. auto operator>=(Image ima1, Scalar s)
  3. auto operator>=(Scalar s, Image ima1)
    1. Makes a view where for each pixel value evals to out(p) = ima1(p) >= ima2(p)

    2. Makes a view where for each pixel value evals to out(p) = ima1(p) >= s.

    3. Makes a view where for each pixel value evals to out(p) = s >= ima1(p).

    Parameters:
    • ima1 – Input range

    • ima2 – Input range

    • s – Scalar value

    mln::image2d<mln::rgb8> ima1 = ...;
    mln::image2d<mln::rgb8> ima2 = ...;
    auto g1 = ima1 >= ima2;
    double s = 5.5;
    auto g1 = ima1 >= s;
    auto g1 = s >= ima1;
    

Conditional

  1. auto ifelse(Image ima, Image ima1, Image ima2)
  2. auto ifelse(Image ima, Image ima1, Scalar s_else)
  3. auto ifelse(Image ima, Scalar s_if, Image ima2)
  4. auto ifelse(Image ima, Scalar s_if, Scalar s_else)

ima, ima1, ima2

+, -, *, /, %, <, <=, ==, !=, >, >=

ifelse(ima, ima1, ima2)

ifelse(ima, ima1, s_else) / ifelse(ima, s_if, ima2) / ifelse(ima, s_if, s_else)

Category

Forward

X

X

X

X

Bidirectional

X

X

X

X

Raw

X

Properties

Writable

X

X

Accessible

X

X

X

X

Indexable

X

X

X

X

Examples

TODO