I've a binary image containing an object as illustrated in the figure below. The centerline
of the object is depicted in red
. For each pixel belonging to the object, I would like to relabel it with a color. For instance, pixels whose orthogonal distance to the centerline are half of the distance to the object boundary from the centerline, should be labeled blue
, otherwise green
. An illustration is given below. Any ideas?
Also, how could I fit a 1D gaussian
centered in the object centerline
and orthogonal
to it?

The image in full resolution can be found under: https://i.stack.imgur.com/DqNkC.jpg