Libmv: Fix for famous Image(x,y,z) vs. Image(y,x,z) libmv_prediction
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 30 Oct 2014 18:27:59 +0000 (23:27 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 30 Oct 2014 18:29:24 +0000 (23:29 +0500)
extern/libmv/intern/frame_accessor.cc
extern/libmv/libmv/autotrack/autotrack.cc

index a7d969af05b95be1e1c0ddb75db2d08fbf1454e2..8bf2cab914bf5a0caf5f48a946c653ea3f1ae77f 100644 (file)
@@ -147,8 +147,8 @@ void libmv_frameAccessorgetTransformRun(const libmv_FrameTransform *transform,
                                         const libmv_FloatImage *input_image,
                                         libmv_FloatImage *output_image) {
   const FloatImage input(input_image->buffer,
-                         input_image->width,
                          input_image->height,
+                         input_image->width,
                          input_image->channels);
 
   FloatImage output;
index b5d0ad45a8e9d5bc39033c5866f7dbff735ec5a2..96a0ef64a504a37cdfe14ab9a1b7ebd3d1c2f174 100644 (file)
@@ -57,13 +57,13 @@ class DisableChannelsTransform : public FrameAccessor::Transform {
                   (disable_green ? 0.0f : 0.7152f) +
                   (disable_blue  ? 0.0f : 0.0722f);
 
-    output->Resize(input.Width(), input.Height(), 1);
+    output->Resize(input.Height(), input.Width(), 1);
     for (int y = 0; y < input.Height(); y++) {
       for (int x = 0; x < input.Width(); x++) {
-        float r = disable_red   ? 0.0f : input(x, y, 0);
-        float g = disable_green ? 0.0f : input(x, y, 1);
-        float b = disable_blue  ? 0.0f : input(x, y, 2);
-        (*output)(x, y, 0) = (0.2126f * r + 0.7152f * g + 0.0722f * b) / scale;
+        float r = disable_red   ? 0.0f : input(y, x, 0);
+        float g = disable_green ? 0.0f : input(y, x, 1);
+        float b = disable_blue  ? 0.0f : input(y, x, 2);
+        (*output)(y, x, 0) = (0.2126f * r + 0.7152f * g + 0.0722f * b) / scale;
       }
     }
   }