Simple Moments class for Java
This commit is contained in:
@@ -1,199 +1,51 @@
|
||||
package org.opencv.test.imgproc;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
import org.opencv.imgproc.Moments;
|
||||
|
||||
public class MomentsTest extends OpenCVTestCase {
|
||||
|
||||
public void testGet_m00() {
|
||||
fail("Not yet implemented");
|
||||
Mat data;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
data = new Mat(3,3, CvType.CV_8UC1, new Scalar(1));
|
||||
data.row(1).setTo(new Scalar(5));
|
||||
}
|
||||
|
||||
public void testGet_m01() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_m02() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_m03() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_m10() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_m11() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_m12() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_m20() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_m21() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_m30() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_mu02() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_mu03() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_mu11() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_mu12() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_mu20() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_mu21() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_mu30() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_nu02() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_nu03() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_nu11() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_nu12() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_nu20() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_nu21() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_nu30() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_m00() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_m01() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_m02() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_m03() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_m10() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_m11() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_m12() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_m20() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_m21() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_m30() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_mu02() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_mu03() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_mu11() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_mu12() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_mu20() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_mu21() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_mu30() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_nu02() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_nu03() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_nu11() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_nu12() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_nu20() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_nu21() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_nu30() {
|
||||
fail("Not yet implemented");
|
||||
public void testAll() {
|
||||
Moments res = Imgproc.moments(data);
|
||||
assertEquals(res.m00, 21.0, EPS);
|
||||
assertEquals(res.m10, 21.0, EPS);
|
||||
assertEquals(res.m01, 21.0, EPS);
|
||||
assertEquals(res.m20, 35.0, EPS);
|
||||
assertEquals(res.m11, 21.0, EPS);
|
||||
assertEquals(res.m02, 27.0, EPS);
|
||||
assertEquals(res.m30, 63.0, EPS);
|
||||
assertEquals(res.m21, 35.0, EPS);
|
||||
assertEquals(res.m12, 27.0, EPS);
|
||||
assertEquals(res.m03, 39.0, EPS);
|
||||
assertEquals(res.mu20, 14.0, EPS);
|
||||
assertEquals(res.mu11, 0.0, EPS);
|
||||
assertEquals(res.mu02, 6.0, EPS);
|
||||
assertEquals(res.mu30, 0.0, EPS);
|
||||
assertEquals(res.mu21, 0.0, EPS);
|
||||
assertEquals(res.mu12, 0.0, EPS);
|
||||
assertEquals(res.mu03, 0.0, EPS);
|
||||
assertEquals(res.nu20, 0.031746031746031744, EPS);
|
||||
assertEquals(res.nu11, 0.0, EPS);
|
||||
assertEquals(res.nu02, 0.013605442176870746, EPS);
|
||||
assertEquals(res.nu30, 0.0, EPS);
|
||||
assertEquals(res.nu21, 0.0, EPS);
|
||||
assertEquals(res.nu12, 0.0, EPS);
|
||||
assertEquals(res.nu03, 0.0, EPS);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user