From 6c2b57a0241be8455961b442046c61936be0af4e Mon Sep 17 00:00:00 2001 From: Holger Friedrich <friedrich@fias.uni-frankfurt.de> Date: Tue, 29 Jul 2014 12:14:31 +0200 Subject: [PATCH] rollback accidental changes --- package_bgs/ck/MotionDetection.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/package_bgs/ck/MotionDetection.cpp b/package_bgs/ck/MotionDetection.cpp index 5169538..e22648a 100644 --- a/package_bgs/ck/MotionDetection.cpp +++ b/package_bgs/ck/MotionDetection.cpp @@ -597,9 +597,7 @@ void MotionDetection::DetectMotionsHU(MEImage& image) void MotionDetection::UpdateModelHU(MEImage& image, MEPixelDataType*** model) { - float *CurrentHistogram, *CurrentHistogram2; - CurrentHistogram = new float[HUHistogramBins]; - CurrentHistogram2 = new float[HUHistogramBins]; + float CurrentHistogram[HUHistogramBins], CurrentHistogram2[HUHistogramBins]; unsigned char *ImgData = image.GetImageData(); int RowWidth = image.GetRowWidth(); int RowStart = (HUImageHeight-1)*RowWidth; @@ -789,8 +787,6 @@ void MotionDetection::UpdateModelHU(MEImage& image, MEPixelDataType*** model) } } - delete[] CurrentHistogram; - delete[] CurrentHistogram2; } @@ -799,7 +795,7 @@ void MotionDetection::UpdateHUPixelData(MEPixelDataType* PixelData, const float int MaxIndex = 0; float MaxValue = -1; bool Replace = true; - float *IntersectionResults = new float[HUHistogramsPerPixel]; + float IntersectionResults[HUHistogramsPerPixel]; PixelData->LifeCycle++; PixelData->BackgroundRate = 0.0; @@ -860,7 +856,6 @@ void MotionDetection::UpdateHUPixelData(MEPixelDataType* PixelData, const float for (int i1 = HUHistogramsPerPixel-1; i1 >= 0; --i1) PixelData->Weights[i1] = PixelData->Weights[i1] / sum; - delete[] IntersectionResults; return; } @@ -933,7 +928,6 @@ void MotionDetection::UpdateHUPixelData(MEPixelDataType* PixelData, const float { PixelData->BackgroundHistogram[(int)Weights[i1][0]] = false; } - delete[] IntersectionResults; } -- GitLab