From 103687871dfed049427e7a4ff4f19b761ddf630b Mon Sep 17 00:00:00 2001
From: Dmitry-Me <wipedout@yandex.ru>
Date: Mon, 16 Feb 2015 15:39:52 +0300
Subject: [PATCH 1/2] Reduce variable scope

---
 modules/core/src/conjugate_gradient.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/modules/core/src/conjugate_gradient.cpp b/modules/core/src/conjugate_gradient.cpp
index caf41fc95..90353cc7f 100644
--- a/modules/core/src/conjugate_gradient.cpp
+++ b/modules/core/src/conjugate_gradient.cpp
@@ -136,7 +136,6 @@ namespace cv
         dprintf(("d first time\n"));print_matrix(d);
         dprintf(("r\n"));print_matrix(r);
 
-        double beta=0;
         for(int count=0;count<_termcrit.maxCount;count++){
             minimizeOnTheLine(_Function,proxy_x,d,minimizeOnTheLine_buf1,minimizeOnTheLine_buf2);
             r.copyTo(r_old);
@@ -147,7 +146,7 @@ namespace cv
                 break;
             }
             r_norm_sq=r_norm_sq*r_norm_sq;
-            beta=MAX(0.0,(r_norm_sq-r.dot(r_old))/r_norm_sq);
+            double beta=MAX(0.0,(r_norm_sq-r.dot(r_old))/r_norm_sq);
             d=r+beta*d;
         }
 

From 437ef99ba5756a18852ef2aef8a132590a2453f0 Mon Sep 17 00:00:00 2001
From: Nisarg Thakkar <nisargtha@gmail.com>
Date: Tue, 17 Feb 2015 22:14:57 +0530
Subject: [PATCH 2/2] Fixed doc error in optical flow

---
 .../py_video/py_lucas_kanade/py_lucas_kanade.markdown           | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/py_tutorials/py_video/py_lucas_kanade/py_lucas_kanade.markdown b/doc/py_tutorials/py_video/py_lucas_kanade/py_lucas_kanade.markdown
index 1ea6cd69d..48c8761c7 100644
--- a/doc/py_tutorials/py_video/py_lucas_kanade/py_lucas_kanade.markdown
+++ b/doc/py_tutorials/py_video/py_lucas_kanade/py_lucas_kanade.markdown
@@ -46,7 +46,7 @@ get the following equation:
 
 where:
 
-\f[f_x = \frac{\partial f}{\partial x} \; ; \; f_y = \frac{\partial f}{\partial x}\f]\f[u = \frac{dx}{dt} \; ; \; v = \frac{dy}{dt}\f]
+\f[f_x = \frac{\partial f}{\partial x} \; ; \; f_y = \frac{\partial f}{\partial y}\f]\f[u = \frac{dx}{dt} \; ; \; v = \frac{dy}{dt}\f]
 
 Above equation is called Optical Flow equation. In it, we can find \f$f_x\f$ and \f$f_y\f$, they are image
 gradients. Similarly \f$f_t\f$ is the gradient along time. But \f$(u,v)\f$ is unknown. We cannot solve this