Public Member Functions | |
Constructors and Destructors | |
CudaSaliency (OptionManager &mgr, const std::string &descrName="CudaSaliency", const std::string &tagName="CudaSaliency") | |
Constructor. | |
~CudaSaliency () | |
Destructor. | |
member functions | |
virtual void | paramChanged (ModelParamBase *const param, const bool valueChanged, ParamClient::ChangeStatus *status) |
Called whenever a ModelParamBase has its value changed. | |
void | doInput (const Image< PixRGB< byte > > img) |
Setup up with image to be processed and build the job queue. | |
void | doCudaInput (const CudaImage< PixRGB< float > > img) |
void | setDevice (MemoryPolicy mp_in, int dev_in) |
void | clearMaps () |
bool | outputReady () |
Is the last given input done processing? | |
Image< float > | getOutput () |
Get last computed output. | |
CudaImage< float > | getCudaOutput () |
CudaImage< float > | getIMap () |
CudaImage< float > | getCMap () |
CudaImage< float > | getOMap () |
CudaImage< float > | getFMap () |
CudaImage< float > | getMMap () |
CudaImage< float > | getInertiaMap () |
CudaImage< float > | getInhibitionMap () |
std::vector< Point2D< int > > | getSalMaxLoc () |
std::vector< float > | getSalMax () |
double | getPatchSize () |
void | runSaliency () |
For internal thread use: Compute a conspicuity map from an image. | |
CudaImage< float > | cudaPostChannel (CudaImage< float > curImage, PyramidType ptyp, float orientation, float weight, CudaImage< float > &outmap) |
Calculate the pyramid and post the generated conspicuity map to the saliency output mapt. | |
CudaImage< float > | processPyramid (CudaImageSet< float > pyr) |
void | calcIntensity (const CudaImage< PixRGB< float > > &colImage, CudaImage< float > &outmap) |
Calculate intensity channel. | |
void | calcColor (const CudaImage< PixRGB< float > > &colImage, CudaImage< float > &outmap) |
Calculate the red/green & blue/yellow color oppponent channel. | |
void | calcOrientation (const CudaImage< PixRGB< float > > &colImage, float orientation, CudaImage< float > &outmap) |
Calculate a particular orientation channel. | |
void | calcFlicker (const CudaImage< PixRGB< float > > &colImage, CudaImage< float > &outmap) |
Calculate the flicker channel. | |
void | calcMotion (const CudaImage< PixRGB< float > > &colImage, int motionIndex) |
Calculate the motion channel. | |
void | calcInhibition (const CudaImage< float > &salMap) |
Calculate inhibition of return on the saliency map. | |
void | calcInertia (const CudaImage< float > &salMap) |
Calculate inertia on the saliency map. | |
Protected Member Functions | |
void | start1 () |
get started | |
void | stop2 () |
get stopped |
Definition at line 62 of file CudaSaliency.H.
CudaSaliency::CudaSaliency | ( | OptionManager & | mgr, | |
const std::string & | descrName = "CudaSaliency" , |
|||
const std::string & | tagName = "CudaSaliency" | |||
) |
CudaSaliency::~CudaSaliency | ( | ) |
Destructor.
Definition at line 168 of file CudaSaliency.C.
void CudaSaliency::calcColor | ( | const CudaImage< PixRGB< float > > & | colImage, | |
CudaImage< float > & | outmap | |||
) |
Calculate the red/green & blue/yellow color oppponent channel.
Definition at line 414 of file CudaSaliency.C.
References cudaPostChannel(), and Gaussian5.
Referenced by runSaliency().
void CudaSaliency::calcFlicker | ( | const CudaImage< PixRGB< float > > & | colImage, | |
CudaImage< float > & | outmap | |||
) |
Calculate the flicker channel.
Definition at line 439 of file CudaSaliency.C.
References cudaPostChannel(), Gaussian5, CudaImage< T >::getDims(), CudaImage< T >::initialized(), and ZEROS.
Referenced by runSaliency().
void CudaSaliency::calcInertia | ( | const CudaImage< float > & | salMap | ) |
Calculate inertia on the saliency map.
Definition at line 325 of file CudaSaliency.C.
References ASSERT, CudaImage< T >::getCudaArrayPtr(), CudaImage< T >::getDims(), CudaImage< T >::getHeight(), CudaImage< T >::getMemoryDevice(), CudaImage< T >::getMemoryPolicy(), OModelParam< T >::getVal(), CudaImage< T >::getWidth(), Dims::h(), HOST_MEMORY, Point2D< T >::i, Dims::w(), and ZEROS.
void CudaSaliency::calcInhibition | ( | const CudaImage< float > & | salMap | ) |
Calculate inhibition of return on the saliency map.
Definition at line 366 of file CudaSaliency.C.
References ASSERT, CudaImage< T >::clear(), CudaImage< T >::getCudaArrayPtr(), CudaImage< T >::getDims(), CudaImage< T >::getHeight(), CudaImage< T >::getMemoryDevice(), CudaImage< T >::getMemoryPolicy(), OModelParam< T >::getVal(), CudaImage< T >::getWidth(), Dims::h(), HOST_MEMORY, Dims::w(), and ZEROS.
Referenced by runSaliency().
void CudaSaliency::calcIntensity | ( | const CudaImage< PixRGB< float > > & | colImage, | |
CudaImage< float > & | outmap | |||
) |
Calculate intensity channel.
Definition at line 395 of file CudaSaliency.C.
References Gaussian5, and CudaImage< T >::initialized().
Referenced by runSaliency().
Calculate the motion channel.
Definition at line 460 of file CudaSaliency.C.
References CudaReichardtPyrBuilder< T >::build(), and CudaImage< T >::initialized().
Referenced by runSaliency().
void CudaSaliency::calcOrientation | ( | const CudaImage< PixRGB< float > > & | colImage, | |
float | orientation, | |||
CudaImage< float > & | outmap | |||
) |
Calculate a particular orientation channel.
Definition at line 425 of file CudaSaliency.C.
References cudaPostChannel(), CudaImage< T >::initialized(), and Oriented5.
Referenced by runSaliency().
CudaImage< float > CudaSaliency::cudaPostChannel | ( | CudaImage< float > | curImage, | |
PyramidType | ptyp, | |||
float | orientation, | |||
float | weight, | |||
CudaImage< float > & | outmap | |||
) |
Calculate the pyramid and post the generated conspicuity map to the saliency output mapt.
Definition at line 280 of file CudaSaliency.C.
References CudaImage< T >::initialized().
Referenced by calcColor(), calcFlicker(), and calcOrientation().
Setup up with image to be processed and build the job queue.
Definition at line 172 of file CudaSaliency.C.
Image< float > CudaSaliency::getOutput | ( | ) |
Get last computed output.
Definition at line 220 of file CudaSaliency.C.
bool CudaSaliency::outputReady | ( | ) |
Is the last given input done processing?
Definition at line 214 of file CudaSaliency.C.
void CudaSaliency::paramChanged | ( | ModelParamBase *const | param, | |
const bool | valueChanged, | |||
ParamClient::ChangeStatus * | status | |||
) | [virtual] |
Called whenever a ModelParamBase has its value changed.
Subclasses of ModelComponent should override this function if they need to do any internal reconfiguration when their parameters change value (whether due to a command-line option, or a setModelParamString(), or a readParamsFrom()). See OrientationChannel::paramChanged() in Channels/OrientationChannel.C for an example; also see SaccadeControllerConfigurator::paramChanged() in Neuro/SaccadeControllers.C for for how to use this to select subcomponents at runtime.
param | the address of the ModelParamBase that changed; subclasses can compare this with the addresses of their model param members to figure out which is the relevant param | |
valueChanged | true if the value actually changed, false if the value was "set" but the new value is the same as the old value; some clients may want to avoid re-doing expensive operations if the value did not actually change | |
status | the subclass that implements paramChanged() should set *status to CHANGE_REJECTED if it wishes to reject a particular parameter change; the caller of paramChanged() is expected to set *status to CHANGE_ACCEPTED prior to calling paramChanged(), so the implentation of paramChanged() does not need to set *status CHANGE_ACCEPTED if it wishes to allow the change since that will already be the default status |
HISTORICAL NOTE: In the past, subclasses would override setModelParamString() for this same purpose, but in the new setup, setModelParamString() is NOT virtual and hence should not be (cannot be) overridden by subclasses. This setup is cleaner (and potentially more efficient) because subclasses don't have to compare string names to figure out which param changed; instead they are passed the address of the param itself. Furthermore, the new setup is more robust, since we can handle param value changes that come from any source (e.g., setModelParamVal(), or ModelParamBase::setValString(), or OModelParam::setVal()), and not just those that come through setModelParamString().
Reimplemented from ModelComponent.
Definition at line 130 of file CudaSaliency.C.
References OModelParam< T >::getVal().
void CudaSaliency::runSaliency | ( | ) |
For internal thread use: Compute a conspicuity map from an image.
Definition at line 476 of file CudaSaliency.C.
References calcColor(), calcFlicker(), calcInhibition(), calcIntensity(), calcMotion(), calcOrientation(), CudaImage< T >::getDims(), CudaImage< T >::getHeight(), OModelParam< T >::getVal(), CudaImage< T >::getWidth(), CudaImage< T >::initialized(), max(), MAXNORMMAX, MAXNORMMIN, min(), Timer::reset(), and ZEROS.
void CudaSaliency::start1 | ( | ) | [protected, virtual] |
get started
Reimplemented from ModelComponent.
Definition at line 147 of file CudaSaliency.C.
References Gaussian5.
void CudaSaliency::stop2 | ( | ) | [protected, virtual] |