remove debug imshow from code
This commit is contained in:
@@ -59,11 +59,36 @@ TEST(SoftCascade, detect)
|
||||
cv::Mat colored = cv::imread(cvtest::TS::ptr()->get_data_path() + "cascadeandhog/bahnhof/image_00000000_0.png");
|
||||
ASSERT_FALSE(colored.empty());
|
||||
|
||||
std::vector<detection_t> objectBoxes;
|
||||
std::vector<detection_t> objects;
|
||||
std::vector<cv::Rect> rois;
|
||||
rois.push_back(cv::Rect(0, 0, 640, 480));
|
||||
// ASSERT_NO_THROW(
|
||||
// {
|
||||
cascade.detectMultiScale(colored, rois, objectBoxes);
|
||||
// });
|
||||
|
||||
cascade.detectMultiScale(colored, rois, objects);
|
||||
|
||||
std::cout << "detected: " << (int)objects.size() << std::endl;
|
||||
|
||||
cv::Mat out = colored.clone();
|
||||
int level = 0, total = 0;
|
||||
int levelWidth = objects[0].rect.width;
|
||||
|
||||
for(int i = 0 ; i < (int)objects.size(); ++i)
|
||||
{
|
||||
if (objects[i].rect.width != levelWidth)
|
||||
{
|
||||
std::cout << "Level: " << level << " total " << total << std::endl;
|
||||
cv::imshow("out", out);
|
||||
cv::waitKey(0);
|
||||
|
||||
out = colored.clone();
|
||||
levelWidth = objects[i].rect.width;
|
||||
total = 0;
|
||||
level++;
|
||||
}
|
||||
cv::rectangle(out, objects[i].rect, cv::Scalar(255, 0, 0, 255), 1);
|
||||
std::cout << "detection: " << objects[i].rect.x
|
||||
<< " " << objects[i].rect.y
|
||||
<< " " << objects[i].rect.width
|
||||
<< " " << objects[i].rect.height << std::endl;
|
||||
total++;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user