![]() |
IPSDK
4_1_0_2
IPSDK : Image Processing Software Development Kit
|
Computes the shortest path from one border to its opposite, given distance ponderation map. More...
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.
Attribute description for algorithm :
| Name | ToolTip | Default Initializer |
|---|---|---|
| ipsdk::imaproc::attr::InImg | [Input] image for processing operation | X |
| ipsdk::imaproc::attr::InOptMaskImg | [Input Optional] Binary image for masking operation | X |
| ipsdk::imaproc::attr::InPropagationAxis | [Input] input axis propagation for the algorithm | X |
| ipsdk::imaproc::attr::InPropagationDirection | [Input] Direction propagation for the algorithm | X |
| ipsdk::imaproc::attr::InOptComputeOutImg | [Input Optional] Flag indicating if the optional output image has to be computed | X |
| ipsdk::imaproc::attr::InNbIter | [Input] Number of iterations for an iterative algorithm | X |
| ipsdk::imaproc::attr::OutDistImg | [Output] distance map image | duplicateInOut (_pOutDistImg, _pInImg, ipsdk::image::eImageBufferType::eIBT_Real32) |
| ipsdk::imaproc::attr::OutIntImg | [Output] image containing integers | duplicateInOut (_pOutIntImg, _pInImg, ipsdk::image::eImageBufferType::eIBT_UInt8) |
| ipsdk::imaproc::attr::OutBinImg | [Output] binary image for processing operation | duplicateInOut (_pOutBinImg, _pInImg, ipsdk::image::eImageBufferType::eIBT_Binary) |
| ipsdk::imaproc::attr::OutPIPixels2d | [Output] plan indexed collection of positions and intensities of 2d pixels | ipsdk::imaproc::fromImage (_pOutPIPixels2d, _pInImg) |
Global rule description for algorithm :
ipsdk::imaproc::matchSize (_pInImg,_pOutDistImg,_pOutIntImg) &&
ipsdk::imaproc::matchImagePlans (_pOutPIPixels2d,_pInImg,eImagePlansMatchPolicy::eIPMP_ZCT) &&
ipsdk::processor::If (
ipsdk::processor::isSet (_pInOptMaskImg),
ipsdk::imaproc::matchSize (_pInImg,_pInOptMaskImg),
ipsdk::processor::none ()) &&
ipsdk::imaproc::matchSize (_pOutDistImg,_pOutBinImg)
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::RidgeLine2dResult ipsdk::imaproc::advmorpho::ridgeLine2dImg | ( | const ipsdk::image::ImageConstPtr & | pInImg, |
| const ipsdk::imaproc::attr::ePropagationAxis & | pInPropagationAxis, | ||
| const ipsdk::imaproc::attr::ePropagationDirection & | pInPropagationDirection | ||
| ) |
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::RidgeLine2dResult ipsdk::imaproc::advmorpho::ridgeLine2dImg | ( | const ipsdk::image::ImageConstPtr & | pInImg, |
| const ipsdk::image::ImageConstPtr & | pInOptMaskImg, | ||
| const ipsdk::imaproc::attr::ePropagationAxis & | pInPropagationAxis, | ||
| const ipsdk::imaproc::attr::ePropagationDirection & | pInPropagationDirection | ||
| ) |
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::RidgeLine2dResult ipsdk::imaproc::advmorpho::ridgeLine2dImg | ( | const ipsdk::image::ImageConstPtr & | pInImg, |
| const ipsdk::imaproc::attr::ePropagationAxis & | pInPropagationAxis, | ||
| const ipsdk::imaproc::attr::ePropagationDirection & | pInPropagationDirection, | ||
| const ipsdk::ipUInt32 | nbIter | ||
| ) |
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::RidgeLine2dResult ipsdk::imaproc::advmorpho::ridgeLine2dImg | ( | const ipsdk::image::ImageConstPtr & | pInImg, |
| const ipsdk::image::ImageConstPtr & | pInOptMaskImg, | ||
| const ipsdk::imaproc::attr::ePropagationAxis & | pInPropagationAxis, | ||
| const ipsdk::imaproc::attr::ePropagationDirection & | pInPropagationDirection, | ||
| const ipsdk::ipUInt32 | nbIter | ||
| ) |
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::Pixels2dPtr ipsdk::imaproc::advmorpho::ridgeLine2dImg | ( | const ipsdk::image::ImageConstPtr & | pInImg, |
| const ipsdk::imaproc::attr::ePropagationAxis & | pInPropagationAxis, | ||
| const ipsdk::imaproc::attr::ePropagationDirection & | pInPropagationDirection, | ||
| const ipsdk::image::ImagePtr & | pOutShortestPathImg, | ||
| const ipsdk::image::ImagePtr & | pOutDistanceMap, | ||
| const ipsdk::image::ImagePtr & | pOutPathMap | ||
| ) |
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::Pixels2dPtr ipsdk::imaproc::advmorpho::ridgeLine2dImg | ( | const ipsdk::image::ImageConstPtr & | pInImg, |
| const ipsdk::image::ImageConstPtr & | pInOptMaskImg, | ||
| const ipsdk::imaproc::attr::ePropagationAxis & | pInPropagationAxis, | ||
| const ipsdk::imaproc::attr::ePropagationDirection & | pInPropagationDirection, | ||
| const ipsdk::image::ImagePtr & | pOutShortestPathImg, | ||
| const ipsdk::image::ImagePtr & | pOutDistanceMap, | ||
| const ipsdk::image::ImagePtr & | pOutPathMap | ||
| ) |
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::Pixels2dPtr ipsdk::imaproc::advmorpho::ridgeLine2dImg | ( | const ipsdk::image::ImageConstPtr & | pInImg, |
| const ipsdk::imaproc::attr::ePropagationAxis & | pInPropagationAxis, | ||
| const ipsdk::imaproc::attr::ePropagationDirection & | pInPropagationDirection, | ||
| const ipsdk::ipUInt32 | nbIter, | ||
| const ipsdk::image::ImagePtr & | pOutShortestPathImg, | ||
| const ipsdk::image::ImagePtr & | pOutDistanceMap, | ||
| const ipsdk::image::ImagePtr & | pOutPathMap | ||
| ) |
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::Pixels2dPtr ipsdk::imaproc::advmorpho::ridgeLine2dImg | ( | const ipsdk::image::ImageConstPtr & | pInImg, |
| const ipsdk::image::ImageConstPtr & | pInOptMaskImg, | ||
| const ipsdk::imaproc::attr::ePropagationAxis & | pInPropagationAxis, | ||
| const ipsdk::imaproc::attr::ePropagationDirection & | pInPropagationDirection, | ||
| const ipsdk::ipUInt32 | nbIter, | ||
| const ipsdk::image::ImagePtr & | pOutShortestPathImg, | ||
| const ipsdk::image::ImagePtr & | pOutDistanceMap, | ||
| const ipsdk::image::ImagePtr & | pOutPathMap | ||
| ) |
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::PlanIndexedPixels2dPtr ipsdk::imaproc::advmorpho::ridgeLine2dImg_multiSlice | ( | const ipsdk::image::ImageConstPtr & | pInImg, |
| const ipsdk::imaproc::attr::ePropagationAxis & | pInPropagationAxis, | ||
| const ipsdk::imaproc::attr::ePropagationDirection & | pInPropagationDirection, | ||
| const ipsdk::image::ImagePtr & | pOutShortestPathImg, | ||
| const ipsdk::image::ImagePtr & | pOutDistanceMap, | ||
| const ipsdk::image::ImagePtr & | pOutPathMap | ||
| ) |
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::PlanIndexedPixels2dPtr ipsdk::imaproc::advmorpho::ridgeLine2dImg_multiSlice | ( | const ipsdk::image::ImageConstPtr & | pInImg, |
| const ipsdk::image::ImageConstPtr & | pInOptMaskImg, | ||
| const ipsdk::imaproc::attr::ePropagationAxis & | pInPropagationAxis, | ||
| const ipsdk::imaproc::attr::ePropagationDirection & | pInPropagationDirection, | ||
| const ipsdk::image::ImagePtr & | pOutShortestPathImg, | ||
| const ipsdk::image::ImagePtr & | pOutDistanceMap, | ||
| const ipsdk::image::ImagePtr & | pOutPathMap | ||
| ) |
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::PlanIndexedPixels2dPtr ipsdk::imaproc::advmorpho::ridgeLine2dImg_multiSlice | ( | const ipsdk::image::ImageConstPtr & | pInImg, |
| const ipsdk::imaproc::attr::ePropagationAxis & | pInPropagationAxis, | ||
| const ipsdk::imaproc::attr::ePropagationDirection & | pInPropagationDirection, | ||
| const ipsdk::ipUInt32 | nbIter, | ||
| const ipsdk::image::ImagePtr & | pOutShortestPathImg, | ||
| const ipsdk::image::ImagePtr & | pOutDistanceMap, | ||
| const ipsdk::image::ImagePtr & | pOutPathMap | ||
| ) |
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLADVANCEDMORPHOLOGY_API ipsdk::imaproc::attr::PlanIndexedPixels2dPtr ipsdk::imaproc::advmorpho::ridgeLine2dImg_multiSlice | ( | const ipsdk::image::ImageConstPtr & | pInImg, |
| const ipsdk::image::ImageConstPtr & | pInOptMaskImg, | ||
| const ipsdk::imaproc::attr::ePropagationAxis & | pInPropagationAxis, | ||
| const ipsdk::imaproc::attr::ePropagationDirection & | pInPropagationDirection, | ||
| const ipsdk::ipUInt32 | nbIter, | ||
| const ipsdk::image::ImagePtr & | pOutShortestPathImg, | ||
| const ipsdk::image::ImagePtr & | pOutDistanceMap, | ||
| const ipsdk::image::ImagePtr & | pOutPathMap | ||
| ) |
wrapper function for Computes the shortest path from one border to its opposite, given distance ponderation map.
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
1.8.14