FileNode fns = *it;
float scale = (float)fns[SC_OCT_SCALE];
scales.push_back(scale);
- ushort nstages = saturate_cast<ushort>((int)fn[SC_OCT_STAGES]);
+ ushort nstages = saturate_cast<ushort>((int)fns[SC_OCT_STAGES]);
ushort2 size;
size.x = cvRound(ORIG_OBJECT_WIDTH * scale);
size.y = cvRound(ORIG_OBJECT_HEIGHT * scale);
- shrinkage = saturate_cast<ushort>((int)fn[SC_OCT_SHRINKAGE]);
+ shrinkage = saturate_cast<ushort>((int)fns[SC_OCT_SHRINKAGE]);
icf::Octave octave(octIndex, nstages, shrinkage, size, scale);
CV_Assert(octave.stages > 0);
for (; st != st_end; ++st )
{
fns = *st;
- vstages.push_back((float)fn[SC_STAGE_THRESHOLD]);
+ vstages.push_back((float)fns[SC_STAGE_THRESHOLD]);
fns = fns[SC_WEEK];
FileNodeIterator ftr = fns.begin(), ft_end = fns.end();
for (; inIt != inIt_end;)
{
int feature = (int)(*(inIt +=2)++) + feature_offset;
- vnodes.push_back(icf::Node(feature, (float)(*(inIt++))));
+ float th = (float)(*(inIt++));
+ vnodes.push_back(icf::Node(feature, th));
}
fns = (*ftr)[SC_LEAF];
calcLevels(voctaves, FRAME_WIDTH, FRAME_HEIGHT, TOTAL_SCALES);
CV_Assert(!levels.empty());
- // init Cascade
+ //init Cascade
cascade = icf::Cascade(octaves, stages, nodes, leaves, features, levels);
// allocate buffers
float a = A[(int)(scaling >= 1)][(int)(channel > 6)];
float b = B[(int)(scaling >= 1)][(int)(channel > 6)];
- printf("!!! scaling: %f %f %f -> %f\n", scaling, a, b, a * pow(scaling, b));
+ // printf("!!! scaling: %f %f %f -> %f\n", scaling, a, b, a * pow(scaling, b));
return a * pow(scaling, b);
}
};
if (::fabs(scale - maxScale) < FLT_EPSILON) break;
scale = ::std::min(maxScale, ::expf(::log(scale) + logFactor));
- levels.upload(cv::Mat(1, vlevels.size() * sizeof(icf::Level), CV_8UC1, (uchar*)&(vlevels[0]) ));
-
- // std::cout << "level " << sc << " scale "
- // << levels[sc].origScale
+ // std::cout << "level " << sc
// << " octeve "
- // << levels[sc].octave->scale
- // << " "
- // << levels[sc].relScale
- // << " " << levels[sc].shrScale
- // << " [" << levels[sc].objSize.width
- // << " " << levels[sc].objSize.height << "] ["
- // << levels[sc].workRect.width << " " << levels[sc].workRect.height << "]" << std::endl;
+ // << vlevels[sc].octave
+ // << " relScale "
+ // << vlevels[sc].relScale
+ // << " " << vlevels[sc].shrScale
+ // << " [" << (int)vlevels[sc].objSize.x
+ // << " " << (int)vlevels[sc].objSize.y << "] ["
+ // << (int)vlevels[sc].workRect.x << " " << (int)vlevels[sc].workRect.y << "]" << std::endl;
}
+ levels.upload(cv::Mat(1, vlevels.size() * sizeof(icf::Level), CV_8UC1, (uchar*)&(vlevels[0]) ));
}
cv::gpu::SoftCascade::SoftCascade() : filds(0) {}
TEST(SoftCascade, readCascade)
{
- std::string xml = cvtest::TS::ptr()->get_data_path() + "cascadeandhog/icf-template.xml";
+ std::string xml = cvtest::TS::ptr()->get_data_path() + "../cv/cascadeandhog/icf-template.xml";
cv::gpu::SoftCascade cascade;
ASSERT_TRUE(cascade.load(xml));
TEST(SoftCascade, detect)
{
- std::string xml = cvtest::TS::ptr()->get_data_path() + "cascadeandhog/sc_cvpr_2012_to_opencv.xml";
+ std::string xml = cvtest::TS::ptr()->get_data_path() + "../cv/cascadeandhog/sc_cvpr_2012_to_opencv.xml";
cv::gpu::SoftCascade cascade;
ASSERT_TRUE(cascade.load(xml));
- cv::Mat coloredCpu = cv::imread(cvtest::TS::ptr()->get_data_path() + "cascadeandhog/bahnhof/image_00000000_0.png");
+ cv::Mat coloredCpu = cv::imread(cvtest::TS::ptr()->get_data_path()
+ + "../cv/cascadeandhog/bahnhof/image_00000000_0.png");
ASSERT_FALSE(coloredCpu.empty());
GpuMat colored(coloredCpu), objectBoxes, rois;