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


C++ BoundingBox::Unscale方法代码示例

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


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

示例1: ShowTracking

void Tracker::ShowTracking(const cv::Mat& target_pad, const cv::Mat& curr_search_region, const BoundingBox& bbox_estimate) const {
    // Resize the target.
    cv::Mat target_resize;
    cv::resize(target_pad, target_resize, cv::Size(227, 227));

    // Show the resized target.
    cv::namedWindow("Target", cv::WINDOW_AUTOSIZE );// Create a window for display.
    cv::imshow("Target", target_resize );                   // Show our image inside it.

    // Resize the image.
    cv::Mat image_resize;
    cv::resize(curr_search_region, image_resize, cv::Size(227, 227));

    // Unscale the estimate to match the rescaled image.
    BoundingBox bbox_estimate_unscaled;
    bbox_estimate.Unscale(image_resize, &bbox_estimate_unscaled);

    // Show the tracking estimate on the image.
    cv::Mat image_with_box;
    image_resize.copyTo(image_with_box);
    bbox_estimate_unscaled.DrawBoundingBox(&image_with_box);

    cv::namedWindow("Estimate", cv::WINDOW_AUTOSIZE );// Create a window for display.
    cv::imshow("Estimate", image_with_box );                   // Show our image inside it.
    cv::waitKey(0);
}
开发者ID:LCAD-UFES,项目名称:carmen_lcad,代码行数:26,代码来源:tracker.cpp

示例2: VisualizeExample

void ExampleGenerator::VisualizeExample(const cv::Mat& target_pad,
                                        const cv::Mat& image_rand_focus,
                                        const BoundingBox& bbox_gt_scaled) const {
  const bool save_images = false;

  // Show resized target.
  cv::Mat target_resize;
  cv::resize(target_pad, target_resize, cv::Size(227,227));
  cv::namedWindow("Target object", cv::WINDOW_AUTOSIZE );// Create a window for display.
  cv::imshow("Target object", target_resize);                   // Show our image inside it.
  if (save_images) {
    const string target_name = "Image" + num2str(video_index_) + "_" + num2str(frame_index_) + "target.jpg";
    cv::imwrite(target_name, target_resize);
  }

  // Resize the image.
  cv::Mat image_resize;
  cv::resize(image_rand_focus, image_resize, cv::Size(227, 227));

  // Draw gt bbox.
  BoundingBox bbox_gt_unscaled;
  bbox_gt_scaled.Unscale(image_resize, &bbox_gt_unscaled);
  bbox_gt_unscaled.Draw(0, 255, 0, &image_resize);

  // Show image with bbox.
  cv::namedWindow("Search_region+gt", cv::WINDOW_AUTOSIZE );// Create a window for display.
  cv::imshow("Search_region+gt", image_resize );                   // Show our image inside it.
  if (save_images) {
    const string image_name = "Image" + num2str(video_index_) + "_" + num2str(frame_index_) + "image.jpg";
    cv::imwrite(image_name, image_resize);
  }

  cv::waitKey(0);
}
开发者ID:DeepModel,项目名称:GOTURN,代码行数:34,代码来源:example_generator.cpp


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