Skip to content

Commit

Permalink
fix: fix opencv_contrib issue opencv#2941
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuxc committed Dec 11, 2023
1 parent 0bcbc73 commit 5d36dfd
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions modules/cudabgsegm/src/mog2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,21 @@ class MOG2Impl CV_FINAL : public cuda::BackgroundSubtractorMOG2
void setVarInit(double varInit) CV_OVERRIDE { constantsHost_.varInit_ = (float)varInit; }

double getVarMin() const CV_OVERRIDE { return constantsHost_.varMin_; }
void setVarMin(double varMin) CV_OVERRIDE { constantsHost_.varMin_ = ::fminf((float)varMin, constantsHost_.varMax_); }

void setVarMin(double varMin) CV_OVERRIDE {
if (nframes_ == 0) {
constantsHost_.varMin_ = (float)varMin;
} else {
constantsHost_.varMin_ = ::fminf((float)varMin, constantsHost_.varMax_);
}
}
double getVarMax() const CV_OVERRIDE { return constantsHost_.varMax_; }
void setVarMax(double varMax) CV_OVERRIDE { constantsHost_.varMax_ = ::fmaxf(constantsHost_.varMin_, (float)varMax); }
void setVarMax(double varMax) CV_OVERRIDE {
if (nframes_ == 0) {
constantsHost_.varMax_ = (float)varMax;
} else {
constantsHost_.varMax_ = ::fmaxf(constantsHost_.varMin_, (float)varMax);
}
}

double getComplexityReductionThreshold() const CV_OVERRIDE { return ct_; }
void setComplexityReductionThreshold(double ct) CV_OVERRIDE { ct_ = (float)ct; }
Expand Down

0 comments on commit 5d36dfd

Please sign in to comment.