template<class DstArrayT, class SrcArrayT>
GeodesicDistanceTransform based on Luc Vincent's algorithm. Type of Src and Dst should be scalar integer based. Definition at line 23 of file GeodesicDistanceTransform.h. References Impala::Core::Matrix::MatSet(), Impala::Core::Array::Pattern::PatQueueBased(), PixMinMax(), and Set(). Referenced by Impala::Application::Src::WindowSrc::HandleNewFrame(). 00024 { 00025 typedef typename SrcArrayT::ArithType ArithT; // expected to be int 00026 00027 // to speedup compute here the min and max gray values 00028 ArithT minVal, maxVal; 00029 PixMinMax(src, &minVal, &maxVal); 00030 00031 // The result (distImage) is actually a side-effect of the watershed algo... 00032 Array2dScalarInt32 distImage(src->CW(), src->CH(), 0, 0); 00033 MatSet(&distImage, 0); 00034 00035 Trait::QbWatershed<DstArrayT, SrcArrayT, SrcArrayT> 00036 qb(src->CW(), src->CH(), minVal, maxVal, &distImage); 00037 SrcArrayT* src2 = ArrayClone<SrcArrayT>(src); 00038 Pattern::PatQueueBased(dst, src, src2, qb, conn); 00039 delete src2; 00040 00041 Set(dst, &distImage); 00042 }
Here is the call graph for this function:
|