本文整理汇总了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);
}
示例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);
}