コード例 #1
0
	void RealSenseDetector::run() {
		while (!stopped){

			ImageGrayscale img;
			{
				Poco::Mutex::ScopedLock lock(imMutex);
				if (imageVector.size()) {
					img = imageVector.back();
					imageVector.clear();
				}
			}

			if (img.data == 0) {
				wakeEvent.wait();
				continue;
			}

			std::vector<cv::Rect> _rects = detectImpl(img);
			{
				Poco::Mutex::ScopedLock lock(rectMutex);
				this->rects = _rects;
			}
		}

	}
コード例 #2
0
/* requires line detection (only one image) */
void LSDDetector::detect( const Mat& image, CV_OUT std::vector<KeyLine>& keylines, int scale, int numOctaves, const Mat& mask )
{
  if( mask.data != NULL && ( mask.size() != image.size() || mask.type() != CV_8UC1 ) )
    CV_Error( Error::StsBadArg, "Mask error while detecting lines: please check its dimensions and that data type is CV_8UC1" );

  else
    detectImpl( image, keylines, numOctaves, scale, mask );
}
コード例 #3
0
ファイル: detectors.cpp プロジェクト: 09beezahmad/opencv
void FeatureDetector::detect( const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask ) const
{
    keypoints.clear();

    if( image.empty() )
        return;

    CV_Assert( mask.empty() || (mask.type() == CV_8UC1 && mask.size() == image.size()) );

    detectImpl( image, keypoints, mask );
}
コード例 #4
0
/* requires line detection (more than one image) */
void LSDDetector::detect( const std::vector<Mat>& images, std::vector<std::vector<KeyLine> >& keylines, int scale, int numOctaves,
                          const std::vector<Mat>& masks ) const
{
  /* detect lines from each image */
  for ( size_t counter = 0; counter < images.size(); counter++ )
  {
    if( masks[counter].data != NULL && ( masks[counter].size() != images[counter].size() || masks[counter].type() != CV_8UC1 ) )
      CV_Error( Error::StsBadArg, "Masks error while detecting lines: please check their dimensions and that data types are CV_8UC1" );

    else
      detectImpl( images[counter], keylines[counter], numOctaves, scale, masks[counter] );
  }
}