Commit d9fe1bd018dc06879c2a6b6325ee9a0fb748ca6e

Authored by Jordan Cheney
1 parent 9567b975

Step 1 (OpenCV I/O within OpenBR) complete

openbr/core/cascade.cpp
... ... @@ -209,7 +209,7 @@ void CascadeParams::write( FileStorage &fs ) const
209 209 string stageTypeStr = stageType == BOOST ? CC_BOOST : string();
210 210 CV_Assert( !stageTypeStr.empty() );
211 211 fs << CC_STAGE_TYPE << stageTypeStr;
212   - string featureTypeStr = featureType == FeatureParams::LBP ? CC_HAAR :
  212 + string featureTypeStr = featureType == FeatureParams::LBP ? CC_LBP :
213 213 0;
214 214 CV_Assert( !stageTypeStr.empty() );
215 215 fs << CC_FEATURE_TYPE << featureTypeStr;
... ... @@ -544,7 +544,6 @@ bool BrCascadeClassifier::readParams( const FileNode &amp;node )
544 544 FileNode rnode = node[CC_STAGE_PARAMS];
545 545 if ( !stageParams->read( rnode ) )
546 546 return false;
547   -
548 547 featureParams = FeatureParams::create(cascadeParams.featureType);
549 548 rnode = node[CC_FEATURE_PARAMS];
550 549 if ( !featureParams->read( rnode ) )
... ... @@ -599,12 +598,16 @@ void BrCascadeClassifier::save( const string filename, bool baseFormat )
599 598 bool BrCascadeClassifier::load( const string cascadeDirName )
600 599 {
601 600 FileStorage fs( cascadeDirName + CC_PARAMS_FILENAME, FileStorage::READ );
602   - if ( !fs.isOpened() )
  601 + qDebug() << "1";
  602 + if ( !fs.isOpened() ) {
  603 + qDebug() << "2";
603 604 return false;
  605 + }
604 606 FileNode node = fs.getFirstTopLevelNode();
605   - if ( !readParams( node ) )
  607 + if ( !readParams( node ) ) {
  608 + qDebug() << "3";
606 609 return false;
607   -
  610 + }
608 611 featureEvaluator = FeatureEvaluator::create(cascadeParams.featureType);
609 612 featureEvaluator->init( ((FeatureParams*)featureParams), numPos + numNeg, cascadeParams.winSize );
610 613 fs.release();
... ...
openbr/plugins/metadata/cascade.cpp
... ... @@ -111,7 +111,7 @@ class CascadeTransform : public MetaTransform
111 111 QString cascadeDir = Globals->sdkPath + "/share/openbr/models/openbrcascades/" + model;
112 112 classifier.train(cascadeDir.toStdString(),
113 113 vecFile.toStdString(), negFile.toStdString(),
114   - numPos, numNeg, 1024, 1024, 20,
  114 + numPos, numNeg, 1024, 1024, 17,
115 115 cascadeParams, featureParams, stageParams);
116 116 }
117 117  
... ...