diff --git a/src/algorithms/LBAdaptiveSOM.cpp b/src/algorithms/LBAdaptiveSOM.cpp
index afc0292a8ad0c5c6907657a9e9558d37445d8be1..342d3804775cc7eccb63f1957c02331c21ab7f0d 100644
--- a/src/algorithms/LBAdaptiveSOM.cpp
+++ b/src/algorithms/LBAdaptiveSOM.cpp
@@ -54,6 +54,7 @@ void LBAdaptiveSOM::process(const cv::Mat &img_input, cv::Mat &img_output, cv::M
 
   img_foreground.copyTo(img_output);
   img_background.copyTo(img_bgmodel);
+  cvReleaseImage(&frame);
 
   firstTime = false;
 }
diff --git a/src/algorithms/LBFuzzyAdaptiveSOM.cpp b/src/algorithms/LBFuzzyAdaptiveSOM.cpp
index 00047af7484ad2605c8c25a63293f04c1a202a2f..78d7121bef56cea2ea04859e77adbd7ea941f54c 100644
--- a/src/algorithms/LBFuzzyAdaptiveSOM.cpp
+++ b/src/algorithms/LBFuzzyAdaptiveSOM.cpp
@@ -53,6 +53,7 @@ void LBFuzzyAdaptiveSOM::process(const cv::Mat &img_input, cv::Mat &img_output,
 
   img_foreground.copyTo(img_output);
   img_background.copyTo(img_bgmodel);
+  cvReleaseImage(&frame);
 
   firstTime = false;
 }
diff --git a/src/algorithms/LBFuzzyGaussian.cpp b/src/algorithms/LBFuzzyGaussian.cpp
index 00f3fef527185cb58a15d6ff9c7a656e13e88d89..2dd081d392027bd1e657ad9c8e3d3ed7fd0e717c 100644
--- a/src/algorithms/LBFuzzyGaussian.cpp
+++ b/src/algorithms/LBFuzzyGaussian.cpp
@@ -52,6 +52,7 @@ void LBFuzzyGaussian::process(const cv::Mat &img_input, cv::Mat &img_output, cv:
 
   img_foreground.copyTo(img_output);
   img_background.copyTo(img_bgmodel);
+  cvReleaseImage(&frame);
 
   firstTime = false;
 }
diff --git a/src/algorithms/LBMixtureOfGaussians.cpp b/src/algorithms/LBMixtureOfGaussians.cpp
index 82d9f1ebfa645a7233997f32d7f0888d263cc540..eaa270979d8459562ce8982491de493036fd7f8c 100644
--- a/src/algorithms/LBMixtureOfGaussians.cpp
+++ b/src/algorithms/LBMixtureOfGaussians.cpp
@@ -52,6 +52,7 @@ void LBMixtureOfGaussians::process(const cv::Mat &img_input, cv::Mat &img_output
 
   img_foreground.copyTo(img_output);
   img_background.copyTo(img_bgmodel);
+  cvReleaseImage(&frame);
 
   firstTime = false;
 }
diff --git a/src/algorithms/LBSimpleGaussian.cpp b/src/algorithms/LBSimpleGaussian.cpp
index 5df2c8127ebe10d9fabaf45f3f84b60a47399222..c9271bf7a4123bc479614619eb7434c13cb91e70 100644
--- a/src/algorithms/LBSimpleGaussian.cpp
+++ b/src/algorithms/LBSimpleGaussian.cpp
@@ -50,6 +50,7 @@ void LBSimpleGaussian::process(const cv::Mat &img_input, cv::Mat &img_output, cv
 
   img_foreground.copyTo(img_output);
   img_background.copyTo(img_bgmodel);
+  cvReleaseImage(&frame);
 
   firstTime = false;
 }