int option_index = 0;
static struct option long_options[] = {
{"debug", no_argument, 0, 'd' },
+ {"visualDebug", no_argument, 0, 'p'},
{"help", no_argument, 0, 'h' },
{"output", required_argument, 0, 'o' },
{"visualize", optional_argument, 0, 'v' },
{0, 0, 0, 0 }
};
- int c = getopt_long(argc, argv, "dhv::f::o:", long_options, &option_index);
+ int c = getopt_long(argc, argv, "dphv::f::o:", long_options, &option_index);
if (c == -1)
break;
case 'd':
tracker.m_debug = true;
break;
+ case 'p':
+ tracker.m_visual_debug = true;
+ visualize_delay = 500;
+ break;
case 'h':
std::cerr << "Usage: \n"
<< argv[0] << " [options]\n"
}
}
#endif
+
+ if (m_visual_debug) {
+ cv::Mat all_responses(cv::Size(p_num_angles * 100, p_num_scales * 100),
+ d.threadctxs[max_idx].response.plane(0).type(), cv::Scalar::all(0));
+ for (size_t i = 0; i < p_num_scales; ++i) {
+ for (size_t j = 0; j < p_num_angles; ++j) {
+ cv::Mat in_roi(all_responses, cv::Rect(j * 100, i * 100, 100, 100));
+ cv::Mat copy_response = d.threadctxs[p_num_angles * i + j].response.plane(0).clone();
+
+ copy_response = copy_response(cv::Rect(0, 0, copy_response.cols & -2, copy_response.rows & -2));
+
+ int cx = copy_response.cols / 2;
+ int cy = copy_response.rows / 2;
+ cv::Mat q0(copy_response, cv::Rect(0, 0, cx, cy));
+ cv::Mat q1(copy_response, cv::Rect(cx, 0, cx, cy));
+ cv::Mat q2(copy_response, cv::Rect(0, cy, cx, cy));
+ cv::Mat q3(copy_response, cv::Rect(cx, cy, cx, cy));
+ cv::Mat tmp;
+ q0.copyTo(tmp);
+ q3.copyTo(q0);
+ tmp.copyTo(q3);
+ q1.copyTo(tmp);
+ q2.copyTo(q1);
+ tmp.copyTo(q2);
+
+ copy_response.copyTo(in_roi);
+ }
+ }
+ cv::namedWindow("All responses", CV_WINDOW_AUTOSIZE);
+ cv::imshow("All responses", all_responses);
+ cv::waitKey();
+ }
+
cv::Point2i &max_response_pt = IF_BIG_BATCH(d.threadctxs[0].max[max_idx].loc, d.threadctxs[max_idx].max.loc);
cv::Mat max_response_map = IF_BIG_BATCH(d.threadctxs[0].response.plane(max_idx), d.threadctxs[max_idx].response.plane(0));