Merge pull request #6314 from mvukad:bugfix_dtreeswrite

pull/6359/head
Maksim Shabunin 9 years ago
commit 1307bb1d03
  1. 1
      modules/calib3d/src/stereobm.cpp
  2. 1
      modules/calib3d/src/stereosgbm.cpp
  3. 3
      modules/core/include/opencv2/core.hpp
  4. 6
      modules/core/src/algorithm.cpp
  5. 1
      modules/cudaimgproc/src/canny.cpp
  6. 1
      modules/cudaimgproc/src/hough_circles.cpp
  7. 1
      modules/cudaimgproc/src/hough_lines.cpp
  8. 1
      modules/cudaimgproc/src/hough_segments.cpp
  9. 1
      modules/features2d/src/akaze.cpp
  10. 1
      modules/features2d/src/blobdetector.cpp
  11. 1
      modules/features2d/src/kaze.cpp
  12. 1
      modules/features2d/src/matchers.cpp
  13. 1
      modules/ml/src/ann_mlp.cpp
  14. 1
      modules/ml/src/boost.cpp
  15. 1
      modules/ml/src/em.cpp
  16. 1
      modules/ml/src/knearest.cpp
  17. 1
      modules/ml/src/lr.cpp
  18. 1
      modules/ml/src/nbayes.cpp
  19. 1
      modules/ml/src/rtrees.cpp
  20. 1
      modules/ml/src/svm.cpp
  21. 1
      modules/ml/src/svmsgd.cpp
  22. 1
      modules/ml/src/tree.cpp
  23. 1
      modules/photo/src/align.cpp
  24. 2
      modules/photo/src/calibrate.cpp
  25. 1
      modules/photo/src/merge.cpp
  26. 5
      modules/photo/src/tonemap.cpp
  27. 1
      modules/shape/src/aff_trans.cpp
  28. 1
      modules/shape/src/haus_dis.cpp
  29. 4
      modules/shape/src/hist_cost.cpp
  30. 1
      modules/shape/src/sc_dis.cpp
  31. 1
      modules/shape/src/tps_trans.cpp
  32. 1
      modules/video/src/bgfg_KNN.cpp
  33. 1
      modules/video/src/bgfg_gaussmix2.cpp

@ -1225,6 +1225,7 @@ public:
void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << name_
<< "minDisparity" << params.minDisparity
<< "numDisparities" << params.numDisparities

@ -1512,6 +1512,7 @@ public:
void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << name_
<< "minDisparity" << params.minDisparity
<< "numDisparities" << params.numDisparities

@ -3067,6 +3067,9 @@ public:
/** Returns the algorithm string identifier.
This string is used as top level xml/yml node tag when the object is saved to a file or string. */
CV_WRAP virtual String getDefaultName() const;
protected:
void writeFormat(FileStorage& fs) const;
};
struct Param {

@ -57,7 +57,6 @@ void Algorithm::save(const String& filename) const
{
FileStorage fs(filename, FileStorage::WRITE);
fs << getDefaultName() << "{";
fs << "format" << (int)3;
write(fs);
fs << "}";
}
@ -67,6 +66,11 @@ String Algorithm::getDefaultName() const
return String("my_object");
}
void Algorithm::writeFormat(FileStorage& fs) const
{
fs << "format" << (int)3;
}
}
/* End of file. */

@ -93,6 +93,7 @@ namespace
void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << "Canny_CUDA"
<< "low_thresh" << low_thresh_
<< "high_thresh" << high_thresh_

@ -99,6 +99,7 @@ namespace
void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << "HoughCirclesDetector_CUDA"
<< "dp" << dp_
<< "minDist" << minDist_

@ -95,6 +95,7 @@ namespace
void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << "HoughLinesDetector_CUDA"
<< "rho" << rho_
<< "theta" << theta_

@ -98,6 +98,7 @@ namespace
void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << "PHoughLinesDetector_CUDA"
<< "rho" << rho_
<< "theta" << theta_

@ -217,6 +217,7 @@ namespace cv
void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "descriptor" << descriptor;
fs << "descriptor_channels" << descriptor_channels;
fs << "descriptor_size" << descriptor_size;

@ -184,6 +184,7 @@ void SimpleBlobDetectorImpl::read( const cv::FileNode& fn )
void SimpleBlobDetectorImpl::write( cv::FileStorage& fs ) const
{
writeFormat(fs);
params.write(fs);
}

@ -159,6 +159,7 @@ namespace cv
void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "extended" << (int)extended;
fs << "upright" << (int)upright;
fs << "threshold" << threshold;

