Ejemplo n.º 1
0
// ######################################################################
Image<float> SimulationViewer::getMap(SimEventQueue& q,
                                      const bool warn) const
{
  const float fac = itsMapFactor.getVal();
  const std::string typ = itsMapType.getVal();
  Image<float> ret;

  if (typ.compare("SM") == 0)
    {
      if (SeC<SimEventSaliencyMapOutput> e =
          q.check<SimEventSaliencyMapOutput>(this, SEQ_ANY))
        ret = e->sm(fac);
      else if (warn) LERROR("Could not get a Saliency Map!");
    }
  else if  (typ.compare("TRM") == 0)
    {
      if (SeC<SimEventTaskRelevanceMapOutput> e =
          q.check<SimEventTaskRelevanceMapOutput>(this, SEQ_ANY))
        ret = e->trm(fac);
      else if (warn) LERROR("Could not get a Task Relevance Map!");
    }
  else if (typ.compare("AGM") == 0)
    {
      if (SeC<SimEventAttentionGuidanceMapOutput> e =
          q.check<SimEventAttentionGuidanceMapOutput>(this, SEQ_ANY))
        ret = e->agm(fac);
      else if (warn) LERROR("Could not get an Attention Guidance Map!");
    }
  else if  (typ.compare("VCO") == 0)
    {
      if (SeC<SimEventVisualCortexOutput> e =
          q.check<SimEventVisualCortexOutput>(this, SEQ_ANY))
        ret = e->vco(fac);
      else if (warn) LERROR("Could not get a Visual Cortex Output Map!");
    }
  else LFATAL("Unknown desired map type '%s'", typ.c_str());

  //inverse the map, will only happen if necessary default does nothing
  ret = inverseMap(ret);
  
  return ret;
}
Ejemplo n.º 2
0
void Map::warp(const Mat& img1, Mat& img2) const
{
    Ptr<Map> invMap;
    inverseMap(invMap);
    invMap->inverseWarp(img1, img2);
}