mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 13:47:32 +08:00
java tests: addede tests for Converter and core classes by Hussein Abdinoor
This commit is contained in:
parent
f4e28f87d8
commit
d87f513b4f
@ -3,63 +3,187 @@ package org.opencv.test;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.opencv.Converters;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Rect;
|
||||
import org.opencv.features2d.KeyPoint;
|
||||
|
||||
public class ConvertersTest extends OpenCVTestCase {
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
}
|
||||
|
||||
public void testMat_to_vector_float() {
|
||||
fail("Not yet implemented");
|
||||
Mat src = new Mat(4, 1, CvType.CV_32FC1);
|
||||
src.put(0, 0, 2, 4, 3, 9);
|
||||
List<Float> fs = new ArrayList<Float>();
|
||||
|
||||
Converters.Mat_to_vector_float(src, fs);
|
||||
List<Float> truth = new ArrayList<Float>();
|
||||
truth.add(2.0f);
|
||||
truth.add(4.0f);
|
||||
truth.add(3.0f);
|
||||
truth.add(9.0f);
|
||||
assertListFloatEquals(truth, fs, EPS);
|
||||
}
|
||||
|
||||
public void testMat_to_vector_int() {
|
||||
fail("Not yet implemented");
|
||||
Mat src = new Mat(4, 1, CvType.CV_32SC1);
|
||||
src.put(0, 0, 2, 4, 3, 9);
|
||||
List<Integer> fs = new ArrayList<Integer>();
|
||||
|
||||
Converters.Mat_to_vector_int(src, fs);
|
||||
List<Integer> truth = new ArrayList<Integer>();
|
||||
truth.add(2);
|
||||
truth.add(4);
|
||||
truth.add(3);
|
||||
truth.add(9);
|
||||
assertListIntegerEquals(truth, fs);
|
||||
}
|
||||
|
||||
public void testMat_to_vector_KeyPoint() {
|
||||
fail("Not yet implemented");
|
||||
Mat src = new Mat(1, 1, CvType.CV_64FC(7));
|
||||
src.put(0, 0, 2, 4, 3, 9, 10, 12, 7);
|
||||
List<KeyPoint> kps = new ArrayList<KeyPoint>();
|
||||
|
||||
Converters.Mat_to_vector_KeyPoint(src, kps);
|
||||
List<KeyPoint> truth = new ArrayList<KeyPoint>();
|
||||
truth.add(new KeyPoint(2, 4, 3, 9, 10, 12, 7));
|
||||
assertListKeyPointEquals(truth, kps, EPS);
|
||||
}
|
||||
|
||||
public void testMat_to_vector_Mat() {
|
||||
//Mat src = new Mat(4, 1, CvType.CV_32SC2);
|
||||
//src.put(0, 0, 2, 2, 3, 3, 4, 4, 5, 5);
|
||||
//
|
||||
//List<Mat> mats = new ArrayList<Mat>();
|
||||
//Converters.Mat_to_vector_Mat(src, mats);
|
||||
//
|
||||
//List<Mat> truth = new ArrayList<Mat>();
|
||||
//truth.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(2.0)));
|
||||
//truth.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(3.0)));
|
||||
//truth.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(4.0)));
|
||||
//truth.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(5.0)));
|
||||
//assertListEqualMat(truth, mats, EPS);
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testMat_to_vector_Point() {
|
||||
fail("Not yet implemented");
|
||||
Mat src = new Mat(4, 1, CvType.CV_32SC2);
|
||||
src.put(0, 0, 2, 4, 3, 9, 10, 4, 35, 54);
|
||||
List<Point> points = new ArrayList<Point>();
|
||||
|
||||
Converters.Mat_to_vector_Point(src, points);
|
||||
List<Point> truth = new ArrayList<Point>();
|
||||
truth.add(new Point(2, 4));
|
||||
truth.add(new Point(3, 9));
|
||||
truth.add(new Point(10, 4));
|
||||
truth.add(new Point(35, 54));
|
||||
assertListPointEquals(truth, points, EPS);
|
||||
}
|
||||
|
||||
public void testMat_to_vector_Rect() {
|
||||
fail("Not yet implemented");
|
||||
Mat src = new Mat(2, 1, CvType.CV_32SC4);
|
||||
src.put(0, 0, 2, 2, 5, 2, 0, 0, 6, 4);
|
||||
List<Rect> rectangles = new ArrayList<Rect>();
|
||||
|
||||
Converters.Mat_to_vector_Rect(src, rectangles);
|
||||
List<Rect> truth = new ArrayList<Rect>();
|
||||
truth.add(new Rect(2, 2, 5, 2));
|
||||
truth.add(new Rect(0, 0, 6, 4));
|
||||
assertListRectEquals(truth, rectangles);
|
||||
}
|
||||
|
||||
public void testVector_double_to_Mat() {
|
||||
fail("Not yet implemented");
|
||||
List<Double> inputVector = new ArrayList<Double>();
|
||||
inputVector.add(2.0);
|
||||
inputVector.add(4.0);
|
||||
inputVector.add(3.0);
|
||||
inputVector.add(9.0);
|
||||
|
||||
dst = Converters.vector_double_to_Mat(inputVector);
|
||||
truth = new Mat(4, 1, CvType.CV_64FC1);
|
||||
truth.put(0, 0, 2, 4, 3, 9);
|
||||
assertMatEqual(truth, dst, EPS);
|
||||
}
|
||||
|
||||
public void testVector_float_to_Mat() {
|
||||
fail("Not yet implemented");
|
||||
List<Float> inputVector = new ArrayList<Float>();
|
||||
inputVector.add(2.0f);
|
||||
inputVector.add(4.0f);
|
||||
inputVector.add(3.0f);
|
||||
inputVector.add(9.0f);
|
||||
|
||||
dst = Converters.vector_float_to_Mat(inputVector);
|
||||
truth = new Mat(4, 1, CvType.CV_32FC1);
|
||||
truth.put(0, 0, 2, 4, 3, 9);
|
||||
assertMatEqual(truth, dst, EPS);
|
||||
}
|
||||
|
||||
public void testVector_int_to_Mat() {
|
||||
fail("Not yet implemented");
|
||||
List<Integer> inputVector = new ArrayList<Integer>();
|
||||
inputVector.add(2);
|
||||
inputVector.add(4);
|
||||
inputVector.add(3);
|
||||
inputVector.add(9);
|
||||
|
||||
dst = Converters.vector_int_to_Mat(inputVector);
|
||||
truth = new Mat(4, 1, CvType.CV_32SC1);
|
||||
truth.put(0, 0, 2, 4, 3, 9);
|
||||
assertMatEqual(truth, dst);
|
||||
}
|
||||
|
||||
public void testVector_Mat_to_Mat() {
|
||||
//List<Mat> mats = new ArrayList<Mat>();
|
||||
//mats.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(2.0)));
|
||||
//mats.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(2.0)));
|
||||
//mats.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(2.0)));
|
||||
//mats.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(2.0)));
|
||||
//mats.add(gray0);
|
||||
//mats.add(gray255);
|
||||
//
|
||||
//dst = Converters.vector_Mat_to_Mat(mats);
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testVector_Point_to_Mat() {
|
||||
fail("Not yet implemented");
|
||||
List<Point> points = new ArrayList<Point>();
|
||||
points.add(new Point(2, 4));
|
||||
points.add(new Point(3, 9));
|
||||
points.add(new Point(10, 4));
|
||||
points.add(new Point(35, 54));
|
||||
|
||||
dst = Converters.vector_Point_to_Mat(points);
|
||||
truth = new Mat(4, 1, CvType.CV_32SC2);
|
||||
truth.put(0, 0, 2, 4, 3, 9, 10, 4, 35, 54);
|
||||
assertMatEqual(truth, dst);
|
||||
}
|
||||
|
||||
public void testVector_Rect_to_Mat() {
|
||||
fail("Not yet implemented");
|
||||
List<Rect> rectangles = new ArrayList<Rect>();
|
||||
rectangles.add(new Rect(2, 2, 5, 2));
|
||||
rectangles.add(new Rect(0, 0, 6, 4));
|
||||
|
||||
dst = Converters.vector_Rect_to_Mat(rectangles);
|
||||
truth = new Mat(2, 1, CvType.CV_32SC4);
|
||||
truth.put(0, 0, 2, 2, 5, 2, 0, 0, 6, 4);
|
||||
assertMatEqual(truth, dst);
|
||||
}
|
||||
|
||||
public void testVector_uchar_to_Mat() {
|
||||
fail("Not yet implemented");
|
||||
List<Byte> bytes = new ArrayList<Byte>();
|
||||
byte value1 = 1;
|
||||
byte value2 = 2;
|
||||
byte value3 = 3;
|
||||
byte value4 = 4;
|
||||
bytes.add(new Byte(value1));
|
||||
bytes.add(new Byte(value2));
|
||||
bytes.add(new Byte(value3));
|
||||
bytes.add(new Byte(value4));
|
||||
|
||||
dst = Converters.vector_uchar_to_Mat(bytes);
|
||||
truth = new Mat(4, 1, CvType.CV_8UC1);
|
||||
truth.put(0, 0, 1, 2, 3, 4);
|
||||
assertMatEqual(truth, dst);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import junit.framework.TestCase;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Rect;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.features2d.KeyPoint;
|
||||
@ -98,8 +99,7 @@ public class OpenCVTestCase extends TestCase {
|
||||
gray1_32f = new Mat(matSize, matSize, CvType.CV_32F, new Scalar(1.0));
|
||||
gray3_32f = new Mat(matSize, matSize, CvType.CV_32F, new Scalar(3.0));
|
||||
gray9_32f = new Mat(matSize, matSize, CvType.CV_32F, new Scalar(9.0));
|
||||
gray255_32f = new Mat(matSize, matSize, CvType.CV_32F,
|
||||
new Scalar(255.0));
|
||||
gray255_32f = new Mat(matSize, matSize, CvType.CV_32F, new Scalar(255.0));
|
||||
grayE_32f = new Mat(matSize, matSize, CvType.CV_32F);
|
||||
grayE_32f = Mat.eye(matSize, matSize, CvType.CV_32FC1);
|
||||
grayRnd_32f = new Mat(matSize, matSize, CvType.CV_32F);
|
||||
@ -157,8 +157,16 @@ public class OpenCVTestCase extends TestCase {
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
public static void assertListEqual(List<Float> list1, List<Float> list2, double epsilon)
|
||||
{
|
||||
public static void assertListIntegerEquals(List<Integer> list1, List<Integer> list2) {
|
||||
if (list1.size() != list2.size()) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
for (int i = 0; i < list1.size(); i++)
|
||||
assertEquals(list1.get(i), list2.get(i));
|
||||
}
|
||||
|
||||
public static void assertListFloatEquals(List<Float> list1, List<Float> list2, double epsilon) {
|
||||
if (list1.size() != list2.size()) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@ -167,6 +175,49 @@ public class OpenCVTestCase extends TestCase {
|
||||
assertTrue(Math.abs(list1.get(i) - list2.get(i)) <= epsilon);
|
||||
}
|
||||
|
||||
public static void assertListMatEquals(List<Mat> list1, List<Mat> list2, double epsilon) {
|
||||
if (list1.size() != list2.size()) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
for (int i = 0; i < list1.size(); i++)
|
||||
assertMatEqual(list1.get(i), list2.get(i), epsilon);
|
||||
}
|
||||
|
||||
public static void assertListPointEquals(List<Point> list1, List<Point> list2, double epsilon) {
|
||||
if (list1.size() != list2.size()) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
for (int i = 0; i < list1.size(); i++)
|
||||
assertPointEquals(list1.get(i), list2.get(i), epsilon);
|
||||
}
|
||||
|
||||
public static void assertListKeyPointEquals(List<KeyPoint> list1, List<KeyPoint> list2, double epsilon) {
|
||||
if (list1.size() != list2.size()) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
for (int i = 0; i < list1.size(); i++)
|
||||
assertKeyPointEqual(list1.get(i), list2.get(i), epsilon);
|
||||
}
|
||||
|
||||
public static void assertListRectEquals(List<Rect> list1, List<Rect> list2) {
|
||||
if (list1.size() != list2.size()) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
for (int i = 0; i < list1.size(); i++)
|
||||
assertRectEquals(list1.get(i), list2.get(i));
|
||||
}
|
||||
|
||||
public static void assertRectEquals(Rect expected, Rect actual) {
|
||||
assertEquals(expected.x, actual.x);
|
||||
assertEquals(expected.y, actual.y);
|
||||
assertEquals(expected.width, actual.width);
|
||||
assertEquals(expected.height, actual.height);
|
||||
}
|
||||
|
||||
public static void assertMatEqual(Mat m1, Mat m2) {
|
||||
compareMats(m1, m2, true);
|
||||
}
|
||||
@ -175,15 +226,15 @@ public class OpenCVTestCase extends TestCase {
|
||||
compareMats(m1, m2, false);
|
||||
}
|
||||
|
||||
public static void assertMatEqual(Mat expected, Mat actual, double eps){
|
||||
public static void assertMatEqual(Mat expected, Mat actual, double eps) {
|
||||
compareMats(expected, actual, eps, true);
|
||||
}
|
||||
|
||||
public static void assertMatNotEqual(Mat expected, Mat actual, double eps){
|
||||
public static void assertMatNotEqual(Mat expected, Mat actual, double eps) {
|
||||
compareMats(expected, actual, eps, false);
|
||||
}
|
||||
|
||||
public static void assertKeyPointEqual(KeyPoint expected, KeyPoint actual, double eps){
|
||||
public static void assertKeyPointEqual(KeyPoint expected, KeyPoint actual, double eps) {
|
||||
assertTrue(Math.hypot(expected.pt.x - actual.pt.x, expected.pt.y - actual.pt.y) < eps);
|
||||
assertTrue(Math.abs(expected.size - actual.size) < eps);
|
||||
assertTrue(Math.abs(expected.angle - actual.angle) < eps);
|
||||
@ -192,22 +243,23 @@ public class OpenCVTestCase extends TestCase {
|
||||
assertEquals(expected.class_id, actual.class_id);
|
||||
}
|
||||
|
||||
public static void assertPointEquals(Point expected, Point actual, double eps){
|
||||
public static void assertPointEquals(Point expected, Point actual, double eps) {
|
||||
assertEquals(expected.x, actual.x, eps);
|
||||
assertEquals(expected.y, actual.y, eps);
|
||||
}
|
||||
|
||||
static private void compareMats(Mat expected, Mat actual, boolean isEqualityMeasured) {
|
||||
if (expected.type() != actual.type() || expected.cols() != actual.cols()
|
||||
|| expected.rows() != actual.rows()) {
|
||||
if (expected.type() != actual.type() || expected.cols() != actual.cols() || expected.rows() != actual.rows()) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
if (expected.depth() == CvType.CV_32F || expected.depth() == CvType.CV_64F){
|
||||
if (expected.depth() == CvType.CV_32F || expected.depth() == CvType.CV_64F) {
|
||||
if (isEqualityMeasured)
|
||||
throw new UnsupportedOperationException("Floating-point Mats must not be checked for exact match. Use assertMatEqual(Mat expected, Mat actual, double eps) instead.");
|
||||
throw new UnsupportedOperationException(
|
||||
"Floating-point Mats must not be checked for exact match. Use assertMatEqual(Mat expected, Mat actual, double eps) instead.");
|
||||
else
|
||||
throw new UnsupportedOperationException("Floating-point Mats must not be checked for exact match. Use assertMatNotEqual(Mat expected, Mat actual, double eps) instead.");
|
||||
throw new UnsupportedOperationException(
|
||||
"Floating-point Mats must not be checked for exact match. Use assertMatNotEqual(Mat expected, Mat actual, double eps) instead.");
|
||||
}
|
||||
|
||||
Mat diff = new Mat();
|
||||
@ -218,20 +270,21 @@ public class OpenCVTestCase extends TestCase {
|
||||
reshaped.release();
|
||||
diff.release();
|
||||
|
||||
if(isEqualityMeasured)
|
||||
if (isEqualityMeasured)
|
||||
assertTrue("Mats are different in " + mistakes + " points", 0 == mistakes);
|
||||
else
|
||||
assertFalse("Mats are equal", 0 == mistakes);
|
||||
}
|
||||
|
||||
static private void compareMats(Mat expected, Mat actual, double eps, boolean isEqualityMeasured) {
|
||||
if (expected.type() != actual.type() || expected.cols() != actual.cols()
|
||||
|| expected.rows() != actual.rows()) {
|
||||
if (expected.type() != actual.type() || expected.cols() != actual.cols() || expected.rows() != actual.rows()) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
Mat diff = new Mat();
|
||||
Core.absdiff(expected, actual, diff);
|
||||
if(isEqualityMeasured)
|
||||
|
||||
if (isEqualityMeasured)
|
||||
assertTrue("Max difference between expected and actiual Mats is bigger than " + eps,
|
||||
Core.checkRange(diff, true, new Point(), 0.0, eps));
|
||||
else
|
||||
@ -240,8 +293,7 @@ public class OpenCVTestCase extends TestCase {
|
||||
}
|
||||
|
||||
public void test_1(String label) {
|
||||
OpenCVTestRunner
|
||||
.Log("================================================");
|
||||
OpenCVTestRunner.Log("================================================");
|
||||
OpenCVTestRunner.Log("=============== " + label);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
package org.opencv.test.calib3d;
|
||||
|
||||
import org.opencv.Converters;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.opencv.calib3d.Calib3d;
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.CvType;
|
||||
@ -11,9 +13,6 @@ import org.opencv.core.Scalar;
|
||||
import org.opencv.core.Size;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class calib3dTest extends OpenCVTestCase {
|
||||
|
||||
public void test_1() {
|
||||
@ -167,8 +166,7 @@ public class calib3dTest extends OpenCVTestCase {
|
||||
|
||||
public void testFilterSpecklesMatDoubleIntDouble() {
|
||||
gray_16s_1024.copyTo(dst);
|
||||
Point center = new Point(gray_16s_1024.rows() / 2.,
|
||||
gray_16s_1024.cols() / 2.);
|
||||
Point center = new Point(gray_16s_1024.rows() / 2., gray_16s_1024.cols() / 2.);
|
||||
Core.circle(dst, center, 1, Scalar.all(4096));
|
||||
|
||||
assertMatNotEqual(gray_16s_1024, dst);
|
||||
@ -188,9 +186,7 @@ public class calib3dTest extends OpenCVTestCase {
|
||||
|
||||
public void testFindChessboardCornersMatSizeMatInt() {
|
||||
Size patternSize = new Size(9, 6);
|
||||
Calib3d.findChessboardCorners(grayChess, patternSize, dst,
|
||||
Calib3d.CALIB_CB_ADAPTIVE_THRESH
|
||||
+ Calib3d.CALIB_CB_NORMALIZE_IMAGE
|
||||
Calib3d.findChessboardCorners(grayChess, patternSize, dst, Calib3d.CALIB_CB_ADAPTIVE_THRESH + Calib3d.CALIB_CB_NORMALIZE_IMAGE
|
||||
+ Calib3d.CALIB_CB_FAST_CHECK);
|
||||
assertTrue(!dst.empty());
|
||||
}
|
||||
@ -201,13 +197,11 @@ public class calib3dTest extends OpenCVTestCase {
|
||||
img.setTo(new Scalar(255));
|
||||
Mat centers = new Mat();
|
||||
|
||||
assertFalse(Calib3d
|
||||
.findCirclesGridDefault(img, new Size(5, 5), centers));
|
||||
assertFalse(Calib3d.findCirclesGridDefault(img, new Size(5, 5), centers));
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
for (int j = 0; j < 5; j++) {
|
||||
Point pt = new Point(size * (2 * i + 1) / 10, size
|
||||
* (2 * j + 1) / 10);
|
||||
Point pt = new Point(size * (2 * i + 1) / 10, size * (2 * j + 1) / 10);
|
||||
Core.circle(img, pt, 10, new Scalar(0), -1);
|
||||
}
|
||||
|
||||
@ -227,8 +221,7 @@ public class calib3dTest extends OpenCVTestCase {
|
||||
img.setTo(new Scalar(255));
|
||||
Mat centers = new Mat();
|
||||
|
||||
assertFalse(Calib3d.findCirclesGridDefault(img, new Size(3, 5),
|
||||
centers, Calib3d.CALIB_CB_CLUSTERING
|
||||
assertFalse(Calib3d.findCirclesGridDefault(img, new Size(3, 5), centers, Calib3d.CALIB_CB_CLUSTERING
|
||||
| Calib3d.CALIB_CB_ASYMMETRIC_GRID));
|
||||
|
||||
int step = size * 2 / 15;
|
||||
@ -236,13 +229,12 @@ public class calib3dTest extends OpenCVTestCase {
|
||||
int offsety = (size - 4 * step) / 2;
|
||||
for (int i = 0; i < 3; i++)
|
||||
for (int j = 0; j < 5; j++) {
|
||||
Point pt = new Point(offsetx + (2 * i + j % 2) * step, offsety
|
||||
+ step * j);
|
||||
Point pt = new Point(offsetx + (2 * i + j % 2) * step, offsety + step * j);
|
||||
Core.circle(img, pt, 10, new Scalar(0), -1);
|
||||
}
|
||||
|
||||
assertTrue(Calib3d.findCirclesGridDefault(img, new Size(3, 5), centers,
|
||||
Calib3d.CALIB_CB_CLUSTERING | Calib3d.CALIB_CB_ASYMMETRIC_GRID));
|
||||
assertTrue(Calib3d.findCirclesGridDefault(img, new Size(3, 5), centers, Calib3d.CALIB_CB_CLUSTERING
|
||||
| Calib3d.CALIB_CB_ASYMMETRIC_GRID));
|
||||
|
||||
assertEquals(15, centers.rows());
|
||||
assertEquals(1, centers.cols());
|
||||
@ -253,7 +245,8 @@ public class calib3dTest extends OpenCVTestCase {
|
||||
List<Point> pts1 = new ArrayList<Point>();
|
||||
List<Point> pts2 = new ArrayList<Point>();
|
||||
|
||||
int minFundamentalMatPoints = 9; //FIXME: probably should be 8 (see ticket #1262)
|
||||
int minFundamentalMatPoints = 9; // FIXME: probably should be 8 (see
|
||||
// ticket #1262)
|
||||
for (int i = 0; i < minFundamentalMatPoints; i++) {
|
||||
double x = Math.random() * 100 - 50;
|
||||
double y = Math.random() * 100 - 50;
|
||||
@ -263,7 +256,7 @@ public class calib3dTest extends OpenCVTestCase {
|
||||
|
||||
Mat fm = Calib3d.findFundamentalMat(pts1, pts2);
|
||||
|
||||
truth = new Mat(3,3,CvType.CV_64F);
|
||||
truth = new Mat(3, 3, CvType.CV_64F);
|
||||
truth.put(0, 0, 0, -0.5, -0.5, 0.5, 0, 0, 0.5, 0, 0);
|
||||
assertMatEqual(truth, fm, EPS);
|
||||
}
|
||||
@ -365,18 +358,14 @@ public class calib3dTest extends OpenCVTestCase {
|
||||
}
|
||||
|
||||
public void testReprojectImageTo3DMatMatMat() {
|
||||
Mat transformMatrix = new Mat(4,4,CvType.CV_64F);
|
||||
transformMatrix.put(0, 0,
|
||||
0, 1, 0, 0,
|
||||
1, 0, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, 0, 0, 1);
|
||||
Mat transformMatrix = new Mat(4, 4, CvType.CV_64F);
|
||||
transformMatrix.put(0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
||||
|
||||
Mat disparity = new Mat(matSize,matSize,CvType.CV_32F);
|
||||
Mat disparity = new Mat(matSize, matSize, CvType.CV_32F);
|
||||
|
||||
float[] disp = new float[matSize * matSize];
|
||||
for (int i = 0; i < matSize; i++)
|
||||
for(int j = 0; j < matSize; j++)
|
||||
for (int j = 0; j < matSize; j++)
|
||||
disp[i * matSize + j] = i - j;
|
||||
disparity.put(0, 0, disp);
|
||||
|
||||
@ -388,15 +377,14 @@ public class calib3dTest extends OpenCVTestCase {
|
||||
assertEquals(matSize, _3dPoints.rows());
|
||||
assertEquals(matSize, _3dPoints.cols());
|
||||
|
||||
truth = new Mat(matSize,matSize,CvType.CV_32FC3);
|
||||
truth = new Mat(matSize, matSize, CvType.CV_32FC3);
|
||||
|
||||
float[] _truth = new float[matSize * matSize * 3];
|
||||
for (int i = 0; i < matSize; i++)
|
||||
for(int j = 0; j < matSize; j++)
|
||||
{
|
||||
for (int j = 0; j < matSize; j++) {
|
||||
_truth[(i * matSize + j) * 3 + 0] = i;
|
||||
_truth[(i * matSize + j) * 3 + 1] = j;
|
||||
_truth[(i * matSize + j) * 3 + 2] = i-j;
|
||||
_truth[(i * matSize + j) * 3 + 2] = i - j;
|
||||
}
|
||||
truth.put(0, 0, _truth);
|
||||
|
||||
@ -404,18 +392,14 @@ public class calib3dTest extends OpenCVTestCase {
|
||||
}
|
||||
|
||||
public void testReprojectImageTo3DMatMatMatBoolean() {
|
||||
Mat transformMatrix = new Mat(4,4,CvType.CV_64F);
|
||||
transformMatrix.put(0, 0,
|
||||
0, 1, 0, 0,
|
||||
1, 0, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, 0, 0, 1);
|
||||
Mat transformMatrix = new Mat(4, 4, CvType.CV_64F);
|
||||
transformMatrix.put(0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
||||
|
||||
Mat disparity = new Mat(matSize,matSize,CvType.CV_32F);
|
||||
Mat disparity = new Mat(matSize, matSize, CvType.CV_32F);
|
||||
|
||||
float[] disp = new float[matSize * matSize];
|
||||
for (int i = 0; i < matSize; i++)
|
||||
for(int j = 0; j < matSize; j++)
|
||||
for (int j = 0; j < matSize; j++)
|
||||
disp[i * matSize + j] = i - j;
|
||||
disp[0] = -Float.MAX_VALUE;
|
||||
disparity.put(0, 0, disp);
|
||||
@ -428,15 +412,14 @@ public class calib3dTest extends OpenCVTestCase {
|
||||
assertEquals(matSize, _3dPoints.rows());
|
||||
assertEquals(matSize, _3dPoints.cols());
|
||||
|
||||
truth = new Mat(matSize,matSize,CvType.CV_32FC3);
|
||||
truth = new Mat(matSize, matSize, CvType.CV_32FC3);
|
||||
|
||||
float[] _truth = new float[matSize * matSize * 3];
|
||||
for (int i = 0; i < matSize; i++)
|
||||
for(int j = 0; j < matSize; j++)
|
||||
{
|
||||
for (int j = 0; j < matSize; j++) {
|
||||
_truth[(i * matSize + j) * 3 + 0] = i;
|
||||
_truth[(i * matSize + j) * 3 + 1] = j;
|
||||
_truth[(i * matSize + j) * 3 + 2] = i-j;
|
||||
_truth[(i * matSize + j) * 3 + 2] = i - j;
|
||||
}
|
||||
_truth[2] = 10000;
|
||||
truth.put(0, 0, _truth);
|
||||
@ -445,18 +428,14 @@ public class calib3dTest extends OpenCVTestCase {
|
||||
}
|
||||
|
||||
public void testReprojectImageTo3DMatMatMatBooleanInt() {
|
||||
Mat transformMatrix = new Mat(4,4,CvType.CV_64F);
|
||||
transformMatrix.put(0, 0,
|
||||
0, 1, 0, 0,
|
||||
1, 0, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, 0, 0, 1);
|
||||
Mat transformMatrix = new Mat(4, 4, CvType.CV_64F);
|
||||
transformMatrix.put(0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
||||
|
||||
Mat disparity = new Mat(matSize,matSize,CvType.CV_32F);
|
||||
Mat disparity = new Mat(matSize, matSize, CvType.CV_32F);
|
||||
|
||||
float[] disp = new float[matSize * matSize];
|
||||
for (int i = 0; i < matSize; i++)
|
||||
for(int j = 0; j < matSize; j++)
|
||||
for (int j = 0; j < matSize; j++)
|
||||
disp[i * matSize + j] = i - j;
|
||||
disparity.put(0, 0, disp);
|
||||
|
||||
@ -468,15 +447,14 @@ public class calib3dTest extends OpenCVTestCase {
|
||||
assertEquals(matSize, _3dPoints.rows());
|
||||
assertEquals(matSize, _3dPoints.cols());
|
||||
|
||||
truth = new Mat(matSize,matSize,CvType.CV_16SC3);
|
||||
truth = new Mat(matSize, matSize, CvType.CV_16SC3);
|
||||
|
||||
short[] _truth = new short[matSize * matSize * 3];
|
||||
for (short i = 0; i < matSize; i++)
|
||||
for(short j = 0; j < matSize; j++)
|
||||
{
|
||||
for (short j = 0; j < matSize; j++) {
|
||||
_truth[(i * matSize + j) * 3 + 0] = i;
|
||||
_truth[(i * matSize + j) * 3 + 1] = j;
|
||||
_truth[(i * matSize + j) * 3 + 2] = (short) (i-j);
|
||||
_truth[(i * matSize + j) * 3 + 2] = (short) (i - j);
|
||||
}
|
||||
truth.put(0, 0, _truth);
|
||||
|
||||
|
@ -160,13 +160,11 @@ public class MatTest extends OpenCVTestCase {
|
||||
}
|
||||
|
||||
public void testMatIntIntCvTypeScalar() {
|
||||
dst = new Mat(gray127.rows(), gray127.cols(), CvType.CV_8U, new Scalar(
|
||||
127));
|
||||
dst = new Mat(gray127.rows(), gray127.cols(), CvType.CV_8U, new Scalar(127));
|
||||
assertFalse(dst.empty());
|
||||
assertMatEqual(dst, gray127);
|
||||
|
||||
dst = new Mat(rgba128.rows(), rgba128.cols(), CvType.CV_8UC4,
|
||||
Scalar.all(128));
|
||||
dst = new Mat(rgba128.rows(), rgba128.cols(), CvType.CV_8UC4, Scalar.all(128));
|
||||
assertFalse(dst.empty());
|
||||
assertMatEqual(dst, rgba128);
|
||||
}
|
||||
@ -180,13 +178,11 @@ public class MatTest extends OpenCVTestCase {
|
||||
}
|
||||
|
||||
public void testMatIntIntIntScalar() {
|
||||
Mat m1 = new Mat(gray127.rows(), gray127.cols(), CvType.CV_8U,
|
||||
new Scalar(127));
|
||||
Mat m1 = new Mat(gray127.rows(), gray127.cols(), CvType.CV_8U, new Scalar(127));
|
||||
assertFalse(m1.empty());
|
||||
assertMatEqual(m1, gray127);
|
||||
|
||||
Mat m2 = new Mat(gray0_32f.rows(), gray0_32f.cols(), CvType.CV_32F,
|
||||
new Scalar(0));
|
||||
Mat m2 = new Mat(gray0_32f.rows(), gray0_32f.cols(), CvType.CV_32F, new Scalar(0));
|
||||
assertFalse(m2.empty());
|
||||
assertMatEqual(m2, gray0_32f, EPS);
|
||||
}
|
||||
|
@ -1,47 +1,96 @@
|
||||
package org.opencv.test.core;
|
||||
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Point3;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class Point3Test extends OpenCVTestCase {
|
||||
|
||||
private Point3 p1;
|
||||
private Point3 p2;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
p1 = new Point3(2, 2, 2);
|
||||
p2 = new Point3(1, 1, 1);
|
||||
}
|
||||
|
||||
public void testClone() {
|
||||
fail("Not yet implemented");
|
||||
Point3 truth = new Point3(1, 1, 1);
|
||||
p1 = truth.clone();
|
||||
assertEquals(truth, p1);
|
||||
}
|
||||
|
||||
public void testCross() {
|
||||
fail("Not yet implemented");
|
||||
Point3 dstPoint = p1.cross(p2);
|
||||
Point3 truth = new Point3(0, 0, 0);
|
||||
assertEquals(truth, dstPoint);
|
||||
}
|
||||
|
||||
public void testDot() {
|
||||
fail("Not yet implemented");
|
||||
double result = p1.dot(p2);
|
||||
assertEquals(6.0, result);
|
||||
}
|
||||
|
||||
public void testEqualsObject() {
|
||||
fail("Not yet implemented");
|
||||
boolean flag = p1.equals(p1);
|
||||
assertTrue(flag);
|
||||
|
||||
flag = p1.equals(p2);
|
||||
assertFalse(flag);
|
||||
}
|
||||
|
||||
public void testPoint3() {
|
||||
fail("Not yet implemented");
|
||||
p1 = new Point3();
|
||||
|
||||
assertNotNull(p1);
|
||||
assertTrue(0 == p1.x);
|
||||
assertTrue(0 == p1.y);
|
||||
assertTrue(0 == p1.z);
|
||||
}
|
||||
|
||||
public void testPoint3DoubleArray() {
|
||||
fail("Not yet implemented");
|
||||
double[] vals = { 1, 2, 3 };
|
||||
p1 = new Point3(vals);
|
||||
|
||||
assertTrue(1 == p1.x);
|
||||
assertTrue(2 == p1.y);
|
||||
assertTrue(3 == p1.z);
|
||||
}
|
||||
|
||||
public void testPoint3DoubleDoubleDouble() {
|
||||
fail("Not yet implemented");
|
||||
p1 = new Point3(1, 2, 3);
|
||||
|
||||
assertEquals(1., p1.x);
|
||||
assertEquals(2., p1.y);
|
||||
assertEquals(3., p1.z);
|
||||
}
|
||||
|
||||
public void testPoint3Point() {
|
||||
fail("Not yet implemented");
|
||||
Point p = new Point(2, 3);
|
||||
p1 = new Point3(p);
|
||||
|
||||
assertEquals(2., p1.x);
|
||||
assertEquals(3., p1.y);
|
||||
assertEquals(0., p1.z);
|
||||
}
|
||||
|
||||
public void testSet() {
|
||||
fail("Not yet implemented");
|
||||
double[] vals1 = {};
|
||||
p1.set(vals1);
|
||||
|
||||
assertEquals(0., p1.x);
|
||||
assertEquals(0., p1.y);
|
||||
assertEquals(0., p1.z);
|
||||
|
||||
double[] vals2 = { 3, 6, 10 };
|
||||
p1.set(vals2);
|
||||
|
||||
assertEquals(3., p1.x);
|
||||
assertEquals(6., p1.y);
|
||||
assertEquals(10., p1.z);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,47 +1,89 @@
|
||||
package org.opencv.test.core;
|
||||
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Rect;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class PointTest extends OpenCVTestCase {
|
||||
|
||||
private Point p1;
|
||||
private Point p2;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
p1 = new Point(2, 2);
|
||||
p2 = new Point(1, 1);
|
||||
}
|
||||
|
||||
public void testClone() {
|
||||
fail("Not yet implemented");
|
||||
Point truth = new Point(1, 1);
|
||||
Point dstPoint = truth.clone();
|
||||
assertEquals(truth, dstPoint);
|
||||
}
|
||||
|
||||
public void testDot() {
|
||||
fail("Not yet implemented");
|
||||
double result = p1.dot(p2);
|
||||
assertEquals(4.0, result);
|
||||
}
|
||||
|
||||
public void testEqualsObject() {
|
||||
fail("Not yet implemented");
|
||||
boolean flag = p1.equals(p1);
|
||||
assertTrue(flag);
|
||||
|
||||
flag = p1.equals(p2);
|
||||
assertFalse(flag);
|
||||
}
|
||||
|
||||
public void testInside() {
|
||||
fail("Not yet implemented");
|
||||
Rect rect = new Rect(0, 0, 5, 3);
|
||||
assertTrue(p1.inside(rect));
|
||||
|
||||
Point p2 = new Point(3, 3);
|
||||
assertFalse(p2.inside(rect));
|
||||
}
|
||||
|
||||
public void testPoint() {
|
||||
fail("Not yet implemented");
|
||||
Point p = new Point();
|
||||
|
||||
assertNotNull(p);
|
||||
assertEquals(0.0, p.x);
|
||||
assertEquals(0.0, p.y);
|
||||
}
|
||||
|
||||
public void testPointDoubleArray() {
|
||||
fail("Not yet implemented");
|
||||
double[] vals = { 2, 4 };
|
||||
Point p = new Point(vals);
|
||||
|
||||
assertEquals(2.0, p.x);
|
||||
assertEquals(4.0, p.y);
|
||||
}
|
||||
|
||||
public void testPointDoubleDouble() {
|
||||
fail("Not yet implemented");
|
||||
p1 = new Point(7, 5);
|
||||
|
||||
assertNotNull(p1);
|
||||
assertEquals(7.0, p1.x);
|
||||
assertEquals(5.0, p1.y);
|
||||
}
|
||||
|
||||
public void testSet() {
|
||||
fail("Not yet implemented");
|
||||
double[] vals1 = {};
|
||||
p1.set(vals1);
|
||||
assertEquals(0.0, p1.x);
|
||||
assertEquals(0.0, p1.y);
|
||||
|
||||
double[] vals2 = { 6, 10 };
|
||||
p2.set(vals2);
|
||||
assertEquals(6.0, p2.x);
|
||||
assertEquals(10.0, p2.y);
|
||||
}
|
||||
|
||||
public void testToString() {
|
||||
fail("Not yet implemented");
|
||||
String actual = p1.toString();
|
||||
String expected = "{2.0, 2.0}";
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,59 +1,109 @@
|
||||
package org.opencv.test.core;
|
||||
|
||||
import org.opencv.core.Range;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class RangeTest extends OpenCVTestCase {
|
||||
|
||||
Range range;
|
||||
Range r1;
|
||||
Range r2;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
range = new Range();
|
||||
r1 = new Range(1, 11);
|
||||
r2 = new Range(1, 1);
|
||||
}
|
||||
|
||||
public void testAll() {
|
||||
fail("Not yet implemented");
|
||||
range = Range.all();
|
||||
assertEquals(Integer.MIN_VALUE, range.start);
|
||||
assertEquals(Integer.MAX_VALUE, range.end);
|
||||
}
|
||||
|
||||
public void testClone() {
|
||||
fail("Not yet implemented");
|
||||
Range dstRange = new Range();
|
||||
dstRange = r1.clone();
|
||||
assertEquals(r1, dstRange);
|
||||
}
|
||||
|
||||
public void testEmpty() {
|
||||
fail("Not yet implemented");
|
||||
boolean flag;
|
||||
|
||||
flag = r1.empty();
|
||||
assertFalse(flag);
|
||||
|
||||
flag = r2.empty();
|
||||
assertTrue(flag);
|
||||
}
|
||||
|
||||
public void testEqualsObject() {
|
||||
fail("Not yet implemented");
|
||||
assertFalse(r2.equals(r1));
|
||||
|
||||
range = r1.clone();
|
||||
assertTrue(r1.equals(range));
|
||||
}
|
||||
|
||||
public void testIntersection() {
|
||||
fail("Not yet implemented");
|
||||
range = r1.intersection(r2);
|
||||
assertEquals(r2, range);
|
||||
}
|
||||
|
||||
public void testRange() {
|
||||
fail("Not yet implemented");
|
||||
range = new Range();
|
||||
|
||||
assertNotNull(range);
|
||||
assertEquals(0, range.start);
|
||||
assertEquals(0, range.end);
|
||||
}
|
||||
|
||||
public void testRangeDoubleArray() {
|
||||
fail("Not yet implemented");
|
||||
double[] vals = { 2, 4 };
|
||||
Range r = new Range(vals);
|
||||
|
||||
assertTrue(2 == r.start);
|
||||
assertTrue(4 == r.end);
|
||||
}
|
||||
|
||||
public void testRangeIntInt() {
|
||||
fail("Not yet implemented");
|
||||
r1 = new Range(12, 13);
|
||||
|
||||
assertNotNull(r1);
|
||||
assertEquals(12, r1.start);
|
||||
assertEquals(13, r1.end);
|
||||
}
|
||||
|
||||
public void testSet() {
|
||||
fail("Not yet implemented");
|
||||
double[] vals1 = {};
|
||||
r1.set(vals1);
|
||||
assertEquals(0, r1.start);
|
||||
assertEquals(0, r1.end);
|
||||
|
||||
double[] vals2 = { 6, 10 };
|
||||
r2.set(vals2);
|
||||
assertEquals(6, r2.start);
|
||||
assertEquals(10, r2.end);
|
||||
}
|
||||
|
||||
public void testShift() {
|
||||
fail("Not yet implemented");
|
||||
int delta = 1;
|
||||
range = range.shift(delta);
|
||||
assertEquals(r2, range);
|
||||
}
|
||||
|
||||
public void testSize() {
|
||||
fail("Not yet implemented");
|
||||
assertEquals(10, r1.size());
|
||||
|
||||
assertEquals(0, r2.size());
|
||||
}
|
||||
|
||||
public void testToString() {
|
||||
fail("Not yet implemented");
|
||||
String actual = r1.toString();
|
||||
String expected = "[1, 11)";
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,82 +2,158 @@ package org.opencv.test.core;
|
||||
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Rect;
|
||||
import org.opencv.core.Size;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class RectTest extends OpenCVTestCase {
|
||||
|
||||
private Rect r;
|
||||
private Rect rect;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
r = new Rect();
|
||||
rect = new Rect(0, 0, 10, 10);
|
||||
}
|
||||
|
||||
public void testArea() {
|
||||
fail("Not yet implemented");
|
||||
double area;
|
||||
area = rect.area();
|
||||
assertEquals(100.0, area);
|
||||
}
|
||||
|
||||
public void testBr() {
|
||||
fail("Not yet implemented");
|
||||
Point p_br = new Point();
|
||||
p_br = rect.br();
|
||||
Point truth = new Point(10, 10);
|
||||
assertEquals(truth, p_br);
|
||||
}
|
||||
|
||||
public void testClone() {
|
||||
fail("Not yet implemented");
|
||||
r = rect.clone();
|
||||
assertEquals(rect, r);
|
||||
}
|
||||
|
||||
public void testContains() {
|
||||
Rect r = new Rect(0,0,10,10);
|
||||
Point p_inner = new Point(5,5);
|
||||
Point p_outer = new Point(5,55);
|
||||
Point p_bl = new Point(0,0);
|
||||
Point p_br = new Point(10,0);
|
||||
Point p_tl = new Point(0,10);
|
||||
Point p_tr = new Point(10,10);
|
||||
Rect rect = new Rect(0, 0, 10, 10);
|
||||
|
||||
assertTrue(r.contains(p_inner));
|
||||
assertTrue(r.contains(p_bl));
|
||||
Point p_inner = new Point(5, 5);
|
||||
Point p_outer = new Point(5, 55);
|
||||
Point p_bl = new Point(0, 0);
|
||||
Point p_br = new Point(10, 0);
|
||||
Point p_tl = new Point(0, 10);
|
||||
Point p_tr = new Point(10, 10);
|
||||
|
||||
assertFalse(r.contains(p_outer));
|
||||
assertFalse(r.contains(p_br));
|
||||
assertFalse(r.contains(p_tl));
|
||||
assertFalse(r.contains(p_tr));
|
||||
assertTrue(rect.contains(p_inner));
|
||||
assertTrue(rect.contains(p_bl));
|
||||
|
||||
assertFalse(rect.contains(p_outer));
|
||||
assertFalse(rect.contains(p_br));
|
||||
assertFalse(rect.contains(p_tl));
|
||||
assertFalse(rect.contains(p_tr));
|
||||
}
|
||||
|
||||
public void testEqualsObject() {
|
||||
fail("Not yet implemented");
|
||||
boolean flag;
|
||||
flag = rect.equals(r);
|
||||
assertFalse(flag);
|
||||
|
||||
r = rect.clone();
|
||||
flag = rect.equals(r);
|
||||
assertTrue(flag);
|
||||
}
|
||||
|
||||
public void testRect() {
|
||||
fail("Not yet implemented");
|
||||
r = new Rect();
|
||||
|
||||
assertEquals(0, r.x);
|
||||
assertEquals(0, r.y);
|
||||
assertEquals(0, r.width);
|
||||
assertEquals(0, r.height);
|
||||
}
|
||||
|
||||
public void testRectDoubleArray() {
|
||||
fail("Not yet implemented");
|
||||
double[] vals = { 1, 3, 5, 2 };
|
||||
r = new Rect(vals);
|
||||
|
||||
assertEquals(1, r.x);
|
||||
assertEquals(3, r.y);
|
||||
assertEquals(5, r.width);
|
||||
assertEquals(2, r.height);
|
||||
}
|
||||
|
||||
public void testRectIntIntIntInt() {
|
||||
fail("Not yet implemented");
|
||||
r = new Rect(1, 3, 5, 2);
|
||||
|
||||
assertNotNull(rect);
|
||||
assertEquals(0, rect.x);
|
||||
assertEquals(0, rect.y);
|
||||
assertEquals(10, rect.width);
|
||||
assertEquals(10, rect.height);
|
||||
}
|
||||
|
||||
public void testRectPointPoint() {
|
||||
fail("Not yet implemented");
|
||||
Point p1 = new Point(4, 4);
|
||||
Point p2 = new Point(2, 3);
|
||||
|
||||
r = new Rect(p1, p2);
|
||||
assertNotNull(r);
|
||||
assertEquals(2, r.x);
|
||||
assertEquals(3, r.y);
|
||||
assertEquals(2, r.width);
|
||||
assertEquals(1, r.height);
|
||||
}
|
||||
|
||||
public void testRectPointSize() {
|
||||
fail("Not yet implemented");
|
||||
Point p1 = new Point(4, 4);
|
||||
Size sz = new Size(3, 1);
|
||||
r = new Rect(p1, sz);
|
||||
|
||||
assertEquals(4, r.x);
|
||||
assertEquals(4, r.y);
|
||||
assertEquals(3, r.width);
|
||||
assertEquals(1, r.height);
|
||||
}
|
||||
|
||||
public void testSet() {
|
||||
fail("Not yet implemented");
|
||||
double[] vals1 = {};
|
||||
Rect r1 = new Rect(vals1);
|
||||
|
||||
assertEquals(0, r1.x);
|
||||
assertEquals(0, r1.y);
|
||||
assertEquals(0, r1.width);
|
||||
assertEquals(0, r1.height);
|
||||
|
||||
double[] vals2 = { 2, 2, 10, 5 };
|
||||
r = new Rect(vals2);
|
||||
|
||||
assertEquals(2, r.x);
|
||||
assertEquals(2, r.y);
|
||||
assertEquals(10, r.width);
|
||||
assertEquals(5, r.height);
|
||||
}
|
||||
|
||||
public void testSize() {
|
||||
fail("Not yet implemented");
|
||||
Size s1 = new Size(0, 0);
|
||||
assertEquals(s1, r.size());
|
||||
|
||||
Size s2 = new Size(10, 10);
|
||||
assertEquals(s2, rect.size());
|
||||
}
|
||||
|
||||
public void testTl() {
|
||||
fail("Not yet implemented");
|
||||
Point p_tl = new Point();
|
||||
p_tl = rect.tl();
|
||||
Point truth = new Point(0, 0);
|
||||
assertEquals(truth, p_tl);
|
||||
}
|
||||
|
||||
public void testToString() {
|
||||
fail("Not yet implemented");
|
||||
String actual = rect.toString();
|
||||
String expected = "{0, 0, 10x10}";
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ public class RotatedRectTest extends OpenCVTestCase {
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
center = new Point(matSize/2, matSize/2);
|
||||
size = new Size(matSize/4, matSize/2);
|
||||
center = new Point(matSize / 2, matSize / 2);
|
||||
size = new Size(matSize / 4, matSize / 2);
|
||||
angle = 40;
|
||||
}
|
||||
|
||||
@ -26,6 +26,7 @@ public class RotatedRectTest extends OpenCVTestCase {
|
||||
}
|
||||
|
||||
public void testBoundingRect() {
|
||||
size = new Size(matSize / 2, matSize / 2);
|
||||
assertEquals(size.height, size.width);
|
||||
double length = size.height;
|
||||
|
||||
@ -33,16 +34,13 @@ public class RotatedRectTest extends OpenCVTestCase {
|
||||
RotatedRect rr = new RotatedRect(center, size, angle);
|
||||
|
||||
Rect r = rr.boundingRect();
|
||||
double halfDiagonal = length * Math.sqrt(2)/2;
|
||||
double halfDiagonal = length * Math.sqrt(2) / 2;
|
||||
|
||||
assertTrue((r.x == Math.floor(center.x - halfDiagonal)) &&
|
||||
(r.y == Math.floor(center.y - halfDiagonal)));
|
||||
assertTrue((r.x == Math.floor(center.x - halfDiagonal)) && (r.y == Math.floor(center.y - halfDiagonal)));
|
||||
|
||||
assertTrue((r.br().x >= Math.ceil(center.x + halfDiagonal)) &&
|
||||
(r.br().y >= Math.ceil(center.y + halfDiagonal)));
|
||||
assertTrue((r.br().x >= Math.ceil(center.x + halfDiagonal)) && (r.br().y >= Math.ceil(center.y + halfDiagonal)));
|
||||
|
||||
assertTrue((r.br().x - Math.ceil(center.x + halfDiagonal)) <= 1 &&
|
||||
(r.br().y - Math.ceil(center.y + halfDiagonal)) <= 1);
|
||||
assertTrue((r.br().x - Math.ceil(center.x + halfDiagonal)) <= 1 && (r.br().y - Math.ceil(center.y + halfDiagonal)) <= 1);
|
||||
}
|
||||
|
||||
public void testClone() {
|
||||
@ -56,8 +54,8 @@ public class RotatedRectTest extends OpenCVTestCase {
|
||||
}
|
||||
|
||||
public void testEqualsObject() {
|
||||
Point center2 = new Point(matSize/3, matSize/1.5);
|
||||
Size size2 = new Size(matSize/2, matSize/4);
|
||||
Point center2 = new Point(matSize / 3, matSize / 1.5);
|
||||
Size size2 = new Size(matSize / 2, matSize / 4);
|
||||
double angle2 = 0;
|
||||
|
||||
RotatedRect rrect1 = new RotatedRect(center, size, angle);
|
||||
@ -93,40 +91,44 @@ public class RotatedRectTest extends OpenCVTestCase {
|
||||
Point p[] = new Point[4];
|
||||
rrect.points(p);
|
||||
|
||||
boolean is_p0_irrational = (100 * p[0].x != (int)(100 * p[0].x)) && (100 * p[0].y != (int)(100 * p[0].y));
|
||||
boolean is_p1_irrational = (100 * p[1].x != (int)(100 * p[1].x)) && (100 * p[1].y != (int)(100 * p[1].y));
|
||||
boolean is_p2_irrational = (100 * p[2].x != (int)(100 * p[2].x)) && (100 * p[2].y != (int)(100 * p[2].y));
|
||||
boolean is_p3_irrational = (100 * p[3].x != (int)(100 * p[3].x)) && (100 * p[3].y != (int)(100 * p[3].y));
|
||||
boolean is_p0_irrational = (100 * p[0].x != (int) (100 * p[0].x)) && (100 * p[0].y != (int) (100 * p[0].y));
|
||||
boolean is_p1_irrational = (100 * p[1].x != (int) (100 * p[1].x)) && (100 * p[1].y != (int) (100 * p[1].y));
|
||||
boolean is_p2_irrational = (100 * p[2].x != (int) (100 * p[2].x)) && (100 * p[2].y != (int) (100 * p[2].y));
|
||||
boolean is_p3_irrational = (100 * p[3].x != (int) (100 * p[3].x)) && (100 * p[3].y != (int) (100 * p[3].y));
|
||||
|
||||
assertTrue(is_p0_irrational && is_p1_irrational && is_p2_irrational && is_p3_irrational);
|
||||
|
||||
assertTrue("Symmetric points 0 and 2",
|
||||
Math.abs((p[0].x + p[2].x)/2 - center.x) + Math.abs((p[0].y + p[2].y)/2 - center.y) < EPS);
|
||||
Math.abs((p[0].x + p[2].x) / 2 - center.x) + Math.abs((p[0].y + p[2].y) / 2 - center.y) < EPS);
|
||||
|
||||
assertTrue("Symmetric points 1 and 3",
|
||||
Math.abs((p[1].x + p[3].x)/2 - center.x) + Math.abs((p[1].y + p[3].y)/2 - center.y) < EPS);
|
||||
Math.abs((p[1].x + p[3].x) / 2 - center.x) + Math.abs((p[1].y + p[3].y) / 2 - center.y) < EPS);
|
||||
|
||||
assertTrue("Orthogonal vectors 01 and 12",
|
||||
Math.abs((p[1].x - p[0].x) * (p[2].x - p[1].x) + (p[1].y - p[0].y) * (p[2].y - p[1].y) ) < EPS);
|
||||
Math.abs((p[1].x - p[0].x) * (p[2].x - p[1].x) +
|
||||
(p[1].y - p[0].y) * (p[2].y - p[1].y)) < EPS);
|
||||
|
||||
assertTrue("Orthogonal vectors 12 and 23",
|
||||
Math.abs((p[2].x - p[1].x) * (p[3].x - p[2].x) + (p[2].y - p[1].y) * (p[3].y - p[2].y) ) < EPS);
|
||||
Math.abs((p[2].x - p[1].x) * (p[3].x - p[2].x) +
|
||||
(p[2].y - p[1].y) * (p[3].y - p[2].y)) < EPS);
|
||||
|
||||
assertTrue("Orthogonal vectors 23 and 30",
|
||||
Math.abs((p[3].x - p[2].x) * (p[0].x - p[3].x) + (p[3].y - p[2].y) * (p[0].y - p[3].y) ) < EPS);
|
||||
Math.abs((p[3].x - p[2].x) * (p[0].x - p[3].x) +
|
||||
(p[3].y - p[2].y) * (p[0].y - p[3].y)) < EPS);
|
||||
|
||||
assertTrue("Orthogonal vectors 30 and 01",
|
||||
Math.abs((p[0].x - p[3].x) * (p[1].x - p[0].x) + (p[0].y - p[3].y) * (p[1].y - p[0].y) ) < EPS);
|
||||
Math.abs((p[0].x - p[3].x) * (p[1].x - p[0].x) +
|
||||
(p[0].y - p[3].y) * (p[1].y - p[0].y)) < EPS);
|
||||
|
||||
assertTrue("Length of the vector 01",
|
||||
Math.abs((p[1].x - p[0].x) * (p[1].x - p[0].x) + (p[1].y - p[0].y) * (p[1].y - p[0].y) - size.height * size.height) < EPS);
|
||||
Math.abs((p[1].x - p[0].x) * (p[1].x - p[0].x) +
|
||||
(p[1].y - p[0].y) * (p[1].y - p[0].y) - size.height * size.height) < EPS);
|
||||
|
||||
assertTrue("Length of the vector 21",
|
||||
Math.abs((p[1].x - p[2].x) * (p[1].x - p[2].x) + (p[1].y - p[2].y) * (p[1].y - p[2].y) - size.width * size.width ) < EPS);
|
||||
|
||||
assertTrue("Angle of the vector 21 with the axes",
|
||||
Math.abs((p[2].x - p[1].x) / size.width - Math.cos(angle * Math.PI / 180)) < EPS);
|
||||
Math.abs((p[1].x - p[2].x) * (p[1].x - p[2].x) +
|
||||
(p[1].y - p[2].y) * (p[1].y - p[2].y) - size.width * size.width) < EPS);
|
||||
|
||||
assertTrue("Angle of the vector 21 with the axes", Math.abs((p[2].x - p[1].x) / size.width - Math.cos(angle * Math.PI / 180)) < EPS);
|
||||
}
|
||||
|
||||
public void testRotatedRect() {
|
||||
@ -139,8 +141,15 @@ public class RotatedRectTest extends OpenCVTestCase {
|
||||
}
|
||||
|
||||
public void testRotatedRectDoubleArray() {
|
||||
fail("Not yet implemented");
|
||||
//public RotatedRect(double[] vals)
|
||||
double[] vals = {1, 2, 3, 4, 5};
|
||||
RotatedRect rr = new RotatedRect(vals);
|
||||
|
||||
assertNotNull(rr);
|
||||
assertEquals(1., rr.center.x);
|
||||
assertEquals(2., rr.center.y);
|
||||
assertEquals(3., rr.size.width);
|
||||
assertEquals(4., rr.size.height);
|
||||
assertEquals(5., rr.angle);
|
||||
}
|
||||
|
||||
public void testRotatedRectPointSizeDouble() {
|
||||
|
@ -1,63 +1,100 @@
|
||||
package org.opencv.test.core;
|
||||
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class ScalarTest extends OpenCVTestCase {
|
||||
|
||||
private Scalar s1;
|
||||
private Scalar s2;
|
||||
private Scalar dstScalar;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
s1 = new Scalar(1.0);
|
||||
s2 = Scalar.all(1.0);
|
||||
dstScalar = null;
|
||||
}
|
||||
|
||||
public void testAll() {
|
||||
fail("Not yet implemented");
|
||||
dstScalar = Scalar.all(2.0);
|
||||
Scalar truth = new Scalar(2.0, 2.0, 2.0, 2.0);
|
||||
assertEquals(truth, dstScalar);
|
||||
}
|
||||
|
||||
public void testClone() {
|
||||
fail("Not yet implemented");
|
||||
dstScalar = s2.clone();
|
||||
assertEquals(s2, dstScalar);
|
||||
}
|
||||
|
||||
public void testConj() {
|
||||
fail("Not yet implemented");
|
||||
dstScalar = s2.conj();
|
||||
Scalar truth = new Scalar(1, -1, -1, -1);
|
||||
assertEquals(truth, dstScalar);
|
||||
}
|
||||
|
||||
public void testEqualsObject() {
|
||||
fail("Not yet implemented");
|
||||
dstScalar = s2.clone();
|
||||
assertTrue(s2.equals(dstScalar));
|
||||
|
||||
assertFalse(s2.equals(s1));
|
||||
}
|
||||
|
||||
public void testIsReal() {
|
||||
fail("Not yet implemented");
|
||||
assertTrue(s1.isReal());
|
||||
|
||||
assertFalse(s2.isReal());
|
||||
}
|
||||
|
||||
public void testMulScalar() {
|
||||
fail("Not yet implemented");
|
||||
dstScalar = s2.mul(s1);
|
||||
assertEquals(s1, dstScalar);
|
||||
}
|
||||
|
||||
public void testMulScalarDouble() {
|
||||
fail("Not yet implemented");
|
||||
double multiplier = 2.0;
|
||||
dstScalar = s2.mul(s1, multiplier);
|
||||
Scalar truth = new Scalar(2);
|
||||
assertEquals(truth, dstScalar);
|
||||
}
|
||||
|
||||
public void testScalarDouble() {
|
||||
fail("Not yet implemented");
|
||||
Scalar truth = new Scalar(1);
|
||||
assertEquals(truth, s1);
|
||||
}
|
||||
|
||||
public void testScalarDoubleArray() {
|
||||
fail("Not yet implemented");
|
||||
double[] vals = { 2.0, 4.0, 5.0, 3.0 };
|
||||
dstScalar = new Scalar(vals);
|
||||
|
||||
Scalar truth = new Scalar(2.0, 4.0, 5.0, 3.0);
|
||||
assertEquals(truth, dstScalar);
|
||||
}
|
||||
|
||||
public void testScalarDoubleDouble() {
|
||||
fail("Not yet implemented");
|
||||
dstScalar = new Scalar(2, 5);
|
||||
Scalar truth = new Scalar(2.0, 5.0, 0.0, 0.0);
|
||||
assertEquals(truth, dstScalar);
|
||||
}
|
||||
|
||||
public void testScalarDoubleDoubleDouble() {
|
||||
fail("Not yet implemented");
|
||||
dstScalar = new Scalar(2.0, 5.0, 5.0);
|
||||
Scalar truth = new Scalar(2.0, 5.0, 5.0, 0.0);
|
||||
assertEquals(truth, dstScalar);
|
||||
}
|
||||
|
||||
public void testScalarDoubleDoubleDoubleDouble() {
|
||||
fail("Not yet implemented");
|
||||
dstScalar = new Scalar(2.0, 5.0, 5.0, 9.0);
|
||||
Scalar truth = new Scalar(2.0, 5.0, 5.0, 9.0);
|
||||
assertEquals(truth, dstScalar);
|
||||
}
|
||||
|
||||
public void testSet() {
|
||||
fail("Not yet implemented");
|
||||
double[] vals = { 1.0, 1.0, 1.0, 1.0 };
|
||||
s1.set(vals);
|
||||
assertEquals(s2, s1);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,43 +1,83 @@
|
||||
package org.opencv.test.core;
|
||||
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Size;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class SizeTest extends OpenCVTestCase {
|
||||
|
||||
Size sz1;
|
||||
Size sz2;
|
||||
Size dstSize;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
sz1 = new Size(10.0, 10.0);
|
||||
sz2 = new Size(-1, -1);
|
||||
dstSize = null;
|
||||
}
|
||||
|
||||
public void testArea() {
|
||||
fail("Not yet implemented");
|
||||
double area = sz1.area();
|
||||
assertEquals(100.0, area);
|
||||
}
|
||||
|
||||
public void testClone() {
|
||||
fail("Not yet implemented");
|
||||
dstSize = sz1.clone();
|
||||
assertEquals(sz1, dstSize);
|
||||
}
|
||||
|
||||
public void testEqualsObject() {
|
||||
fail("Not yet implemented");
|
||||
assertFalse(sz1.equals(sz2));
|
||||
|
||||
sz2 = sz1.clone();
|
||||
assertTrue(sz1.equals(sz2));
|
||||
}
|
||||
|
||||
public void testSet() {
|
||||
fail("Not yet implemented");
|
||||
double[] vals1 = {};
|
||||
sz2.set(vals1);
|
||||
assertEquals(0., sz2.width);
|
||||
assertEquals(0., sz2.height);
|
||||
|
||||
double[] vals2 = { 9, 12 };
|
||||
sz1 .set(vals2);
|
||||
assertEquals(9., sz1.width);
|
||||
assertEquals(12., sz1.height);
|
||||
}
|
||||
|
||||
public void testSize() {
|
||||
fail("Not yet implemented");
|
||||
dstSize = new Size();
|
||||
|
||||
assertNotNull(dstSize);
|
||||
assertEquals(0., dstSize.width);
|
||||
assertEquals(0., dstSize.height);
|
||||
}
|
||||
|
||||
public void testSizeDoubleArray() {
|
||||
fail("Not yet implemented");
|
||||
double[] vals = { 10, 20 };
|
||||
sz2 = new Size(vals);
|
||||
|
||||
assertEquals(10., sz2.width);
|
||||
assertEquals(20., sz2.height);
|
||||
}
|
||||
|
||||
public void testSizeDoubleDouble() {
|
||||
fail("Not yet implemented");
|
||||
assertNotNull(sz1);
|
||||
|
||||
assertEquals(10.0, sz1.width);
|
||||
assertEquals(10.0, sz1.height);
|
||||
}
|
||||
|
||||
public void testSizePoint() {
|
||||
fail("Not yet implemented");
|
||||
Point p = new Point(2, 4);
|
||||
sz1 = new Size(p);
|
||||
|
||||
assertNotNull(sz1);
|
||||
assertEquals(2.0, sz1.width);
|
||||
assertEquals(4.0, sz1.height);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,39 +1,81 @@
|
||||
package org.opencv.test.core;
|
||||
|
||||
import org.opencv.core.TermCriteria;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class TermCriteriaTest extends OpenCVTestCase {
|
||||
|
||||
private TermCriteria tc1;
|
||||
private TermCriteria tc2;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
tc1 = new TermCriteria();
|
||||
tc2 = new TermCriteria(2, 4, EPS);
|
||||
}
|
||||
|
||||
public void testClone() {
|
||||
fail("Not yet implemented");
|
||||
tc1 = tc2.clone();
|
||||
assertEquals(tc2, tc1);
|
||||
}
|
||||
|
||||
public void testEqualsObject() {
|
||||
fail("Not yet implemented");
|
||||
assertFalse(tc2.equals(tc1));
|
||||
|
||||
tc1 = tc2.clone();
|
||||
assertTrue(tc2.equals(tc1));
|
||||
}
|
||||
|
||||
public void testSet() {
|
||||
fail("Not yet implemented");
|
||||
double[] vals1 = {};
|
||||
tc1.set(vals1);
|
||||
|
||||
assertEquals(0, tc1.type);
|
||||
assertEquals(0, tc1.maxCount);
|
||||
assertEquals(0.0, tc1.epsilon);
|
||||
|
||||
double[] vals2 = { 9, 8, 0.002 };
|
||||
tc2.set(vals2);
|
||||
|
||||
assertEquals(9, tc2.type);
|
||||
assertEquals(8, tc2.maxCount);
|
||||
assertEquals(0.002, tc2.epsilon);
|
||||
}
|
||||
|
||||
public void testTermCriteria() {
|
||||
fail("Not yet implemented");
|
||||
tc1 = new TermCriteria();
|
||||
|
||||
assertNotNull(tc1);
|
||||
assertEquals(0, tc1.type);
|
||||
assertEquals(0, tc1.maxCount);
|
||||
assertEquals(0.0, tc1.epsilon);
|
||||
}
|
||||
|
||||
public void testTermCriteriaDoubleArray() {
|
||||
fail("Not yet implemented");
|
||||
double[] vals = { 3, 2, 0.007 };
|
||||
tc1 = new TermCriteria(vals);
|
||||
|
||||
assertEquals(3, tc1.type);
|
||||
assertEquals(2, tc1.maxCount);
|
||||
assertEquals(0.007, tc1.epsilon);
|
||||
}
|
||||
|
||||
public void testTermCriteriaIntIntDouble() {
|
||||
fail("Not yet implemented");
|
||||
tc1 = new TermCriteria(2, 4, EPS);
|
||||
|
||||
assertNotNull(tc2);
|
||||
assertEquals(2, tc2.type);
|
||||
assertEquals(4, tc2.maxCount);
|
||||
assertEquals(EPS, tc2.epsilon);
|
||||
}
|
||||
|
||||
public void testToString() {
|
||||
fail("Not yet implemented");
|
||||
String actual = tc2.toString();
|
||||
String expected = "{ type: 2, maxCount: 4, epsilon: 0.001}";
|
||||
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -151,8 +151,7 @@ public class coreTest extends OpenCVTestCase {
|
||||
|
||||
public void testCheckRangeMat() {
|
||||
Mat outOfRange = new Mat(2, 2, CvType.CV_64F);
|
||||
outOfRange.put(0, 0, Double.NaN, Double.NEGATIVE_INFINITY,
|
||||
Double.POSITIVE_INFINITY, 0);
|
||||
outOfRange.put(0, 0, Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, 0);
|
||||
|
||||
assertTrue(Core.checkRange(grayRnd_32f));
|
||||
assertTrue(Core.checkRange(new Mat()));
|
||||
@ -161,8 +160,7 @@ public class coreTest extends OpenCVTestCase {
|
||||
|
||||
public void testCheckRangeMatBoolean() {
|
||||
Mat outOfRange = new Mat(2, 2, CvType.CV_64F);
|
||||
outOfRange.put(0, 0, Double.NaN, Double.NEGATIVE_INFINITY,
|
||||
Double.POSITIVE_INFINITY, 0);
|
||||
outOfRange.put(0, 0, Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, 0);
|
||||
|
||||
assertFalse(Core.checkRange(outOfRange, true));
|
||||
|
||||
@ -336,12 +334,10 @@ public class coreTest extends OpenCVTestCase {
|
||||
assertMatEqual(gray0_32f_1d, dst, EPS);
|
||||
|
||||
Mat in = new Mat(1, 8, CvType.CV_32F);
|
||||
in.put(0, 0, 0.203056, 0.980407, 0.35312, -0.106651, 0.0399382,
|
||||
0.871475, -0.648355, 0.501067);
|
||||
in.put(0, 0, 0.203056, 0.980407, 0.35312, -0.106651, 0.0399382, 0.871475, -0.648355, 0.501067);
|
||||
|
||||
truth = new Mat(1, 8, CvType.CV_32F);
|
||||
truth.put(0, 0, 0.77571625, 0.37270021, 0.18529896, 0.012146413,
|
||||
-0.32499927, -0.99302113, 0.55979407, -0.6251272);
|
||||
truth.put(0, 0, 0.77571625, 0.37270021, 0.18529896, 0.012146413, -0.32499927, -0.99302113, 0.55979407, -0.6251272);
|
||||
|
||||
Core.dct(in, dst);
|
||||
assertMatEqual(truth, dst, EPS);
|
||||
@ -476,10 +472,10 @@ public class coreTest extends OpenCVTestCase {
|
||||
|
||||
public void testFillConvexPolyMatMatScalar() {
|
||||
List<Point> lp = new ArrayList<Point>(4);
|
||||
lp.add( new Point(1, 1) );
|
||||
lp.add( new Point(5, 0) );
|
||||
lp.add( new Point(6, 8) );
|
||||
lp.add( new Point(0, 9) );
|
||||
lp.add(new Point(1, 1));
|
||||
lp.add(new Point(5, 0));
|
||||
lp.add(new Point(6, 8));
|
||||
lp.add(new Point(0, 9));
|
||||
Mat points = Converters.vector_Point_to_Mat(lp);
|
||||
assertTrue(0 == Core.countNonZero(gray0));
|
||||
|
||||
@ -492,10 +488,10 @@ public class coreTest extends OpenCVTestCase {
|
||||
|
||||
public void testFillConvexPolyMatMatScalarInt() {
|
||||
List<Point> lp = new ArrayList<Point>(4);
|
||||
lp.add( new Point(1, 1) );
|
||||
lp.add( new Point(5, 0) );
|
||||
lp.add( new Point(6, 8) );
|
||||
lp.add( new Point(0, 9) );
|
||||
lp.add(new Point(1, 1));
|
||||
lp.add(new Point(5, 0));
|
||||
lp.add(new Point(6, 8));
|
||||
lp.add(new Point(0, 9));
|
||||
Mat points = Converters.vector_Point_to_Mat(lp);
|
||||
assertTrue(0 == Core.countNonZero(gray0));
|
||||
|
||||
@ -508,16 +504,16 @@ public class coreTest extends OpenCVTestCase {
|
||||
|
||||
public void testFillConvexPolyMatMatScalarIntInt() {
|
||||
List<Point> lp = new ArrayList<Point>(4);
|
||||
lp.add( new Point(1, 1) );
|
||||
lp.add( new Point(5, 1) );
|
||||
lp.add( new Point(5, 8) );
|
||||
lp.add( new Point(1, 8) );
|
||||
lp.add(new Point(1, 1));
|
||||
lp.add(new Point(5, 1));
|
||||
lp.add(new Point(5, 8));
|
||||
lp.add(new Point(1, 8));
|
||||
Mat points = Converters.vector_Point_to_Mat(lp);
|
||||
List<Point> lp2 = new ArrayList<Point>(4);
|
||||
lp2.add( new Point(2, 2) );
|
||||
lp2.add( new Point(10, 2) );
|
||||
lp2.add( new Point(10, 17) ); //TODO: don't know why '16' fails the test
|
||||
lp2.add( new Point(2, 17) ); //TODO: don't know why '16' fails the test
|
||||
lp2.add(new Point(2, 2));
|
||||
lp2.add(new Point(10, 2));
|
||||
lp2.add(new Point(10, 17)); // TODO: don't know why '16' fails the test
|
||||
lp2.add(new Point(2, 17)); // TODO: don't know why '16' fails the test
|
||||
Mat points2 = Converters.vector_Point_to_Mat(lp2);
|
||||
assertTrue(0 == Core.countNonZero(gray0));
|
||||
|
||||
@ -654,8 +650,7 @@ public class coreTest extends OpenCVTestCase {
|
||||
in.put(0, 0, 1.0, 2.0, 1.0, 0.0, 1.0, 2.0, 3.0, 1.0);
|
||||
|
||||
truth = new Mat(1, 8, CvType.CV_32F);
|
||||
truth.put(0, 0, 3.3769724, -1.6215782, 2.3608727, 0.20730907,
|
||||
-0.86502546, 0.028082132, -0.7673766, 0.10917115);
|
||||
truth.put(0, 0, 3.3769724, -1.6215782, 2.3608727, 0.20730907, -0.86502546, 0.028082132, -0.7673766, 0.10917115);
|
||||
|
||||
Core.idct(in, dst);
|
||||
assertMatEqual(truth, dst, EPS);
|
||||
@ -666,8 +661,7 @@ public class coreTest extends OpenCVTestCase {
|
||||
in.put(0, 0, 1.0, 2.0, 1.0, 0.0, 1.0, 2.0, 3.0, 1.0);
|
||||
|
||||
truth = new Mat(1, 8, CvType.CV_32F);
|
||||
truth.put(0, 0, 3.3769724, -1.6215782, 2.3608727, 0.20730907,
|
||||
-0.86502546, 0.028082132, -0.7673766, 0.10917115);
|
||||
truth.put(0, 0, 3.3769724, -1.6215782, 2.3608727, 0.20730907, -0.86502546, 0.028082132, -0.7673766, 0.10917115);
|
||||
|
||||
Core.idct(in, dst, Core.DCT_ROWS);
|
||||
assertMatEqual(truth, dst, EPS);
|
||||
@ -900,8 +894,7 @@ public class coreTest extends OpenCVTestCase {
|
||||
assertEquals(0, Core.countNonZero(mean));
|
||||
assertEquals(0, Core.countNonZero(stddev));
|
||||
|
||||
Mat submat = grayRnd.submat(0, grayRnd.rows() / 2, 0,
|
||||
grayRnd.cols() / 2);
|
||||
Mat submat = grayRnd.submat(0, grayRnd.rows() / 2, 0, grayRnd.cols() / 2);
|
||||
submat.setTo(new Scalar(33));
|
||||
|
||||
Mat mask = gray0.clone();
|
||||
@ -971,10 +964,14 @@ public class coreTest extends OpenCVTestCase {
|
||||
dst.add(gray0);
|
||||
|
||||
List<Integer> fromTo = new ArrayList<Integer>(8);
|
||||
fromTo.add(0); fromTo.add(3);
|
||||
fromTo.add(1); fromTo.add(2);
|
||||
fromTo.add(2); fromTo.add(1);
|
||||
fromTo.add(3); fromTo.add(0);
|
||||
fromTo.add(0);
|
||||
fromTo.add(3);
|
||||
fromTo.add(1);
|
||||
fromTo.add(2);
|
||||
fromTo.add(2);
|
||||
fromTo.add(1);
|
||||
fromTo.add(3);
|
||||
fromTo.add(0);
|
||||
|
||||
Core.mixChannels(src, dst, fromTo);
|
||||
|
||||
@ -1158,7 +1155,7 @@ public class coreTest extends OpenCVTestCase {
|
||||
|
||||
Core.randu(src, 0, 256);
|
||||
|
||||
//FIXME: use Mat.diag
|
||||
// FIXME: use Mat.diag
|
||||
Mat transformMatrix = Mat.eye(3, 3, CvType.CV_32F);
|
||||
|
||||
Core.perspectiveTransform(src, dst, transformMatrix);
|
||||
@ -1233,7 +1230,7 @@ public class coreTest extends OpenCVTestCase {
|
||||
pts.add(new Point(7, 6));
|
||||
pts.add(new Point(1, 6));
|
||||
List<Mat> mats = new ArrayList<Mat>();
|
||||
mats.add( Converters.vector_Point_to_Mat(pts) );
|
||||
mats.add(Converters.vector_Point_to_Mat(pts));
|
||||
|
||||
assertEquals(0, Core.countNonZero(img));
|
||||
Core.polylines(img, mats, true, new Scalar(100));
|
||||
@ -1250,7 +1247,7 @@ public class coreTest extends OpenCVTestCase {
|
||||
pts.add(new Point(7, 6));
|
||||
pts.add(new Point(1, 6));
|
||||
List<Mat> mats = new ArrayList<Mat>();
|
||||
mats.add( Converters.vector_Point_to_Mat(pts) );
|
||||
mats.add(Converters.vector_Point_to_Mat(pts));
|
||||
|
||||
assertEquals(0, Core.countNonZero(img));
|
||||
Core.polylines(img, mats, true, new Scalar(100), 2);
|
||||
@ -1261,14 +1258,18 @@ public class coreTest extends OpenCVTestCase {
|
||||
Mat img = gray0;
|
||||
List<Point> pts = new ArrayList<Point>();
|
||||
List<Point> pts2 = new ArrayList<Point>();
|
||||
pts.add(new Point(1, 1)); pts2.add(new Point(2, 2));
|
||||
pts.add(new Point(7, 1)); pts2.add(new Point(14, 2));
|
||||
pts.add(new Point(7, 6)); pts2.add(new Point(14, 12));
|
||||
pts.add(new Point(1, 6)); pts2.add(new Point(2, 12));
|
||||
pts.add(new Point(1, 1));
|
||||
pts2.add(new Point(2, 2));
|
||||
pts.add(new Point(7, 1));
|
||||
pts2.add(new Point(14, 2));
|
||||
pts.add(new Point(7, 6));
|
||||
pts2.add(new Point(14, 12));
|
||||
pts.add(new Point(1, 6));
|
||||
pts2.add(new Point(2, 12));
|
||||
List<Mat> mats = new ArrayList<Mat>();
|
||||
List<Mat> mats2 = new ArrayList<Mat>();
|
||||
mats.add( Converters.vector_Point_to_Mat(pts) );
|
||||
mats2.add( Converters.vector_Point_to_Mat(pts2) );
|
||||
mats.add(Converters.vector_Point_to_Mat(pts));
|
||||
mats2.add(Converters.vector_Point_to_Mat(pts2));
|
||||
|
||||
assertTrue(0 == Core.countNonZero(img));
|
||||
Core.polylines(img, mats, true, new Scalar(100), 2, 8, 0);
|
||||
@ -1584,8 +1585,7 @@ public class coreTest extends OpenCVTestCase {
|
||||
Mat subgray0 = gray0.submat(0, gray0.rows() / 2, 0, gray0.cols());
|
||||
Mat destination = new Mat(matSize, matSize, CvType.CV_8U);
|
||||
destination.setTo(new Scalar(0));
|
||||
Mat subdst = destination.submat(0, destination.rows(), 0,
|
||||
destination.cols() / 2);
|
||||
Mat subdst = destination.submat(0, destination.rows(), 0, destination.cols() / 2);
|
||||
subgray0.setTo(new Scalar(1));
|
||||
Core.transpose(gray0, destination);
|
||||
assertTrue(subdst.total() == Core.countNonZero(subdst));
|
||||
|
@ -52,14 +52,17 @@ public class KeyPointTest extends OpenCVTestCase {
|
||||
keyPoint = new KeyPoint();
|
||||
assertTrue(null != keyPoint);
|
||||
}
|
||||
|
||||
public void testKeyPointFloatFloatFloat() {
|
||||
keyPoint = new KeyPoint(x, y, size);
|
||||
assertTrue(null != keyPoint);
|
||||
}
|
||||
|
||||
public void testKeyPointFloatFloatFloatFloat() {
|
||||
keyPoint = new KeyPoint(x, y, size, 10.0f);
|
||||
assertTrue(null != keyPoint);
|
||||
}
|
||||
|
||||
public void testKeyPointFloatFloatFloatFloatFloat() {
|
||||
keyPoint = new KeyPoint(x, y, size, 1.0f, 1.0f);
|
||||
assertTrue(null != keyPoint);
|
||||
|
@ -28,25 +28,18 @@ public class SURFTest extends OpenCVTestCase {
|
||||
protected void setUp() throws Exception {
|
||||
matSize = 100;
|
||||
|
||||
truth = new KeyPoint[] {
|
||||
new KeyPoint(55.775577545166016f, 44.224422454833984f, 16,
|
||||
9.754629f, 8617.863f, 1, -1),
|
||||
new KeyPoint(44.224422454833984f, 44.224422454833984f, 16,
|
||||
99.75463f, 8617.863f, 1, -1),
|
||||
new KeyPoint(44.224422454833984f, 55.775577545166016f, 16,
|
||||
189.7546f, 8617.863f, 1, -1),
|
||||
new KeyPoint(55.775577545166016f, 55.775577545166016f, 16,
|
||||
279.75464f, 8617.863f, 1, -1) };
|
||||
truth = new KeyPoint[] { new KeyPoint(55.775577545166016f, 44.224422454833984f, 16, 9.754629f, 8617.863f, 1, -1),
|
||||
new KeyPoint(44.224422454833984f, 44.224422454833984f, 16, 99.75463f, 8617.863f, 1, -1),
|
||||
new KeyPoint(44.224422454833984f, 55.775577545166016f, 16, 189.7546f, 8617.863f, 1, -1),
|
||||
new KeyPoint(55.775577545166016f, 55.775577545166016f, 16, 279.75464f, 8617.863f, 1, -1) };
|
||||
|
||||
super.setUp();
|
||||
}
|
||||
|
||||
private Mat getCross() {
|
||||
Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255));
|
||||
Core.line(cross, new Point(20, matSize / 2), new Point(matSize - 21,
|
||||
matSize / 2), new Scalar(100), 2);
|
||||
Core.line(cross, new Point(matSize / 2, 20), new Point(matSize / 2,
|
||||
matSize - 21), new Scalar(100), 2);
|
||||
Core.line(cross, new Point(20, matSize / 2), new Point(matSize - 21, matSize / 2), new Scalar(100), 2);
|
||||
Core.line(cross, new Point(matSize / 2, 20), new Point(matSize / 2, matSize - 21), new Scalar(100), 2);
|
||||
|
||||
return cross;
|
||||
}
|
||||
@ -124,12 +117,10 @@ public class SURFTest extends OpenCVTestCase {
|
||||
// unmodified keypoints
|
||||
assertEquals(original_keypoints.size(), keypoints.size());
|
||||
for (int i = 0; i < keypoints.size(); i++)
|
||||
assertKeyPointEqual(original_keypoints.get(i), keypoints.get(i),
|
||||
EPS);
|
||||
assertKeyPointEqual(original_keypoints.get(i), keypoints.get(i), EPS);
|
||||
|
||||
// zero descriptors
|
||||
assertEquals(surf.descriptorSize() * original_keypoints.size(),
|
||||
descriptors.size());
|
||||
assertEquals(surf.descriptorSize() * original_keypoints.size(), descriptors.size());
|
||||
for (float d : descriptors)
|
||||
assertTrue(Math.abs(d) < EPS);
|
||||
}
|
||||
|
@ -18,8 +18,7 @@ public class StarDetectorTest extends OpenCVTestCase {
|
||||
super.test_1("FEATURES2D.StarDetector");
|
||||
}
|
||||
|
||||
private Mat getStarImg()
|
||||
{
|
||||
private Mat getStarImg() {
|
||||
Scalar color = new Scalar(0);
|
||||
int center = 100;
|
||||
int radius = 5;
|
||||
@ -41,7 +40,7 @@ public class StarDetectorTest extends OpenCVTestCase {
|
||||
|
||||
star.detect(img, keypoints);
|
||||
|
||||
KeyPoint truth = new KeyPoint(100, 100, 8, -1,-223.40334f, 0, -1);
|
||||
KeyPoint truth = new KeyPoint(100, 100, 8, -1, -223.40334f, 0, -1);
|
||||
assertEquals(1, keypoints.size());
|
||||
assertKeyPointEqual(truth, keypoints.get(0), EPS);
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ import org.opencv.highgui.VideoCapture;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
|
||||
public class VideoCaptureTest extends OpenCVTestCase {
|
||||
|
||||
private VideoCapture capture;
|
||||
@ -97,7 +96,7 @@ public class VideoCaptureTest extends OpenCVTestCase {
|
||||
capture.release();
|
||||
assertTrue(isSucceed);
|
||||
assertFalse(dst.empty());
|
||||
//OpenCVTestRunner.Log(dst.toString());
|
||||
// OpenCVTestRunner.Log(dst.toString());
|
||||
assertEquals(1, dst.channels());
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,6 @@ import org.opencv.highgui.Highgui;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.test.OpenCVTestRunner;
|
||||
|
||||
|
||||
public class highguiTest extends OpenCVTestCase {
|
||||
|
||||
public void testImreadString() {
|
||||
|
@ -3,7 +3,6 @@ package org.opencv.test.imgproc;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.opencv.Converters;
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Mat;
|
||||
@ -17,7 +16,6 @@ import org.opencv.imgproc.Imgproc;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.test.OpenCVTestRunner;
|
||||
|
||||
|
||||
public class imgprocTest extends OpenCVTestCase {
|
||||
|
||||
private Mat gray_64f_2;
|
||||
@ -55,7 +53,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
}
|
||||
|
||||
public void testAccumulateMatMatMat() {
|
||||
Imgproc.accumulate(gray_64f_2, dst64F, mask); //TODO: use better mask
|
||||
Imgproc.accumulate(gray_64f_2, dst64F, mask); // TODO: use better mask
|
||||
truth = new Mat(imgprocSz, imgprocSz, CvType.CV_64F, new Scalar(2));
|
||||
assertMatEqual(truth, dst64F, EPS);
|
||||
}
|
||||
@ -120,8 +118,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
}
|
||||
|
||||
public void testAdaptiveThreshold() {
|
||||
Imgproc.adaptiveThreshold(gray0, dst, 2.0,
|
||||
Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C, Imgproc.THRESH_BINARY, 3, 0);
|
||||
Imgproc.adaptiveThreshold(gray0, dst, 2.0, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C, Imgproc.THRESH_BINARY, 3, 0);
|
||||
assertMatEqual(gray0, dst);
|
||||
}
|
||||
|
||||
@ -151,8 +148,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
}
|
||||
|
||||
public void testBilateralFilterMatMatIntDoubleDoubleInt() {
|
||||
Imgproc.bilateralFilter(gray255, dst, 5, 10.0, 5.0,
|
||||
Imgproc.BORDER_REFLECT);
|
||||
Imgproc.bilateralFilter(gray255, dst, 5, 10.0, 5.0, Imgproc.BORDER_REFLECT);
|
||||
assertMatEqual(gray255, dst);
|
||||
}
|
||||
|
||||
@ -175,8 +171,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
}
|
||||
|
||||
public void testBorderInterpolate() {
|
||||
float val1 = Imgproc.borderInterpolate(100, 150,
|
||||
Imgproc.BORDER_REFLECT_101);
|
||||
float val1 = Imgproc.borderInterpolate(100, 150, Imgproc.BORDER_REFLECT_101);
|
||||
assertEquals(100.0f, val1);
|
||||
|
||||
float val2 = Imgproc.borderInterpolate(-5, 10, Imgproc.BORDER_WRAP);
|
||||
@ -212,8 +207,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
}
|
||||
|
||||
public void testBoxFilterMatMatIntSizePointBooleanInt() {
|
||||
Imgproc.boxFilter(gray255, dst, 8, size, anchorPoint, false,
|
||||
Imgproc.BORDER_REFLECT);
|
||||
Imgproc.boxFilter(gray255, dst, 8, size, anchorPoint, false, Imgproc.BORDER_REFLECT);
|
||||
assertMatEqual(gray255, dst);
|
||||
}
|
||||
|
||||
@ -310,8 +304,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
|
||||
truth = new Mat(10, 10, CvType.CV_32F, Scalar.all(0.0));
|
||||
truth.put(9, 5, 100.0);
|
||||
Imgproc.calcHist(images, channels, new Mat(), hist, histSize, ranges,
|
||||
true);
|
||||
Imgproc.calcHist(images, channels, new Mat(), hist, histSize, ranges, true);
|
||||
assertMatEqual(truth, hist, EPS);
|
||||
}
|
||||
|
||||
@ -363,7 +356,6 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
Mat dstmap1 = new Mat(1, 4, CvType.CV_16SC2);
|
||||
Mat dstmap2 = new Mat(1, 4, CvType.CV_16UC1);
|
||||
|
||||
|
||||
Imgproc.convertMaps(map1, map2, dstmap1, dstmap2, CvType.CV_16SC2);
|
||||
Mat truthMap1 = new Mat(1, 4, CvType.CV_16SC2);
|
||||
truthMap1.put(0, 0, 1, 2, 1, 2, 1, 2, 1, 2);
|
||||
@ -379,7 +371,6 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
Mat dstmap1 = new Mat(1, 3, CvType.CV_16SC2);
|
||||
Mat dstmap2 = new Mat(1, 3, CvType.CV_16UC1);
|
||||
|
||||
|
||||
Imgproc.convertMaps(map1, map2, dstmap1, dstmap2, CvType.CV_16SC2, false);
|
||||
Mat truthMap1 = new Mat(1, 3, CvType.CV_16SC2);
|
||||
truthMap1.put(0, 0, 2, 4, 2, 4, 2, 4);
|
||||
@ -391,8 +382,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
|
||||
public void testConvexHullMatMat() {
|
||||
Mat points = new Mat(1, 6, CvType.CV_32FC2);
|
||||
points.put(0, 0, 2.0, 0.0, 4.0, 0.0, 3.0, 2.0, 0.0, 2.0, 2.0, 1.0, 3.0,
|
||||
1.0);
|
||||
points.put(0, 0, 2.0, 0.0, 4.0, 0.0, 3.0, 2.0, 0.0, 2.0, 2.0, 1.0, 3.0, 1.0);
|
||||
|
||||
Mat expHull = new Mat(4, 1, CvType.CV_32FC2);
|
||||
expHull.put(0, 0, 4, 0, 3, 2, 0, 2, 2, 0);
|
||||
@ -403,8 +393,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
|
||||
public void testConvexHullMatMatBoolean() {
|
||||
Mat points = new Mat(1, 6, CvType.CV_32FC2);
|
||||
points.put(0, 0, 2.0, 0.0, 4.0, 0.0, 3.0, 2.0, 0.0, 2.0, 2.0, 1.0, 3.0,
|
||||
1.0);
|
||||
points.put(0, 0, 2.0, 0.0, 4.0, 0.0, 3.0, 2.0, 0.0, 2.0, 2.0, 1.0, 3.0, 1.0);
|
||||
|
||||
Mat expHull = new Mat(4, 1, CvType.CV_32FC2);
|
||||
expHull.put(0, 0, 0, 2, 3, 2, 4, 0, 2, 0);
|
||||
@ -415,8 +404,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
|
||||
public void testConvexHullMatMatBooleanBoolean() {
|
||||
Mat points = new Mat(1, 6, CvType.CV_32FC2);
|
||||
points.put(0, 0, 2.0, 0.0, 4.0, 0.0, 3.0, 2.0, 0.0, 2.0, 2.0, 1.0, 3.0,
|
||||
1.0);
|
||||
points.put(0, 0, 2.0, 0.0, 4.0, 0.0, 3.0, 2.0, 0.0, 2.0, 2.0, 1.0, 3.0, 1.0);
|
||||
|
||||
Mat expHull = new Mat(4, 1, CvType.CV_32FC2);
|
||||
expHull.put(0, 0, 0, 2, 3, 2, 4, 0, 2, 0);
|
||||
@ -430,8 +418,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
truth = new Mat(6, 6, CvType.CV_32F, new Scalar(1));
|
||||
int border = 2;
|
||||
|
||||
Imgproc.copyMakeBorder(src, dst, border, border, border, border,
|
||||
Imgproc.BORDER_REPLICATE);
|
||||
Imgproc.copyMakeBorder(src, dst, border, border, border, border, Imgproc.BORDER_REPLICATE);
|
||||
assertMatEqual(truth, dst, EPS);
|
||||
}
|
||||
|
||||
@ -442,8 +429,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
Scalar value = new Scalar(0);
|
||||
int border = 2;
|
||||
|
||||
Imgproc.copyMakeBorder(src, dst, border, border, border, border,
|
||||
Imgproc.BORDER_REPLICATE, value);
|
||||
Imgproc.copyMakeBorder(src, dst, border, border, border, border, Imgproc.BORDER_REPLICATE, value);
|
||||
assertMatEqual(truth, dst, EPS);
|
||||
}
|
||||
|
||||
@ -469,8 +455,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
|
||||
truth = new Mat(4, 4, CvType.CV_32FC(6), new Scalar(0));
|
||||
|
||||
Imgproc.cornerEigenValsAndVecs(src, dst, blockSize, ksize,
|
||||
Imgproc.BORDER_REFLECT);
|
||||
Imgproc.cornerEigenValsAndVecs(src, dst, blockSize, ksize, Imgproc.BORDER_REFLECT);
|
||||
assertMatEqual(truth, dst, EPS);
|
||||
}
|
||||
|
||||
@ -488,8 +473,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
int blockSize = 5;
|
||||
int ksize = 7;
|
||||
double k = 0.1;
|
||||
Imgproc.cornerHarris(gray255, dst, blockSize, ksize, k,
|
||||
Imgproc.BORDER_REFLECT);
|
||||
Imgproc.cornerHarris(gray255, dst, blockSize, ksize, k, Imgproc.BORDER_REFLECT);
|
||||
assertMatEqual(truth, dst, EPS);
|
||||
}
|
||||
|
||||
@ -594,8 +578,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
public void testDilateMatMatMatPointIntInt() {
|
||||
Mat kernel = new Mat();
|
||||
|
||||
Imgproc.dilate(gray255, dst, kernel, anchorPoint, 10,
|
||||
Imgproc.BORDER_REFLECT);
|
||||
Imgproc.dilate(gray255, dst, kernel, anchorPoint, 10, Imgproc.BORDER_REFLECT);
|
||||
assertMatEqual(gray255, dst);
|
||||
}
|
||||
|
||||
@ -603,15 +586,13 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
Mat kernel = new Mat();
|
||||
Scalar value = new Scalar(0);
|
||||
|
||||
Imgproc.dilate(gray255, dst, kernel, anchorPoint, 10,
|
||||
Imgproc.BORDER_REFLECT, value);
|
||||
Imgproc.dilate(gray255, dst, kernel, anchorPoint, 10, Imgproc.BORDER_REFLECT, value);
|
||||
assertMatEqual(gray255, dst);
|
||||
}
|
||||
|
||||
public void testDistanceTransform() {
|
||||
truth = new Mat(matSize, matSize, CvType.CV_32FC1, new Scalar(8192));
|
||||
Mat dstLables = new Mat(matSize, matSize, CvType.CV_32SC1,
|
||||
new Scalar(0));
|
||||
Mat dstLables = new Mat(matSize, matSize, CvType.CV_32SC1, new Scalar(0));
|
||||
|
||||
Mat labels = new Mat();
|
||||
Imgproc.distanceTransform(gray128, dst, labels, Imgproc.CV_DIST_L2, 3);
|
||||
@ -714,15 +695,13 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
Mat kernel = new Mat();
|
||||
Scalar sc = new Scalar(3, 3);
|
||||
|
||||
Imgproc.erode(src, dst, kernel, anchorPoint, 10,
|
||||
Imgproc.BORDER_REFLECT, sc);
|
||||
Imgproc.erode(src, dst, kernel, anchorPoint, 10, Imgproc.BORDER_REFLECT, sc);
|
||||
assertMatEqual(truth, dst);
|
||||
}
|
||||
|
||||
public void testFilter2DMatMatIntMat() {
|
||||
Mat src = Mat.eye(4, 4, CvType.CV_32F);
|
||||
Mat kernel = new Mat(imgprocSz, imgprocSz, CvType.CV_32F, new Scalar(
|
||||
1.0));
|
||||
Mat kernel = new Mat(imgprocSz, imgprocSz, CvType.CV_32F, new Scalar(1.0));
|
||||
|
||||
truth = Mat.eye(4, 4, CvType.CV_32F);
|
||||
truth.put(0, 0, 2, 2, 1, 0);
|
||||
@ -735,8 +714,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
}
|
||||
|
||||
public void testFilter2DMatMatIntMatPoint() {
|
||||
Mat kernel = new Mat(imgprocSz, imgprocSz, CvType.CV_32F, new Scalar(
|
||||
1.0));
|
||||
Mat kernel = new Mat(imgprocSz, imgprocSz, CvType.CV_32F, new Scalar(1.0));
|
||||
Point point = new Point(0, 0);
|
||||
|
||||
Imgproc.filter2D(gray128, dst, -1, kernel, point);
|
||||
@ -744,12 +722,10 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
}
|
||||
|
||||
public void testFilter2DMatMatIntMatPointDoubleInt() {
|
||||
Mat kernel = new Mat(imgprocSz, imgprocSz, CvType.CV_32F, new Scalar(
|
||||
0.0));
|
||||
Mat kernel = new Mat(imgprocSz, imgprocSz, CvType.CV_32F, new Scalar(0.0));
|
||||
Point point = new Point(0, 0);
|
||||
|
||||
Imgproc.filter2D(gray128, dst, -1, kernel, point, 2.0,
|
||||
Imgproc.BORDER_CONSTANT);
|
||||
Imgproc.filter2D(gray128, dst, -1, kernel, point, 2.0, Imgproc.BORDER_CONSTANT);
|
||||
assertMatEqual(gray2, dst);
|
||||
}
|
||||
|
||||
@ -763,7 +739,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
assertEquals(contours.size(), 0);
|
||||
assertEquals(contours.size(), hierarchy.total());
|
||||
|
||||
Core.rectangle(img, new Point(10, 20), new Point(20, 30), new Scalar(100), 3, 16 /*CV_AA*/);
|
||||
Core.rectangle(img, new Point(10, 20), new Point(20, 30), new Scalar(100), 3, 16 /* CV_AA */);
|
||||
Core.rectangle(img, new Point(30, 35), new Point(40, 45), new Scalar(200));
|
||||
|
||||
Imgproc.findContours(img, contours, hierarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE);
|
||||
@ -779,7 +755,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
List<Mat> contours2 = new ArrayList<Mat>();
|
||||
Mat hierarchy = dst;
|
||||
|
||||
Core.rectangle(img, new Point(10, 20), new Point(20, 30), new Scalar(100), 3, 16 /*CV_AA*/);
|
||||
Core.rectangle(img, new Point(10, 20), new Point(20, 30), new Scalar(100), 3, 16 /* CV_AA */);
|
||||
Core.rectangle(img, new Point(30, 35), new Point(40, 45), new Scalar(200));
|
||||
|
||||
Imgproc.findContours(img, contours, hierarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE);
|
||||
@ -790,7 +766,8 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
}
|
||||
|
||||
public void testFitEllipse() {
|
||||
Mat points = new Mat(1, 5, CvType.CV_32FC2); //TODO: use the list of Points
|
||||
Mat points = new Mat(1, 5, CvType.CV_32FC2); // TODO: use the list of
|
||||
// Points
|
||||
points.put(0, 0, 0.0, 0.0, -1.0, 1.0, 1.0, 1.0, 1.0, -1.0, -1.0, -1.0);
|
||||
|
||||
RotatedRect rrect = new RotatedRect();
|
||||
@ -829,7 +806,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
|
||||
assertEquals(retval + 4 * (matSize + 1), Core.countNonZero(mask));
|
||||
|
||||
assertMatEqual(mask.submat(1, matSize+1, 1, matSize+1), img);
|
||||
assertMatEqual(mask.submat(1, matSize + 1, 1, matSize + 1), img);
|
||||
}
|
||||
|
||||
public void testFloodFillMatMatPointScalar_WithoutMask() {
|
||||
@ -837,7 +814,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
|
||||
Core.circle(img, new Point(matSize / 2, matSize / 2), 3, new Scalar(2));
|
||||
|
||||
//TODO: ideally we should pass null instead of "new Mat()"
|
||||
// TODO: ideally we should pass null instead of "new Mat()"
|
||||
int retval = Imgproc.floodFill(img, new Mat(), new Point(matSize / 2, matSize / 2), new Scalar(1));
|
||||
|
||||
Core.circle(img, new Point(matSize / 2, matSize / 2), 3, new Scalar(0));
|
||||
@ -1025,8 +1002,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
truth.put(1, 0, 0, 0, 1);
|
||||
truth.put(2, 0, 1, 1, 1);
|
||||
|
||||
dst = Imgproc.getStructuringElement(Imgproc.MORPH_CROSS, size,
|
||||
anchorPoint);
|
||||
dst = Imgproc.getStructuringElement(Imgproc.MORPH_CROSS, size, anchorPoint);
|
||||
assertMatEqual(truth, dst);
|
||||
}
|
||||
|
||||
@ -1099,14 +1075,14 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
|
||||
Mat circles = new Mat();
|
||||
|
||||
Imgproc.HoughCircles(img, circles, Imgproc.CV_HOUGH_GRADIENT, 2.0, img.rows()/4);
|
||||
Imgproc.HoughCircles(img, circles, Imgproc.CV_HOUGH_GRADIENT, 2.0, img.rows() / 4);
|
||||
assertEquals(0, circles.cols());
|
||||
|
||||
Point center = new Point(img.cols()/2, img.rows()/2);
|
||||
int radius = Math.min(img.cols()/4, img.rows()/4);
|
||||
Point center = new Point(img.cols() / 2, img.rows() / 2);
|
||||
int radius = Math.min(img.cols() / 4, img.rows() / 4);
|
||||
Core.circle(img, center, radius, colorBlack, 3);
|
||||
|
||||
Imgproc.HoughCircles(img, circles, Imgproc.CV_HOUGH_GRADIENT, 2.0, img.rows()/4);
|
||||
Imgproc.HoughCircles(img, circles, Imgproc.CV_HOUGH_GRADIENT, 2.0, img.rows() / 4);
|
||||
assertEquals(1, circles.cols());
|
||||
}
|
||||
|
||||
@ -1167,9 +1143,8 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
Mat map1 = new Mat();
|
||||
Mat map2 = new Mat();
|
||||
|
||||
//TODO: complete this test
|
||||
Imgproc.initUndistortRectifyMap(cameraMatrix, distCoeffs,
|
||||
R, newCameraMatrix, size, CvType.CV_32F, map1, map2);
|
||||
// TODO: complete this test
|
||||
Imgproc.initUndistortRectifyMap(cameraMatrix, distCoeffs, R, newCameraMatrix, size, CvType.CV_32F, map1, map2);
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
@ -1381,8 +1356,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
Mat src = new Mat(3, 3, CvType.CV_32F, new Scalar(2.0));
|
||||
truth = new Mat(3, 3, CvType.CV_32F, new Scalar(0.00099945068));
|
||||
|
||||
Imgproc.Laplacian(src, dst, CvType.CV_32F, 1, 2.0, EPS,
|
||||
Imgproc.BORDER_REFLECT);
|
||||
Imgproc.Laplacian(src, dst, CvType.CV_32F, 1, 2.0, EPS, Imgproc.BORDER_REFLECT);
|
||||
assertMatEqual(truth, dst, EPS);
|
||||
}
|
||||
|
||||
@ -1440,7 +1414,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
OpenCVTestRunner.Log(points.dump());
|
||||
|
||||
Point actualCenter = new Point();
|
||||
float radius = 347.0f; //FIXME: Unexpected radius is returned i.e 0
|
||||
float radius = 347.0f; // FIXME: Unexpected radius is returned i.e 0
|
||||
Imgproc.minEnclosingCircle(points, actualCenter, radius);
|
||||
|
||||
Point truthCenter = new Point(0, 0);
|
||||
@ -1495,8 +1469,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
Mat kernel = new Mat(imgprocSz, imgprocSz, CvType.CV_8U, new Scalar(1));
|
||||
Point point = new Point(1, 1);
|
||||
|
||||
Imgproc.morphologyEx(src, dst, Imgproc.MORPH_TOPHAT, kernel, point, 10,
|
||||
Imgproc.BORDER_REFLECT);
|
||||
Imgproc.morphologyEx(src, dst, Imgproc.MORPH_TOPHAT, kernel, point, 10, Imgproc.BORDER_REFLECT);
|
||||
truth = new Mat(imgprocSz, imgprocSz, CvType.CV_8U);
|
||||
truth.put(0, 0, 1, 0);
|
||||
truth.put(1, 0, 1, 0);
|
||||
@ -1512,8 +1485,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
Point point = new Point(1, 1);
|
||||
Scalar sc = new Scalar(3, 3);
|
||||
|
||||
Imgproc.morphologyEx(src, dst, Imgproc.MORPH_TOPHAT, kernel, point, 10,
|
||||
Imgproc.BORDER_REFLECT, sc);
|
||||
Imgproc.morphologyEx(src, dst, Imgproc.MORPH_TOPHAT, kernel, point, 10, Imgproc.BORDER_REFLECT, sc);
|
||||
truth = new Mat(imgprocSz, imgprocSz, CvType.CV_8U);
|
||||
truth.put(0, 0, 1, 0);
|
||||
truth.put(1, 0, 1, 0);
|
||||
@ -1657,8 +1629,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
|
||||
truth = new Mat(1, 3, CvType.CV_32F, new Scalar(2));
|
||||
|
||||
Imgproc.remap(src, dst, map1, map2, Imgproc.INTER_LINEAR,
|
||||
Imgproc.BORDER_REFLECT);
|
||||
Imgproc.remap(src, dst, map1, map2, Imgproc.INTER_LINEAR, Imgproc.BORDER_REFLECT);
|
||||
assertMatEqual(truth, dst, EPS);
|
||||
}
|
||||
|
||||
@ -1674,8 +1645,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
|
||||
truth = new Mat(1, 3, CvType.CV_32F, new Scalar(2));
|
||||
|
||||
Imgproc.remap(src, dst, map1, map2, Imgproc.INTER_LINEAR,
|
||||
Imgproc.BORDER_REFLECT, sc);
|
||||
Imgproc.remap(src, dst, map1, map2, Imgproc.INTER_LINEAR, Imgproc.BORDER_REFLECT, sc);
|
||||
assertMatEqual(truth, dst, EPS);
|
||||
}
|
||||
|
||||
@ -1744,8 +1714,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
truth.put(1, 0, 10.5, 0, -10.5);
|
||||
truth.put(2, 0, 4.5, 19.5, 15);
|
||||
|
||||
Imgproc.Scharr(src, dst, CvType.CV_32F, 1, 0, 1.5, 0.0,
|
||||
Imgproc.BORDER_REFLECT);
|
||||
Imgproc.Scharr(src, dst, CvType.CV_32F, 1, 0, 1.5, 0.0, Imgproc.BORDER_REFLECT);
|
||||
assertMatEqual(truth, dst, EPS);
|
||||
}
|
||||
|
||||
@ -1763,8 +1732,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
}
|
||||
|
||||
public void testSepFilter2DMatMatIntMatMatPoint() {
|
||||
Mat src = new Mat(imgprocSz, imgprocSz, CvType.CV_32FC1,
|
||||
new Scalar(2.0));
|
||||
Mat src = new Mat(imgprocSz, imgprocSz, CvType.CV_32FC1, new Scalar(2.0));
|
||||
Mat kernelX = new Mat(1, 3, CvType.CV_32FC1);
|
||||
Mat kernelY = new Mat(1, 3, CvType.CV_32FC1);
|
||||
truth = new Mat(imgprocSz, imgprocSz, CvType.CV_32F, new Scalar(36.0));
|
||||
@ -1772,14 +1740,12 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
kernelX.put(0, 0, 2.0, 2.0, 2.0);
|
||||
kernelY.put(0, 0, 1.0, 1.0, 1.0);
|
||||
|
||||
Imgproc.sepFilter2D(src, dst, CvType.CV_32F, kernelX, kernelY,
|
||||
anchorPoint);
|
||||
Imgproc.sepFilter2D(src, dst, CvType.CV_32F, kernelX, kernelY, anchorPoint);
|
||||
assertMatEqual(truth, dst, EPS);
|
||||
}
|
||||
|
||||
public void testSepFilter2DMatMatIntMatMatPointDouble() {
|
||||
Mat src = new Mat(imgprocSz, imgprocSz, CvType.CV_32FC1,
|
||||
new Scalar(2.0));
|
||||
Mat src = new Mat(imgprocSz, imgprocSz, CvType.CV_32FC1, new Scalar(2.0));
|
||||
|
||||
Mat kernelX = new Mat(1, 3, CvType.CV_32FC1);
|
||||
kernelX.put(0, 0, 2.0, 2.0, 2.0);
|
||||
@ -1788,8 +1754,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
kernelY.put(0, 0, 1.0, 1.0, 1.0);
|
||||
|
||||
truth = new Mat(imgprocSz, imgprocSz, CvType.CV_32F, new Scalar(36.001));
|
||||
Imgproc.sepFilter2D(src, dst, CvType.CV_32F, kernelX, kernelY,
|
||||
anchorPoint, EPS);
|
||||
Imgproc.sepFilter2D(src, dst, CvType.CV_32F, kernelX, kernelY, anchorPoint, EPS);
|
||||
assertMatEqual(truth, dst, EPS);
|
||||
}
|
||||
|
||||
@ -1801,8 +1766,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
kernelY.put(0, 0, 1.0, 1.0, 1.0);
|
||||
|
||||
truth = new Mat(10, 10, CvType.CV_32F, new Scalar(0.001));
|
||||
Imgproc.sepFilter2D(gray0, dst, CvType.CV_32F, kernelX, kernelY,
|
||||
anchorPoint, EPS, Imgproc.BORDER_REFLECT);
|
||||
Imgproc.sepFilter2D(gray0, dst, CvType.CV_32F, kernelX, kernelY, anchorPoint, EPS, Imgproc.BORDER_REFLECT);
|
||||
assertMatEqual(truth, dst, EPS);
|
||||
}
|
||||
|
||||
@ -1847,8 +1811,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
truth.put(1, 0, -14, -12, 2);
|
||||
truth.put(2, 0, -10, 0, 10);
|
||||
|
||||
Imgproc.Sobel(src, dst, CvType.CV_32F, 1, 0, 3, 2.0, 0.0,
|
||||
Imgproc.BORDER_REPLICATE);
|
||||
Imgproc.Sobel(src, dst, CvType.CV_32F, 1, 0, 3, 2.0, 0.0, Imgproc.BORDER_REPLICATE);
|
||||
assertMatEqual(truth, dst, EPS);
|
||||
}
|
||||
|
||||
@ -1958,8 +1921,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
truth.put(0, 0, 2, 4);
|
||||
truth.put(1, 0, 6, 4);
|
||||
|
||||
Imgproc.warpAffine(src, dst, M, dsize, Imgproc.WARP_INVERSE_MAP,
|
||||
Imgproc.BORDER_TRANSPARENT);
|
||||
Imgproc.warpAffine(src, dst, M, dsize, Imgproc.WARP_INVERSE_MAP, Imgproc.BORDER_TRANSPARENT);
|
||||
assertMatEqual(truth, dst, EPS);
|
||||
}
|
||||
|
||||
@ -1980,8 +1942,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
truth.put(0, 0, 6, 4);
|
||||
truth.put(1, 0, 6, 4);
|
||||
|
||||
Imgproc.warpAffine(src, dst, M, dsize, Imgproc.WARP_INVERSE_MAP,
|
||||
Imgproc.BORDER_CONSTANT, sc);
|
||||
Imgproc.warpAffine(src, dst, M, dsize, Imgproc.WARP_INVERSE_MAP, Imgproc.BORDER_CONSTANT, sc);
|
||||
assertMatEqual(truth, dst, EPS);
|
||||
}
|
||||
|
||||
@ -2042,8 +2003,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
truth.put(0, 0, 6, 4);
|
||||
truth.put(1, 0, 6, 4);
|
||||
|
||||
Imgproc.warpPerspective(src, dst, M, dsize, Imgproc.WARP_INVERSE_MAP,
|
||||
Imgproc.BORDER_REFLECT);
|
||||
Imgproc.warpPerspective(src, dst, M, dsize, Imgproc.WARP_INVERSE_MAP, Imgproc.BORDER_REFLECT);
|
||||
assertMatEqual(truth, dst, EPS);
|
||||
}
|
||||
|
||||
@ -2061,8 +2021,7 @@ public class imgprocTest extends OpenCVTestCase {
|
||||
truth.put(0, 0, 2, 4);
|
||||
truth.put(1, 0, 6, 4);
|
||||
|
||||
Imgproc.warpPerspective(src, dst, M, dsize, Imgproc.WARP_INVERSE_MAP,
|
||||
Imgproc.BORDER_REFLECT, sc);
|
||||
Imgproc.warpPerspective(src, dst, M, dsize, Imgproc.WARP_INVERSE_MAP, Imgproc.BORDER_REFLECT, sc);
|
||||
assertMatEqual(truth, dst, EPS);
|
||||
}
|
||||
|
||||
|
@ -38,8 +38,11 @@ public class CascadeClassifierTest extends OpenCVTestCase {
|
||||
Mat greyLena = new Mat();
|
||||
Imgproc.cvtColor(rgbLena, greyLena, Imgproc.COLOR_RGB2GRAY);
|
||||
|
||||
//TODO: doesn't detect with 1.1 scale
|
||||
cc.detectMultiScale(greyLena, faces, 1.09, 2, 2 /*TODO: CV_HAAR_SCALE_IMAGE*/, new Size(30, 30));
|
||||
// TODO: doesn't detect with 1.1 scale
|
||||
cc.detectMultiScale(greyLena, faces, 1.09, 2, 2 /*
|
||||
* TODO:
|
||||
* CV_HAAR_SCALE_IMAGE
|
||||
*/, new Size(30, 30));
|
||||
assertEquals(1, faces.size());
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,6 @@ import org.opencv.core.Rect;
|
||||
import org.opencv.objdetect.Objdetect;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
|
||||
public class objdetectTest extends OpenCVTestCase {
|
||||
|
||||
public void testGroupRectanglesListOfRectInt() {
|
||||
|
@ -7,7 +7,6 @@ import org.opencv.core.Core;
|
||||
import org.opencv.video.Video;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
|
||||
public class videoTest extends OpenCVTestCase {
|
||||
|
||||
private int shift1;
|
||||
|
Loading…
Reference in New Issue
Block a user