@ -1179,6 +1179,7 @@ void FlannBasedMatcher::read( const FileNode& fn)
void FlannBasedMatcher::write( FileStorage& fs) const
{
writeFormat(fs);
fs << "indexParams" << "[";
if (indexParams)

@ -1151,6 +1151,7 @@ public:
return;
int i, l_count = layer_count();
writeFormat(fs);
fs << "layer_sizes" << layer_sizes;
write_params( fs );

@ -387,6 +387,7 @@ public:
if( roots.empty() )
CV_Error( CV_StsBadArg, "RTrees have not been trained" );
writeFormat(fs);
writeParams(fs);
int k, ntrees = (int)roots.size();

@ -770,6 +770,7 @@ public:
void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "training_params" << "{";
write_params(fs);
fs << "}";

@ -466,6 +466,7 @@ public:
void write( FileStorage& fs ) const
{
writeFormat(fs);
impl->write(fs);
}

@ -578,6 +578,7 @@ void LogisticRegressionImpl::write(FileStorage& fs) const
{
CV_Error(CV_StsBadArg,"file can't open. Check file path");
}
writeFormat(fs);
string desc = "Logisitic Regression Classifier";
fs<<"classifier"<<desc.c_str();
fs<<"alpha"<<this->params.alpha;

@ -342,6 +342,7 @@ public:
{
int nclasses = (int)cls_labels.total(), i;
writeFormat(fs);
fs << "var_count" << (var_idx.empty() ? nallvars : (int)var_idx.total());
fs << "var_all" << nallvars;

@ -296,6 +296,7 @@ public:
if( roots.empty() )
CV_Error( CV_StsBadArg, "RTrees have not been trained" );
writeFormat(fs);
writeParams(fs);
fs << "oob_error" << oobError;

@ -2037,6 +2037,7 @@ public:
if( !isTrained() )
CV_Error( CV_StsParseError, "SVM model data is invalid, check sv_count, var_* and class_count tags" );
writeFormat(fs);
write_params( fs );
fs << "var_count" << var_count;

@ -364,6 +364,7 @@ void SVMSGDImpl::write(FileStorage& fs) const
if( !isTrained() )
CV_Error( CV_StsParseError, "SVMSGD model data is invalid, it hasn't been trained" );
writeFormat(fs);
writeParams( fs );
fs << "weights" << weights_;

@ -1681,6 +1681,7 @@ void DTreesImpl::writeTree( FileStorage& fs, int root ) const
void DTreesImpl::write( FileStorage& fs ) const
{
writeFormat(fs);
writeParams(fs);
writeTree(fs, roots[0]);
}

@ -184,6 +184,7 @@ public:
void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << name
<< "max_bits" << max_bits
<< "exclude_range" << exclude_range

@ -141,6 +141,7 @@ public:
void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << name
<< "samples" << samples
<< "lambda" << lambda
@ -250,6 +251,7 @@ public:
void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << name
<< "max_iter" << max_iter
<< "threshold" << threshold;

@ -265,6 +265,7 @@ public:
void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << name
<< "contrast_weight" << wcon
<< "saturation_weight" << wsat

@ -83,6 +83,7 @@ public:
void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << name
<< "gamma" << gamma;
}
@ -161,6 +162,7 @@ public:
void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << name
<< "gamma" << gamma
<< "bias" << bias
@ -242,6 +244,7 @@ public:
void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << name
<< "gamma" << gamma
<< "contrast" << contrast
@ -339,6 +342,7 @@ public:
void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << name
<< "gamma" << gamma
<< "intensity" << intensity
@ -446,6 +450,7 @@ public:
void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << name
<< "gamma" << gamma
<< "scale" << scale

@ -79,6 +79,7 @@ public:
//! write/read
virtual void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << name_
<< "affine_type" << int(fullAffine);
}

@ -77,6 +77,7 @@ public:
//! write/read
virtual void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << name_
<< "distance" << distanceFlag
<< "rank" << rankProportion;

@ -99,6 +99,7 @@ public:
//! write/read
virtual void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << name_
<< "flag" << flag
<< "dummies" << nDummies
@ -224,6 +225,7 @@ public:
//! write/read
virtual void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << name_
<< "flag" << flag
<< "dummies" << nDummies
@ -350,6 +352,7 @@ public:
//! write/read
virtual void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << name_
<< "dummies" << nDummies
<< "default" << defaultCost;
@ -466,6 +469,7 @@ public:
//! write/read
virtual void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << name_
<< "dummies" << nDummies
<< "default" << defaultCost;

@ -137,6 +137,7 @@ public:
//! write/read
virtual void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << name_
<< "nRads" << nRadialBins
<< "nAngs" << nAngularBins

@ -81,6 +81,7 @@ public:
//! write/read
virtual void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << name_
<< "regularization" << regularizationParameter;
}

@ -183,6 +183,7 @@ public:
virtual void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << name_
<< "history" << history
<< "nsamples" << nN

@ -286,6 +286,7 @@ public:
virtual void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "name" << name_
<< "history" << history
<< "nmixtures" << nmixtures

Loading…
Cancel
Save