Gradient calculation from a starting point in image
Show older comments
hello everyone,
I'm trying to calculate a gradient from a matrix of double starting from a selected point. I have the coordinates (in terms of x and y) of this point and the values in my matrix represent the measures of the heights of a volcano (a sort of DEM). Form a starting point which corresponds to a specific height, I would find the pattern with the highest gradient in order to identify a sort of path that lava flows may travel.
My mental approach (I have problems also in developing this script) is to start a loop in which I should find, from my starting pixel P1, the pixel with lower height (Lpix) between the 8 around it, select the lowest-height pixel (Lpix) and then from Lpix start a new 'research' of the pixel with lowest height in the area of 8 pixel around it and find the Lpix2 and so on in order to define the already mentioned 'probable lava flow pattern' I need.
Are there any faster solutions or specific functions that can make this procedure easier?
Thank you!
Accepted Answer
More Answers (0)
Categories
Find more on Image Segmentation and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!