  Tropical Geometry and Mathematical Morphology share the same max-plus and
min-plus semiring arithmetic and matrix algebra. In this chapter we summarize
some of their main ideas and common (geometric and algebraic) structure,
generalize and extend both of them using weighted lattices and a max-$\star$
algebra with an arbitrary binary operation $\star$ that distributes over max,
and outline applications to geometry, machine learning, and optimization.
Further, we generalize tropical geometrical objects using weighted lattices.
Finally, we provide the optimal solution of max-$\star$ equations using
morphological adjunctions that are projections on weighted lattices, and apply
it to optimal piecewise-linear regression for fitting max-$\star$ tropical
curves and surfaces to arbitrary data that constitute polygonal or polyhedral
shape approximations. This also includes an efficient algorithm for solving the
convex regression problem of data fitting with max-affine functions.
