From e0d28aa893639c3cf0a5a01e475050a7f68c038e Mon Sep 17 00:00:00 2001 From: Sayed Adel Date: Thu, 7 Jun 2018 14:16:48 +0300 Subject: [PATCH] core:ppc Fix java CoreTest/testMahalanobis (#11677) * core:ppc Fix java CoreTest/testMahalanobis * core:ppc Fix warning unused variable on clang --- modules/core/misc/java/test/CoreTest.java | 10 +++++++--- modules/core/src/system.cpp | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/core/misc/java/test/CoreTest.java b/modules/core/misc/java/test/CoreTest.java index c608fb2..42c343b 100644 --- a/modules/core/misc/java/test/CoreTest.java +++ b/modules/core/misc/java/test/CoreTest.java @@ -947,12 +947,16 @@ public class CoreTest extends OpenCVTestCase { } public void testMahalanobis() { + Mat src = new Mat(matSize, matSize, CvType.CV_32F); + Core.randu(src, -128, 128); + Mat covar = new Mat(matSize, matSize, CvType.CV_32F); Mat mean = new Mat(1, matSize, CvType.CV_32F); - Core.calcCovarMatrix(grayRnd_32f, covar, mean, Core.COVAR_ROWS | Core.COVAR_NORMAL, CvType.CV_32F); + Core.calcCovarMatrix(src, covar, mean, Core.COVAR_ROWS | Core.COVAR_NORMAL, CvType.CV_32F); covar = covar.inv(); - Mat line1 = grayRnd_32f.row(0); - Mat line2 = grayRnd_32f.row(1); + + Mat line1 = src.row(0); + Mat line2 = src.row(1); double d = Core.Mahalanobis(line1, line1, covar); diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp index e3ee27c..49f9cc0 100644 --- a/modules/core/src/system.cpp +++ b/modules/core/src/system.cpp @@ -739,7 +739,6 @@ int64 getCPUTickCount(void) int64 getCPUTickCount(void) { - int64 result = 0; unsigned upper, lower, tmp; __asm__ volatile( "0: \n" -- 2.7.4