Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

template<class DstArrayT, class SrcArrayT>
void Impala::Core::Array::GeodesicDistanceTransform ( DstArrayT *&  dst,
SrcArrayT *  src,
int  conn 
) [inline]

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:


Generated on Fri Mar 19 10:56:38 2010 for ImpalaSrc by  doxygen 1.5.1