Skip to content

fix legacy contants #3123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions modules/cudaarithm/include/opencv2/cudaarithm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) .
Expand All @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions modules/xobjdetect/src/lbpfeatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand All @@ -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 )
Expand Down
5 changes: 0 additions & 5 deletions modules/xobjdetect/src/precomp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
8 changes: 4 additions & 4 deletions modules/xobjdetect/src/waldboost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions modules/xobjdetect/src/wbdetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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>
Expand Down