コード例 #1
0
RGBImage GestureContext::drawSkeleton()
{
	cv::Mat_<cv::Vec3b> newMat(480,640, cv::Vec3b(0,0,0));
	Face *f = face();
	cv::Scalar face_color(255,0,0);
	if (f) {
		cv::circle(newMat, f->center(), 9, face_color, 3);
	}
	return(RGBImage(newMat));
}
コード例 #2
0
bool
DeprecatedSharedRGBImage::ToSurfaceDescriptor(SurfaceDescriptor& aResult)
{
  if (!mAllocated) {
    return false;
  }
  this->AddRef();
  aResult = RGBImage(*mShmem,
                     nsIntRect(0, 0, mSize.width, mSize.height),
                     mImageFormat,
                     reinterpret_cast<uint64_t>(this));
  return true;
}
コード例 #3
0
bool
DeprecatedSharedRGBImage::DropToSurfaceDescriptor(SurfaceDescriptor& aResult)
{
  if (!mAllocated) {
    return false;
  }
  aResult = RGBImage(*mShmem,
                     nsIntRect(0, 0, mSize.width, mSize.height),
                     mImageFormat,
                     0);
  *mShmem = ipc::Shmem();
  mAllocated = false;
  return true;
}
コード例 #4
0
	cv::Mat extractRGBfromCloud(const PCloud& cloud){
	
		cv::Mat RGBImage(cloud->height,cloud->width,CV_8UC3);
		
		for(unsigned int v=0;v<cloud->height;v++) {	    //480
			for(unsigned int u=0;u<cloud->width;u++) {  //640
			
				RGBImage.at<cv::Vec3b>(v,u)[0] = (int) (*cloud)(u,v).b; 
				RGBImage.at<cv::Vec3b>(v,u)[1] = (int) (*cloud)(u,v).g; 
				RGBImage.at<cv::Vec3b>(v,u)[2] = (int) (*cloud)(u,v).r; 	
			}
		}
	
		return RGBImage;
	}
コード例 #5
0
  void MultiProjector::unproject(Cloud& cloud, const RawDepthImage& depth_image, const RGBImage& rgb_image){
    Cloud temp;
    cloud.clear();
    for (size_t i = 0; i<_projectors.size(); i++) {
      if (!_projectors[i]) {
	continue;
      }
      unsigned short * zb= const_cast<unsigned short*>(depth_image.ptr<const unsigned short>(_mono_rows*i));


      RGBImage mono_rgb;
      RawDepthImage mono_zbuffer(_mono_rows, _image_cols,zb); 
      if (rgb_image.rows && rgb_image.cols) {
	cv::Vec3b * rgbb= const_cast<cv::Vec3b*>(rgb_image.ptr<const cv::Vec3b>(_mono_rows*i));
	mono_rgb = RGBImage(_mono_rows, _image_cols, rgbb);
      }
      _projectors[i]->unproject(temp, mono_zbuffer, mono_rgb);
      cloud.add(temp);
    }
    cloud.transformInPlace(_camera_info->offset());
  }
コード例 #6
0
QPixmap colorengine::getQPixmap(const cv::Rect& crop)
{
    return RGBImage(*master_xyz.get(), crop).getQPixmap();
}