fix legacy contants

pull/3123/head
Suleyman TURKMEN 3 years ago
parent a5cc475583
commit 180775f5bb
  1. 10
      modules/cudaarithm/include/opencv2/cudaarithm.hpp
  2. 4
      modules/xobjdetect/src/lbpfeatures.cpp
  3. 5
      modules/xobjdetect/src/precomp.hpp
  4. 8
      modules/xobjdetect/src/waldboost.cpp
  5. 8
      modules/xobjdetect/src/wbdetector.cpp

@ -662,11 +662,11 @@ CV_EXPORTS_W void countNonZero(InputArray src, OutputArray dst, Stream& stream =
@param dim Dimension index along which the matrix is reduced. 0 means that the matrix is reduced
to a single row. 1 means that the matrix is reduced to a single column.
@param reduceOp Reduction operation that could be one of the following:
- **CV_REDUCE_SUM** The output is the sum of all rows/columns of the matrix.
- **CV_REDUCE_AVG** The output is the mean vector of all rows/columns of the matrix.
- **CV_REDUCE_MAX** The output is the maximum (column/row-wise) of all rows/columns of the
- **REDUCE_SUM** The output is the sum of all rows/columns of the matrix.
- **REDUCE_AVG** The output is the mean vector of all rows/columns of the matrix.
- **REDUCE_MAX** The output is the maximum (column/row-wise) of all rows/columns of the
matrix.
- **CV_REDUCE_MIN** The output is the minimum (column/row-wise) of all rows/columns of the
- **REDUCE_MIN** The output is the minimum (column/row-wise) of all rows/columns of the
matrix.
@param dtype When it is negative, the destination vector will have the same type as the source
matrix. Otherwise, its type will be CV_MAKE_TYPE(CV_MAT_DEPTH(dtype), mtx.channels()) .
@ -675,7 +675,7 @@ matrix. Otherwise, its type will be CV_MAKE_TYPE(CV_MAT_DEPTH(dtype), mtx.channe
The function reduce reduces the matrix to a vector by treating the matrix rows/columns as a set of
1D vectors and performing the specified operation on the vectors until a single row/column is
obtained. For example, the function can be used to compute horizontal and vertical projections of a
raster image. In case of CV_REDUCE_SUM and CV_REDUCE_AVG , the output may have a larger element
raster image. In case of REDUCE_SUM and REDUCE_AVG , the output may have a larger element
bit-depth to preserve accuracy. And multi-channel arrays are also supported in these two reduction
modes.

@ -93,7 +93,7 @@ void CvLBPEvaluator::generateFeatures()
CvLBPEvaluator::Feature::Feature()
{
rect = cvRect(0, 0, 0, 0);
rect = Rect(0, 0, 0, 0);
}
CvLBPEvaluator::Feature::Feature( int offset, int x, int y, int _blockWidth, int _blockHeight )
@ -108,7 +108,7 @@ CvLBPEvaluator::Feature::Feature( int offset, int x, int y, int _blockWidth, int
void CvLBPEvaluator::Feature::calcPoints(int offset)
{
Rect tr = rect = cvRect(x_, y_, block_w_, block_h_);
Rect tr = rect = Rect(x_, y_, block_w_, block_h_);
CV_SUM_OFFSETS( p[0], p[1], p[4], p[5], tr, offset )
tr.x += 2*rect.width;
CV_SUM_OFFSETS( p[2], p[3], p[6], p[7], tr, offset )

@ -46,14 +46,9 @@ the use of this software, even if advised of the possibility of such damage.
#define __OPENCV_XOBJDETECT_PRECOMP_HPP__
#include <opencv2/xobjdetect.hpp>
#include <opencv2/core/utility.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/imgproc/types_c.h>
#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/objdetect.hpp>

@ -73,14 +73,14 @@ static void compute_min_step(const Mat &data_pos, const Mat &data_neg, size_t n_
Mat reduced_pos, reduced_neg;
reduce(data_pos, reduced_pos, 1, CV_REDUCE_MIN);
reduce(data_neg, reduced_neg, 1, CV_REDUCE_MIN);
reduce(data_pos, reduced_pos, 1, REDUCE_MIN);
reduce(data_neg, reduced_neg, 1, REDUCE_MIN);
min(reduced_pos, reduced_neg, data_min);
data_min -= 0.01;
Mat data_max;
reduce(data_pos, reduced_pos, 1, CV_REDUCE_MAX);
reduce(data_neg, reduced_neg, 1, CV_REDUCE_MAX);
reduce(data_pos, reduced_pos, 1, REDUCE_MAX);
reduce(data_neg, reduced_neg, 1, REDUCE_MAX);
max(reduced_pos, reduced_neg, data_max);
data_max += 0.01;

@ -108,8 +108,8 @@ void WBDetectorImpl::train(
vector<Mat> pos_imgs = read_imgs(pos_samples_path);
vector<Mat> neg_imgs = sample_patches(neg_imgs_path, 24, 24, pos_imgs.size() * 10);
assert(pos_imgs.size());
assert(neg_imgs.size());
CV_Assert(pos_imgs.size());
CV_Assert(neg_imgs.size());
int n_features;
Mat pos_data, neg_data;
@ -173,7 +173,7 @@ void WBDetectorImpl::train(
if (confidences.rows > 0) {
Mat1i indices;
sortIdx(confidences, indices,
CV_SORT_EVERY_COLUMN + CV_SORT_DESCENDING);
SORT_EVERY_COLUMN + SORT_DESCENDING);
int win_count = min(max_per_image, confidences.rows);
win_count = min(win_count, stage_neg - bootstrap_count);
@ -209,7 +209,7 @@ void WBDetectorImpl::detect(
Ptr<CvFeatureEvaluator> eval = CvFeatureEvaluator::create();
eval->init(params, 1, Size(24, 24));
boost_.detect(eval, img, scales, bboxes, confidences);
assert(confidences.size() == bboxes.size());
CV_Assert(confidences.size() == bboxes.size());
}
Ptr<WBDetector>

Loading…
Cancel
Save