In general, Newtonian mechanics, that is taught at high school and at university in introductory level, considers objects as point particles or at most uncompressible solids. Therefore, in most cases, collisions are considered as elastic, where both kinetic energy and momentum are conserved.
However, in reality this is far from being the case. There is almost no point particles and any solid can be compressed. In other words, in reality there is almost no elastic collision; some of the kinetic energy is spent for deforming the shape and eventually is lost as heat.
There are a few materials properties (such as bulk modulus) involved in such calculations and I believe, analytical solutions only exists for certain geometrical shapes and for certain collision directions. For example, it could be possible to come up with such a function say for a spherical plastic ball or an iron cylinder etc. and I doubt that such a function will be constant for different shapes, materials and even collison directions. In other cases, that is, for complicated shapes and inhomogenoius materials, there might be some computer based numerical solutions that engineers apply.
Here is an example of a such non-elastic collision, as you mentioned, in slow motion.
https://www.youtube.com/watch?v=aMqM13EUSKw