資源描述:
《顯著性區(qū)域檢測(cè)代碼》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫(kù)。
1、//Saliency.h#if!defined(_SALIENCY_H_INCLUDED_)#define_SALIENCY_H_INCLUDED_#include#includeusingnamespacestd;classSaliency{public:Saliency();virtual~Saliency();public:voidGetSaliencyMap(constvector&inputimg,//INPUT:ARGBbufferinrow-majororderconstint&width
2、,constint&height,vector&salmap,//OUTPUT:Floatingpointbufferinrow-majororderconstbool&normalizeflag=true);//falseifnormalizationisnotneededprivate:voidRGB2LAB(constvector&ubuff,vector&lvec,vector&avec,vector&bvec);voidGaussianSmooth(constv
3、ector&inputImg,constint&width,constint&height,constvector&kernel,vector&smoothImg);//==============================================================================///Normalize//==============================================================================void
4、Normalize(constvector&input,constint&width,constint&height,vector&output,constint&normrange=255){doublemaxval(0);doubleminval(DBL_MAX);{inti(0);for(inty=0;yinput[i])minval=input[i];i++;
5、}}}doublerange=maxval-minval;if(0==range)range=1;inti(0);output.clear();output.resize(width*height);for(inty=0;y6、encyclass.//////////////////////////////////////////////////////////////////////////===========================================================================//Copyright(c)2009RadhakrishnaAchanta[EPFL]//===========================================================================#inc
7、lude"StdAfx.h"#include"Saliency.h"#include////////////////////////////////////////////////////////////////////////Construction/Destruction//////////////////////////////////////////////////////////////////////Saliency::Saliency(){}Saliency::~Saliency(){}//=====================
8、===================