当前位置: 首页>>代码示例>>C++>>正文


C++ scoped_ptr::detect方法代码示例

本文整理汇总了C++中boost::scoped_ptr::detect方法的典型用法代码示例。如果您正苦于以下问题:C++ scoped_ptr::detect方法的具体用法?C++ scoped_ptr::detect怎么用?C++ scoped_ptr::detect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在boost::scoped_ptr的用法示例。


在下文中一共展示了scoped_ptr::detect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: process

        /*! @brief the main processing callback of the ECTO pipeline
         *
         * this method is called once all input dependencies are satisfied.
         * The PartsBasedDetector has two input dependencies: a color image and depth image,
         * both retrieved from the Kinect. If any detection candidates are found,
         * the bounding boxes, detection confidences and object ids are returned
         *
         * @param inputs the input tendrils
         * @param outputs the output tendrils
         * @return
         */
        int
        process(const tendrils& inputs, const tendrils& outputs) {
            std::cout << "detector: process" << std::endl;

            std::vector<Candidate> candidates;
            detector_->detect(*color_, *depth_, candidates);

            if (true) {
            	if (candidates.size() > 0) {
            		Candidate::sort(candidates);
            		visualizer_->candidates(*color_, candidates, 1, *output_, true);
            	} else {
                    cvtColor(*color_, *output_, CV_RGB2BGR);
            	}
                cv::waitKey(30);
            }

            pose_results_->clear();
            return ecto::OK;
        }
开发者ID:singhshalender,项目名称:PartsBasedDetector,代码行数:31,代码来源:detect.cpp

示例2: process

	/*! @brief the main processing callback of the ECTO pipeline
	 *
	 * this method is called once all input dependencies are satisfied.
	 * The PartsBasedDetector has two input dependencies: a color image and depth image,
	 * both retrieved from the Kinect. If any detection candidates are found,
	 * the bounding boxes, detection confidences and object ids are returned
	 *
	 * @param inputs the input tendrils
	 * @param outputs the output tendrils
	 * @return
	 */
	int process(const tendrils& inputs, const tendrils& outputs)
	{
		std::cout << "detector: process" << std::endl;

		pose_results_->clear();

		image_pipeline::PinholeCameraModel camera_model;
		camera_model.setParams(color_->size(), *camera_intrinsics_, cv::Mat(),
				cv::Mat(), cv::Mat());

		std::vector<Candidate> candidates;
		detector_->detect(*color_, *depth_, candidates);

		if (candidates.size() == 0)
		{
			if (*visualize_)
			{
				cv::cvtColor(*color_, *output_, CV_RGB2BGR);
				//cv::waitKey(30);
			}

			return ecto::OK;
		}

		Candidate::sort(candidates);
		Candidate::nonMaximaSuppression(*color_, candidates, *max_overlap_);

		if (*visualize_)
		{
			visualizer_->candidates(*color_, candidates, candidates.size(), *output_, true);
			cv::cvtColor(*output_, *output_, CV_RGB2BGR);
			//cv::waitKey(30);
		}

		std::vector<Rect3d> bounding_boxes;
		std::vector<PointCloud> parts_centers;

		typename PointCloudClusterer<PointType>::PointProjectFunc projecter =
				boost::bind(&PartsBasedDetectorCell::projectPixelToRay, this,
						camera_model, _1);
		PointCloudClusterer<PointType>::computeBoundingBoxes(candidates,
				*color_, *depth_, projecter, *input_cloud_, bounding_boxes,
				parts_centers);


		// output clusters
		std::vector<PointType> object_centers;
		std::vector<PointCloud> clusters;

		// remove planes from input cloud if needed
		if(*remove_planes_)
		{
			PointCloud::Ptr clusterer_cloud (new PointCloud());
			PointCloudClusterer<PointType>::organizedMultiplaneSegmentation(*input_cloud_, *clusterer_cloud);
			PointCloudClusterer<PointType>::clusterObjects(clusterer_cloud,
					bounding_boxes, clusters, object_centers);
		}
		else
		{
			PointCloudClusterer<PointType>::clusterObjects(*input_cloud_,
					bounding_boxes, clusters, object_centers);
		}




		// compute poses (centroid of part centers)

		// for each object
		for (int object_it = 0; object_it < candidates.size(); ++object_it)
		{
			if(std::isnan(object_centers[object_it].x) || std::isnan(object_centers[object_it].y) || std::isnan(object_centers[object_it].z))
				continue;

			PoseResult result;

			// no db for now, only one model
			result.set_object_id(*object_db_, model_name_);
			result.set_confidence(candidates[object_it].score());

			// set the clustered cloud's center as a center...
			result.set_T(Eigen::Vector3f(object_centers[object_it].getVector3fMap()));

//			// For the rotation a minimum of two parts is needed
//			if (part_centers_cloud.size() >= 2 &&
//					!pcl_isnan(part_centers_cloud[0].x) &&
//					!pcl_isnan(part_centers_cloud[0].y) &&
//					!pcl_isnan(part_centers_cloud[0].z) &&
//					!pcl_isnan(part_centers_cloud[1].x) &&
//.........这里部分代码省略.........
开发者ID:biometrics,项目名称:PartsBasedDetector,代码行数:101,代码来源:detect.cpp


注:本文中的boost::scoped_ptr::detect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。