1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Move more 2d funcs to geometry module.

This commit is contained in:
Alexander Smorkalov
2026-06-03 22:50:44 +03:00
parent e3fc091de4
commit 9803eb0443
14 changed files with 398 additions and 394 deletions
@@ -145,14 +145,6 @@ public class ImgprocTest extends OpenCVTestCase {
assertEquals(src.rows(), Core.countNonZero(dst));
}
public void testArcLength() {
MatOfPoint2f curve = new MatOfPoint2f(new Point(1, 3), new Point(2, 4), new Point(3, 5), new Point(4, 4), new Point(5, 3));
double arcLength = Imgproc.arcLength(curve, false);
assertEquals(5.656854249, arcLength, 0.000001);
}
public void testBilateralFilterMatMatIntDoubleDouble() {
Imgproc.bilateralFilter(gray255, dst, 5, 10, 5);
@@ -188,17 +180,6 @@ public class ImgprocTest extends OpenCVTestCase {
// TODO_: write better test
}
public void testBoundingRect() {
MatOfPoint points = new MatOfPoint(new Point(0, 0), new Point(0, 4), new Point(4, 0), new Point(4, 4));
Point p1 = new Point(1, 1);
Point p2 = new Point(-5, -2);
Rect bbox = Imgproc.boundingRect(points);
assertTrue(bbox.contains(p1));
assertFalse(bbox.contains(p2));
}
public void testBoxFilterMatMatIntSize() {
Size size = new Size(3, 3);
Imgproc.boxFilter(gray0, dst, 0, size);
@@ -347,25 +328,6 @@ public class ImgprocTest extends OpenCVTestCase {
assertEquals(1., distance, EPS);
}
public void testContourAreaMat() {
Mat contour = new Mat(1, 4, CvType.CV_32FC2);
contour.put(0, 0, 0, 0, 10, 0, 10, 10, 5, 4);
double area = Imgproc.contourArea(contour);
assertEquals(45., area, EPS);
}
public void testContourAreaMatBoolean() {
Mat contour = new Mat(1, 4, CvType.CV_32FC2);
contour.put(0, 0, 0, 0, 10, 0, 10, 10, 5, 4);
double area = Imgproc.contourArea(contour, true);
assertEquals(45., area, EPS);
// TODO_: write better test
}
public void testConvertMapsMatMatMatMatInt() {
Mat map1 = new Mat(1, 4, CvType.CV_32FC1, new Scalar(1));
Mat map2 = new Mat(1, 4, CvType.CV_32FC1, new Scalar(2));