Greetings,
as far as I understood it, calling a convolution with a 1-filled matrix and then inverting the result on the mask should result in a decrease of depth values at attention boundaries. Example:
5 visible pixels on an 3x3 kernel results in the value 5 in the intermediate mask(IMask), resulting in 0.2 after the reciprocal operation.
Anyways, results look great!