Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

measure valley width 2d, matlab

I have a 2d image, I have locations where local minimas occurs. I want to measure the width of the valleys "leading" to those minimas. I need either the radii of the circles or ellipses fitted to these valley. An example attached here, dark red lines on the peaks contours is what I wish to find. Thanks.

peaks width example

like image 427
matlabit Avatar asked Feb 24 '26 17:02

matlabit


1 Answers

I am partially extending the answer of @Lucas.

Given a threshold t I would consider the points P_m that are below t and closer to a certain point m of minimum of your f (given a characteristic scale length r).

(You said your data are noisy; to distinguish minima and talk about wells, you need to estimate such r. In your example it can be for instance r=4, i.e. half the distance between the minima).

Then you have to consider a metric for each well region P_m, say for example

 metric(P_m) = .5 * mean{ maximum vertical diameter of P_m ,  
                     maximum horizontal diameter of P_m}.

In your picture metric(P_m) = 2 for both wells.


On the whole, in terms of pseudo-code you may consider

 M := set of local minima of f

 for_each(minimum m in M){

      P_m += {p : d(p,m) < r and f(r)<t}  % say that += is the push operation in a Stack

 }

 radius_of_region_around(m) = metric(P_m);  %
like image 133
Acorbe Avatar answered Feb 26 '26 09:02

Acorbe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!