How do I detect volume collisions?
Show older comments
My data consists of a 3d matrix. In this matrix there will be two distinct points/volumes that have low values. As the values increase these volumes will grow. I would like to know at what value these volumes first begin to merge. More specifically I think what I want is to know the first value in which I could traverse from the first point to the second point without exceeding that value at all points traversed.
Here's a simple example in 1d. The points with values 1 in this and the subsequent case can be considered the starting points.
9 7 3 2 1 2 3 4 5 6 5 4 3 2 1 2
In this case the value I would be looking for would be 6.
2d example
9 8 7 8 7 8
4 3 5 4 3 4
3 1 6 2 1 9
2 4 9 8 9 9
In this case the value would be 5. If I wanted to go from the first point 1 to the next point 1, and the max value I could cross was 4, there would be no way to get from the one point to the other. Once I can cross values of 5 or less then I can get from the first point to the other. The path I would take is not of concern, just that 5 is the point at which path traversal is possible.
For simplicity assume I know where the start and end points are located.
Another formulation of the problem is as such. Consider points less than or equal to some value as passable, and those greater than that value as not passable. What is the minimum value in which I can get from the start to the end.
Thoughts?
Thanks,
Jim
7 Comments
Image Analyst
on 15 Jul 2013
I think I might understand the first one because the 6 is a local peak. But I have no idea how you got the 5. It's not a local max. What are the two regions and why is 5 the intersection (merging) point? If anything the 5 is closer to a saddle point.
Jim Hokanson
on 15 Jul 2013
What happens in a case like the one below, where volumes collide before they encompass the path which has the lower max?
9 9 9 9 9 9 9 9 9 9 9 9
9 9 9 9 9 9 9 9 9 9 9 9
2 2 2 2 1 9 9 1 2 2 2 2
2 9 9 9 9 9 9 9 9 9 9 2
2 2 2 2 2 2 2 2 2 2 2 2
Jim Hokanson
on 15 Jul 2013
Cedric
on 23 Jul 2013
How large is the 3D array that you are dealing with by the way?
Cedric
on 25 Jul 2013
If the 3D array is large, you might want to use a C/MEX version of Dijkstra (or A* ?). The one that I am using in my answer takes 2s on 8000 nodes, which is not that fast.
Accepted Answer
More Answers (1)
Image Analyst
on 15 Jul 2013
0 votes
Try these links and see if they help:
http://www.mathworks.co.uk/searchresults/?c[]=entiresite&q=bwdistgeodesic
Otherwise you might have to use dynamic programming to program up something custom.
Categories
Find more on Dijkstra algorithm 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!