merge Detection structure for CPU and GPU soft cascade detectors
This commit is contained in:
@@ -139,12 +139,11 @@ int main(int argc, char** argv)
|
||||
std::stringstream conf(std::stringstream::in | std::stringstream::out);
|
||||
conf << d.confidence;
|
||||
|
||||
cv::rectangle(frame, cv::Rect(d.bb.x, d.bb.y, d.bb.width, d.bb.height), cv::Scalar(b, 0, 255 - b, 255), 2);
|
||||
cv::putText(frame, conf.str() , cv::Point(d.bb.x + 10, d.bb.y - 5),1, 1.1, cv::Scalar(25, 133, 255, 0), 1, CV_AA);
|
||||
cv::rectangle(frame, cv::Rect((int)d.x, (int)d.y, (int)d.w, (int)d.h), cv::Scalar(b, 0, 255 - b, 255), 2);
|
||||
cv::putText(frame, conf.str() , cv::Point((int)d.x + 10, (int)d.y - 5),1, 1.1, cv::Scalar(25, 133, 255, 0), 1, CV_AA);
|
||||
|
||||
if (wf)
|
||||
myfile << d.bb.x << "," << d.bb.y << ","
|
||||
<< d.bb.width << "," << d.bb.height << "," << d.confidence << "\n";
|
||||
myfile << d.x << "," << d.y << "," << d.w << "," << d.h << "," << d.confidence << "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -3,6 +3,8 @@
|
||||
#include <opencv2/highgui.hpp>
|
||||
#include <iostream>
|
||||
|
||||
typedef cv::softcascade::Detection Detection;
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
const std::string keys =
|
||||
@@ -64,7 +66,7 @@ int main(int argc, char** argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
cv::gpu::GpuMat objects(1, sizeof(SCascade::Detection) * 10000, CV_8UC1);
|
||||
cv::gpu::GpuMat objects(1, sizeof(Detection) * 10000, CV_8UC1);
|
||||
cv::gpu::printShortCudaDeviceInfo(parser.get<int>("device"));
|
||||
for (;;)
|
||||
{
|
||||
@@ -80,7 +82,6 @@ int main(int argc, char** argv)
|
||||
cascade.detect(dframe, roi, objects);
|
||||
|
||||
cv::Mat dt(objects);
|
||||
typedef cv::softcascade::SCascade::Detection Detection;
|
||||
|
||||
Detection* dts = ((Detection*)dt.data) + 1;
|
||||
int* count = dt.ptr<int>(0);
|
||||
|
Reference in New Issue
Block a user