shortestPath,shortestPathList = | ridgeLine2dImg (inImg,inPropagationAxis,inPropagationDirection) |
shortestPath,shortestPathList = | ridgeLine2dImg (inImg,inOptMaskImg,inPropagationAxis,inPropagationDirection) |
shortestPath,shortestPathList = | ridgeLine2dImg (inImg,inPropagationAxis,inPropagationDirection,nbIter) |
shortestPath,shortestPathList = | ridgeLine2dImg (inImg,inOptMaskImg,inPropagationAxis,inPropagationDirection,nbIter) |
Pixels2d = | ridgeLine2dImg (inImg,inPropagationAxis,inPropagationDirection,outShortestPathImg,outDistanceMap,outPathMap) |
Pixels2d = | ridgeLine2dImg (inImg,inOptMaskImg,inPropagationAxis,inPropagationDirection,outShortestPathImg,outDistanceMap,outPathMap) |
Pixels2d = | ridgeLine2dImg (inImg,inPropagationAxis,inPropagationDirection,nbIter,outShortestPathImg,outDistanceMap,outPathMap) |
Pixels2d = | ridgeLine2dImg (inImg,inOptMaskImg,inPropagationAxis,inPropagationDirection,nbIter,outShortestPathImg,outDistanceMap,outPathMap) |
Computes the shortest path from one border to its opposite, given distance ponderation map.
The 2D ridge line algorithm allows to compute the shortest path to cross an image along the x or y axis. It is also possible to specify the propagation direction. This direction can be direct (from left to right or from top to bottom) or reverse (from right to left or from bottom to top).
The distance, to reach a pixel, between one of its 8-neighbors is given by its intensity. More the intensity will be high, more the access to the pixel will be unfavourable. This means that the algorithm tries to find a path through the darkest pixels.
This algorithm returns :
The calculation time can be drastically reduced by specifying a number of iterations. If this parameter is higher than 0, the algorithm will stop before converging to the final result. Although the result will be an approximation of the shortest path, it will stay close to the eact result.
Finally, it is possible to specify a propagation area by passing an additional mask as parameter.
Here is an example of the ridge line algorithm output :
In that particular case we can find two interesting paths. One at the middle of the image and one at the bottom. Within the previous figure the shortest path is the interface between the background and the object. It's possible to get the interface between the two materials by using a mask restricting the propagation to the bottom of the image.
Here is a mask use case :
The distance for each pixel of the shortest path is given by the intensity field of the Pixel2d data item. It is also possible to obtain the shortest path length for slice (z, c, t) thanks to the function computeShortestPathLength.