From f07b0cecf92a85d1e93ba446ea93c2fd62273c9a Mon Sep 17 00:00:00 2001
From: Andrews Sobral <andrewssobral@gmail.com>
Date: Sun, 8 Nov 2015 22:36:37 +0100
Subject: [PATCH] Update TextureBGS.cpp

the operator () is invoked with arguments (x, y) but in
https://github.com/andrewssobral/bgslibrary/blob/master/package_bgs/dp/Image.h#L322
the operator () assumens (row, colum):
// pixel-level access using image(row, col)
inline unsigned char& operator()(const int r, const int c)
so the correct invocation should have been with (y, x)
---
 package_bgs/dp/TextureBGS.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package_bgs/dp/TextureBGS.cpp b/package_bgs/dp/TextureBGS.cpp
index 7ccac37..62684f8 100644
--- a/package_bgs/dp/TextureBGS.cpp
+++ b/package_bgs/dp/TextureBGS.cpp
@@ -139,7 +139,7 @@ void TextureBGS::UpdateModel(BwImage& fgMask, TextureArray* bgModel,
     {		
       int index = x+y*(fgMask.Ptr()->width);
 
-      if(fgMask(x,y) == 0)
+      if(fgMask(y,x) == 0)
       {
         for(int i = 0; i < NUM_BINS; ++i)
         {
-- 
GitLab