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

template<class DstArrayT, class Src1ArrayT, class Src2ArrayT>
void Impala::Core::Array::Trait::QbWatershedMarkers2< DstArrayT, Src1ArrayT, Src2ArrayT >::Calculate ( VecNeighborsT vecneighbors  )  [inline]

Definition at line 180 of file QbWatershedMarkers2.h.

References Impala::Core::Array::Trait::QbWatershedMarkers2< DstArrayT, Src1ArrayT, Src2ArrayT >::actionsout, Impala::Core::Array::Trait::QbWatershedMarkers2< DstArrayT, Src1ArrayT, Src2ArrayT >::structPointValue::arith, Impala::Core::Array::Trait::QbWatershedMarkers2< DstArrayT, Src1ArrayT, Src2ArrayT >::center, Impala::Core::Array::Trait::QbWatershedMarkers2< DstArrayT, Src1ArrayT, Src2ArrayT >::structPointValue::cost, Impala::Core::Array::Trait::QbWatershedMarkers2< DstArrayT, Src1ArrayT, Src2ArrayT >::costImage, Impala::Core::Array::Trait::QbWatershedMarkers2< DstArrayT, Src1ArrayT, Src2ArrayT >::costmethod, Impala::Core::Array::Element::E1Norm1(), Impala::Core::Array::Trait::QbWatershedMarkers2< DstArrayT, Src1ArrayT, Src2ArrayT >::flagImage, Impala::Core::Array::Trait::QbWatershedMarkers2< DstArrayT, Src1ArrayT, Src2ArrayT >::globalOrderCounter, Impala::Core::Array::Trait::QbWatershedMarkers2< DstArrayT, Src1ArrayT, Src2ArrayT >::structPointValue::img, Impala::Core::Array::Trait::QbWatershedMarkers2< DstArrayT, Src1ArrayT, Src2ArrayT >::index, Impala::Core::Array::Trait::QbWatershedMarkers2< DstArrayT, Src1ArrayT, Src2ArrayT >::structPointValue::localOrderCounter, Impala::Core::Array::Trait::QbWatershedMarkers2< DstArrayT, Src1ArrayT, Src2ArrayT >::structPointValue::mask, Impala::Core::Geometry::PointZ::mX, Impala::Core::Geometry::PointZ::mY, Impala::Core::Array::Trait::QbWatershedMarkers2< DstArrayT, Src1ArrayT, Src2ArrayT >::neighboursout, Impala::Core::Array::Trait::QbWatershedMarkers2< DstArrayT, Src1ArrayT, Src2ArrayT >::structPointValue::point, Impala::Core::Array::Pattern::QUEUE, Impala::Core::Array::Pattern::REMOVE, Impala::Core::Array::Pattern::FcvArray< T >::size(), and Impala::Core::Array::Pattern::WRITE.

00181     {
00182         index=0; // for result()
00183         neighboursout.clear();
00184         actionsout.clear();
00185         for (int i=0; i<vecneighbors.size(); i++) {
00186             NeighborsT val=vecneighbors[i];
00187             PointValueT neighbor;
00188             neighbor.point=val.point;
00189             neighbor.arith=val.arith;
00190             neighbor.img=val.img;
00191             neighbor.mask=val.mask;
00192             if (flagImage(neighbor.point.mX, neighbor.point.mY)==false) {
00193                 int c=costImage(center.point.mX, center.point.mY);
00194                 int f=costImage(neighbor.point.mX, neighbor.point.mY);
00195                 int w;
00196                 if (costmethod==0) {
00197                     w=neighbor.img;
00198                 } else if (costmethod==1) {
00199                     w=Element::E1Norm1(center.img-neighbor.img); 
00200                 } //else throw std::string ("Error! We only deal with cost method 0 and 1. You have to define others, if you want!");
00201                 //if (w<0) // debug only
00202                 //  throw std::string("error w<0");
00203                 int maxval=(c>w?c:w);
00204                 if (maxval<f) { // line 8
00205                     // YES: remove current one and then write+queue new one
00206                     // remove this neighbour with quick retrieve info
00207                     neighbor.cost=costImage(neighbor.point.mX, neighbor.point.mY);
00208                     neighbor.localOrderCounter=0;
00209                     neighboursout.push_back(neighbor);
00210                     actionsout.push_back(Pattern::REMOVE);
00211 
00212                     // new one, do remove and write in 'arith' and queue line 10
00213                     // line 11
00214                     neighbor.arith=center.arith; // line 9
00215                     costImage(neighbor.point.mX, neighbor.point.mY)=maxval; // line 9
00216                     neighbor.localOrderCounter=globalOrderCounter++; // for equal
00217                     // values be a FIFO=QUEUE
00218                     neighbor.cost=maxval;
00219                     neighboursout.push_back(neighbor);
00220                     actionsout.push_back(Pattern::WRITE);
00221                     neighboursout.push_back(neighbor);
00222                     actionsout.push_back(Pattern::QUEUE);
00223                 }
00224             }
00225         }
00226     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:04:59 2010 for ImpalaSrc by  doxygen 1.5.1