/******************************************************************** ** Image Component Library (ICL) ** ** ** ** Copyright (C) 2006-2012 CITEC, University of Bielefeld ** ** Neuroinformatics Group ** ** Website: www.iclcv.org and ** ** http://opensource.cit-ec.de/projects/icl ** ** ** ** File : ICLBlob/src/ColorBlobSearcher.cpp ** ** Module : ICLBlob ** ** Authors: Christof Elbrechter, Robert Haschke ** ** ** ** ** ** Commercial License ** ** ICL can be used commercially, please refer to our website ** ** www.iclcv.org for more details. ** ** ** ** GNU General Public License Usage ** ** Alternatively, this file may be used under the terms of the ** ** GNU General Public License version 3.0 as published by the ** ** Free Software Foundation and appearing in the file LICENSE.GPL ** ** included in the packaging of this file. Please review the ** ** following information to ensure the GNU General Public License ** ** version 3.0 requirements will be met: ** ** http://www.gnu.org/copyleft/gpl.html. ** ** ** ** The development of this software was supported by the ** ** Excellence Cluster EXC 277 Cognitive Interaction Technology. ** ** The Excellence Cluster EXC 277 is a grant of the Deutsche ** ** Forschungsgemeinschaft (DFG) in the context of the German ** ** Excellence Initiative. ** ** ** *********************************************************************/ #include namespace icl{ template const vector > &ColorBlobSearcher:: search(Img *poImage, Img8u *poMask){ ICLASSERT_RETURN_VAL( poImage->getChannels() == 3 , m_vecFoundBlobs ); icl8u *mask = 0; if(poMask){ mask = poMask->getData(0); ICLASSERT_RETURN_VAL( poImage->getSize() == poMask->getSize() , m_vecFoundBlobs ); } prepareForNewImage(poImage,poMask); PixelType *pt0 = poImage->getData(0); PixelType *pt1 = poImage->getData(1); PixelType *pt2 = poImage->getData(2); Rect oRoi = poImage->getROI(); int x,y,i,d; int iImageW = poImage->getSize().width; if(mask){ for(y =oRoi.y; y::m_vecPR.size();d++){ storeResult(d,x,y,PixelRatingGroup::m_vecPR[d]->rate(pt0[i],pt1[i],pt2[i])); } } } } }else{ for(y =oRoi.y; y::m_vecPR.size();d++){ storeResult(d,x,y,PixelRatingGroup::m_vecPR[d]->rate(pt0[i],pt1[i],pt2[i])); } } } } evaluateResults(m_vecFoundBlobs); return m_vecFoundBlobs; } template void ColorBlobSearcher::addPR(PixelRating *pr){ PixelRatingGroup::addPR(pr); pixelRatingAdded(pr); } template void ColorBlobSearcher::removePR(int index){ if( PixelRatingGroup::removePR(index) ){ pixelRatingRemoved(index); } } template void ColorBlobSearcher::feedback(const FoundBlobVector &results, Img *image){ (void)results; (void)image; } template ColorBlobSearcher::~ColorBlobSearcher(){} template void ColorBlobSearcher::pixelRatingAdded(PixelRating *pr){ (void)pr; } template void ColorBlobSearcher::pixelRatingRemoved(int index){ (void)index; } template void ColorBlobSearcher::prepareForNewImage(Img *poImage, Img8u *poMask) { (void)poImage; (void)poMask; } template class ColorBlobSearcher; template class ColorBlobSearcher; }