Camera tracking integration
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 27 Oct 2011 13:41:28 +0000 (13:41 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 27 Oct 2011 13:41:28 +0000 (13:41 +0000)
===========================

Fix for totally unworkable KLT tracker caused by recent codereview commit.
Float buffer for libmv should be calculated in exactly such way.

source/blender/blenkernel/intern/tracking.c

index f30718ad7c41dfa43d4051e21badf79a6ad1249e..fce54f97481394cd465925640539cb0181dac6e4 100644 (file)
@@ -733,7 +733,7 @@ static float *get_search_floatbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieT
                        } else {
                                char *rrgb= (char*)tmpibuf->rect + pixel*4;
 
-                               *fp= FTOCHAR(0.2126*rrgb[0] + 0.7152*rrgb[1] + 0.0722*rrgb[2]);
+                               *fp= (0.2126*rrgb[0] + 0.7152*rrgb[1] + 0.0722*rrgb[2])/255.0f;
                        }
 
                        fp++;