Commit f41f633d authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

fixed various warnings from the “doc” and other builders

parent a1784b73
...@@ -86,12 +86,14 @@ FeatureEvaluator::setImage ...@@ -86,12 +86,14 @@ FeatureEvaluator::setImage
------------------------------ ------------------------------
Assigns an image to feature evaluator. Assigns an image to feature evaluator.
.. ocv:function:: bool FeatureEvaluator::setImage(const Mat& img, Size origWinSize) .. ocv:function:: bool FeatureEvaluator::setImage(InputArray img, Size origWinSize, Size sumSize)
:param img: Matrix of the type ``CV_8UC1`` containing an image where the features are computed. :param img: Matrix of the type ``CV_8UC1`` containing an image where the features are computed.
:param origWinSize: Size of training images. :param origWinSize: Size of training images.
:param sumSize: The requested size of integral images (so if the integral image is smaller, it resides in the top-left corner of the larger image of requested size). Because the features are represented using offsets from the image origin, using the same sumSize for all scales helps to avoid constant readjustments of the features to different scales.
The method assigns an image, where the features will be computed, to the feature evaluator. The method assigns an image, where the features will be computed, to the feature evaluator.
......
...@@ -121,16 +121,15 @@ static bool convert(const String& oldcascade, const String& newcascade) ...@@ -121,16 +121,15 @@ static bool convert(const String& oldcascade, const String& newcascade)
FileNode sznode = oldroot[ICV_HAAR_SIZE_NAME]; FileNode sznode = oldroot[ICV_HAAR_SIZE_NAME];
if( sznode.empty() ) if( sznode.empty() )
return false; return false;
int maxdepth = 0;
Size cascadesize; Size cascadesize;
cascadesize.width = (int)sznode[0]; cascadesize.width = (int)sznode[0];
cascadesize.height = (int)sznode[1]; cascadesize.height = (int)sznode[1];
std::vector<HaarFeature> features; std::vector<HaarFeature> features;
size_t i, j, k, n; int i, j, k, n;
FileNode stages_seq = oldroot[ICV_HAAR_STAGES_NAME]; FileNode stages_seq = oldroot[ICV_HAAR_STAGES_NAME];
size_t nstages = stages_seq.size(); int nstages = (int)stages_seq.size();
std::vector<HaarStageClassifier> stages(nstages); std::vector<HaarStageClassifier> stages(nstages);
for( i = 0; i < nstages; i++ ) for( i = 0; i < nstages; i++ )
...@@ -139,14 +138,14 @@ static bool convert(const String& oldcascade, const String& newcascade) ...@@ -139,14 +138,14 @@ static bool convert(const String& oldcascade, const String& newcascade)
HaarStageClassifier& stage = stages[i]; HaarStageClassifier& stage = stages[i];
stage.threshold = (double)stagenode[ICV_HAAR_STAGE_THRESHOLD_NAME]; stage.threshold = (double)stagenode[ICV_HAAR_STAGE_THRESHOLD_NAME];
FileNode weaks_seq = stagenode[ICV_HAAR_TREES_NAME]; FileNode weaks_seq = stagenode[ICV_HAAR_TREES_NAME];
size_t nweaks = weaks_seq.size(); int nweaks = (int)weaks_seq.size();
stage.weaks.resize(nweaks); stage.weaks.resize(nweaks);
for( j = 0; j < nweaks; j++ ) for( j = 0; j < nweaks; j++ )
{ {
HaarClassifier& weak = stage.weaks[j]; HaarClassifier& weak = stage.weaks[j];
FileNode weaknode = weaks_seq[j]; FileNode weaknode = weaks_seq[j];
size_t nnodes = weaknode.size(); int nnodes = (int)weaknode.size();
for( n = 0; n < nnodes; n++ ) for( n = 0; n < nnodes; n++ )
{ {
...@@ -157,7 +156,7 @@ static bool convert(const String& oldcascade, const String& newcascade) ...@@ -157,7 +156,7 @@ static bool convert(const String& oldcascade, const String& newcascade)
node.f = (int)features.size(); node.f = (int)features.size();
f.tilted = (int)fnode[ICV_HAAR_TILTED_NAME] != 0; f.tilted = (int)fnode[ICV_HAAR_TILTED_NAME] != 0;
FileNode rects_seq = fnode[ICV_HAAR_RECTS_NAME]; FileNode rects_seq = fnode[ICV_HAAR_RECTS_NAME];
size_t nrects = rects_seq.size(); int nrects = (int)rects_seq.size();
for( k = 0; k < nrects; k++ ) for( k = 0; k < nrects; k++ )
{ {
...@@ -199,9 +198,9 @@ static bool convert(const String& oldcascade, const String& newcascade) ...@@ -199,9 +198,9 @@ static bool convert(const String& oldcascade, const String& newcascade)
if( !newfs.isOpened() ) if( !newfs.isOpened() )
return false; return false;
size_t maxWeakCount = 0, nfeatures = features.size(); int maxWeakCount = 0, nfeatures = (int)features.size();
for( i = 0; i < nstages; i++ ) for( i = 0; i < nstages; i++ )
maxWeakCount = std::max(maxWeakCount, stages[i].weaks.size()); maxWeakCount = std::max(maxWeakCount, (int)stages[i].weaks.size());
newfs << "cascade" << "{:opencv-cascade-classifier" newfs << "cascade" << "{:opencv-cascade-classifier"
<< "stageType" << "BOOST" << "stageType" << "BOOST"
...@@ -219,7 +218,7 @@ static bool convert(const String& oldcascade, const String& newcascade) ...@@ -219,7 +218,7 @@ static bool convert(const String& oldcascade, const String& newcascade)
for( i = 0; i < nstages; i++ ) for( i = 0; i < nstages; i++ )
{ {
size_t nweaks = stages[i].weaks.size(); int nweaks = (int)stages[i].weaks.size();
newfs << "{" << "maxWeakCount" << (int)nweaks newfs << "{" << "maxWeakCount" << (int)nweaks
<< "stageThreshold" << stages[i].threshold << "stageThreshold" << stages[i].threshold
<< "weakClassifiers" << "["; << "weakClassifiers" << "[";
...@@ -227,7 +226,7 @@ static bool convert(const String& oldcascade, const String& newcascade) ...@@ -227,7 +226,7 @@ static bool convert(const String& oldcascade, const String& newcascade)
{ {
const HaarClassifier& c = stages[i].weaks[j]; const HaarClassifier& c = stages[i].weaks[j];
newfs << "{" << "internalNodes" << "["; newfs << "{" << "internalNodes" << "[";
size_t nnodes = c.nodes.size(), nleaves = c.leaves.size(); int nnodes = (int)c.nodes.size(), nleaves = (int)c.leaves.size();
for( k = 0; k < nnodes; k++ ) for( k = 0; k < nnodes; k++ )
newfs << c.nodes[k].left << c.nodes[k].right newfs << c.nodes[k].left << c.nodes[k].right
<< c.nodes[k].f << c.nodes[k].threshold; << c.nodes[k].f << c.nodes[k].threshold;
...@@ -246,7 +245,7 @@ static bool convert(const String& oldcascade, const String& newcascade) ...@@ -246,7 +245,7 @@ static bool convert(const String& oldcascade, const String& newcascade)
{ {
const HaarFeature& f = features[i]; const HaarFeature& f = features[i];
newfs << "{" << "rects" << "["; newfs << "{" << "rects" << "[";
for( j = 0; j < (size_t)HaarFeature::RECT_NUM; j++ ) for( j = 0; j < HaarFeature::RECT_NUM; j++ )
{ {
if( j >= 2 && fabs(f.rect[j].weight) < FLT_EPSILON ) if( j >= 2 && fabs(f.rect[j].weight) < FLT_EPSILON )
break; break;
......
...@@ -183,4 +183,3 @@ __kernel void runLBPClassifierStump( ...@@ -183,4 +183,3 @@ __kernel void runLBPClassifierStump(
} }
} }
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment