Hi, I would like to create a weight map from a binary image in a way to have more intensity values in the border pixels between the close objects. To make it more clear I need to calculate w(x) from an input image following the formula mentioned below. Where w0 and sigma are two constant value, x denotes pixels in the image, d1 denotes the distance to the border of the nearest object and d2 is distance to the border of the second nearest cell.

This is what is done in U-net paper (Article U-Net: Convolutional Networks for Biomedical Image Segmentation

)but I do not how to implement this in python or Matlab
Similar questions and discussions