Esempio n. 1
0
void
vpPlotCurve::plotPoint(const vpImage<unsigned char> &I, const vpImagePoint &iP, const double x, const double y)
{  
  nbPoint++;
  
  if (nbPoint > 1)
  {
    vpDisplay::displayLine(I,lastPoint, iP, color, thickness);
  }
#if defined (VISP_HAVE_DISPLAY)
  double top;
  double left;
  double width;
  double height;
  
  if (iP.get_i() <= lastPoint.get_i()) {top = iP.get_i()-5; height = lastPoint.get_i() - top+10;}
  else {top = lastPoint.get_i()-5; height = iP.get_i() - top+10;}
  if (iP.get_j() <= lastPoint.get_j()) {left = iP.get_j()-5; width = lastPoint.get_j() - left+10;}
  else {left = lastPoint.get_j()-5; width = iP.get_j() - left+10;}
  vpDisplay::flushROI(I,vpRect(left,top,width,height));
#endif
  lastPoint = iP;
  pointListx.push_back(x);
  pointListy.push_back(y);
  pointListz.push_back(0.0);
}
Esempio n. 2
0
void
vpPlotCurve::plotPoint(vpImage<unsigned char> &I, vpImagePoint iP, const double x, const double y)
{
  pointListx.end();
  pointListy.end();
  pointListz.end();
  
  nbPoint++;
  
  if (nbPoint > 1)
  {
    vpDisplay::displayLine(I,lastPoint, iP, color);
  }
#if( defined VISP_HAVE_X11 || defined VISP_HAVE_GDI )
  double top;
  double left;
  double width;
  double height;
  
  if (iP.get_i() <= lastPoint.get_i()) {top = iP.get_i()-5; height = lastPoint.get_i() - top+10;}
  else {top = lastPoint.get_i()-5; height = iP.get_i() - top+10;}
  if (iP.get_j() <= lastPoint.get_j()) {left = iP.get_j()-5; width = lastPoint.get_j() - left+10;}
  else {left = lastPoint.get_j()-5; width = iP.get_j() - left+10;}
  vpDisplay::flushROI(I,vpRect(left,top,width,height));
#endif
  lastPoint = iP;
  pointListx.addRight(x);
  pointListy.addRight(y);
  pointListz.addRight(0.0);
}
Esempio n. 3
0
QRect LvlScene::getViewportRect()
{
    QRect vpRect(0,0,0,0);
    if(_viewPort)
    {
        vpRect.setLeft(this->_viewPort->horizontalScrollBar()->value());
        vpRect.setTop(this->_viewPort->verticalScrollBar()->value());
        vpRect.setWidth(_viewPort->viewport()->width());
        vpRect.setHeight(_viewPort->viewport()->height());
    }
    return vpRect;
}
/*!
  Compute the detection and the brightness filtering (if set).

  \param I: Image.
  \param scaleFactor: Parameter specifying how much the image size is reduced at each image scale.
  \param minNeighbors: Parameter specifying how many neighbors each candidate rectangle should have to retain it.
  \param minSize: Minimum possible object size. Objects smaller than that are ignored.
  \param maxSize: Maximum possible object size. Objects larger than that are ignored.
*/
void vpCascadeClassifier::computeDetection(const vpImage<unsigned char> &I, const double scaleFactor, const int minNeighbors,
    const cv::Size &minSize, const cv::Size &maxSize) {
  m_objectBoundingBoxes.clear();
  m_vectorOfDetectedObjects.clear();

  cv::Mat matImg;
  vpImageConvert::convert(I, matImg);

  std::vector<cv::Rect> objects;
  m_classifierDetector.detectMultiScale(matImg, objects, scaleFactor, minNeighbors, 0, minSize, maxSize);

  for(std::vector<cv::Rect>::const_iterator it = objects.begin(); it != objects.end(); ++it) {
    m_objectBoundingBoxes.push_back(vpRect(it->x, it->y, it->width, it->height));
  }

  //Predefined brightness filtering
  if(m_brightnessFilterType != NO_BRIGHTNESS_FILTER) {
    filterTooDarkObjects(I, m_objectBoundingBoxes);
    filterTooBrightObjects(I, m_objectBoundingBoxes);
  }
}