1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

several fixes in gpu module

fixed iterations>1 case in morphological operations
fixed possible access violation in HSV2RGB
fixed the case learningRate==0 in BackgroundSubtractorMOG2
This commit is contained in:
Vladislav Vinogradov
2012-09-11 14:59:52 +04:00
parent 9956c42804
commit e975259c06
4 changed files with 11 additions and 8 deletions
+1 -2
View File
@@ -251,8 +251,7 @@ void cv::gpu::MOG2_GPU::operator()(const GpuMat& frame, GpuMat& fgmask, float le
learningRate = learningRate >= 0.0f && nframes_ > 1 ? learningRate : 1.0f / std::min(2 * nframes_, history);
CV_Assert(learningRate >= 0.0f);
if (learningRate > 0.0f)
mog2_gpu(frame, frame.channels(), fgmask, bgmodelUsedModes_, weight_, variance_, mean_, learningRate, -learningRate * fCT, bShadowDetection, StreamAccessor::getStream(stream));
mog2_gpu(frame, frame.channels(), fgmask, bgmodelUsedModes_, weight_, variance_, mean_, learningRate, -learningRate * fCT, bShadowDetection, StreamAccessor::getStream(stream));
}
void cv::gpu::MOG2_GPU::getBackgroundImage(GpuMat& backgroundImage, Stream& stream) const