I have a labeled matrix containing two objects. How can I thicken an object to a curve? Actually I have the following image:
and I want this:
Each pixel of the resulting curve is the median of each column. But if you have another idea, it is acceptable, because I want a general scheme of each object as a curve.