static Mat gray128;
static Mat gray255;
+ static Mat gray255_32f;
+
static Mat grayRnd;
static Mat grayRnd_32f;
gray128 = new Mat(matSize, matSize, Mat.CvType.CV_8UC1); gray128.setTo(128.0);
gray255 = new Mat(matSize, matSize, Mat.CvType.CV_8UC1); gray255.setTo(256.0);
+ gray255_32f = new Mat(matSize, matSize, Mat.CvType.CV_32FC1); gray255_32f.setTo(255.0);
+
Mat low = new Mat(1, 1, Mat.CvType.CV_16UC1); low.setTo(0);
Mat high = new Mat(1, 1, Mat.CvType.CV_16UC1); high.setTo(256);
grayRnd = new Mat(matSize, matSize, Mat.CvType.CV_8UC1); core.randu(grayRnd, low, high);
}
public void testAddWeightedMatDoubleMatDoubleDoubleMatInt() {
- fail("Not yet implemented");
+ Mat dst = new Mat();
+ core.addWeighted(gray1, 126.0, gray127, 1.0, 2.0, dst, gray255_32f.depth());
+ assertTrue(gray255_32f.depth() == dst.depth());
}
public void testAddWeightedMatDoubleMatDoubleDoubleMat() {
- fail("Not yet implemented");
+ core.addWeighted(gray1, 126.0, gray127, 1.0, 2.0, dst_gray);
+ assertMatEqual(gray255, dst_gray);
}
public void testBitwise_andMatMatMatMat() {
core.compare(gray0, gray1, cmp, core.CMP_EQ);
assertMatEqual(cmp, gray0);
+
+ core.compare(gray0, grayRnd, cmp, core.CMP_EQ);
+ double nBlackPixels = core.countNonZero(cmp);
+ double nNonBlackpixels = core.countNonZero(grayRnd);
+ assertTrue((nBlackPixels+nNonBlackpixels) == grayRnd.rows()*grayRnd.cols());
}
public void testCompleteSymmMatBoolean() {
}
public void testMulTransposedMatMatBooleanMat() {
- fail("Not yet implemented");
+ core.mulTransposed(grayRnd_32f, dst_gray_32f, true, grayRnd_32f);
+ assertMatEqual(gray0_32f, dst_gray_32f);
}
public void testMulTransposedMatMatBoolean() {