mirror of https://github.com/opencv/opencv.git
Open Source Computer Vision Library
https://opencv.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
105 lines
3.0 KiB
105 lines
3.0 KiB
14 years ago
|
package org.opencv.test.objdetect;
|
||
|
|
||
14 years ago
|
import org.opencv.core.Mat;
|
||
13 years ago
|
import org.opencv.core.MatOfRect;
|
||
14 years ago
|
import org.opencv.core.Size;
|
||
|
import org.opencv.imgproc.Imgproc;
|
||
14 years ago
|
import org.opencv.objdetect.CascadeClassifier;
|
||
13 years ago
|
import org.opencv.objdetect.Objdetect;
|
||
14 years ago
|
import org.opencv.test.OpenCVTestCase;
|
||
|
import org.opencv.test.OpenCVTestRunner;
|
||
|
|
||
|
public class CascadeClassifierTest extends OpenCVTestCase {
|
||
13 years ago
|
|
||
|
private CascadeClassifier cc;
|
||
|
|
||
14 years ago
|
@Override
|
||
|
protected void setUp() throws Exception {
|
||
|
super.setUp();
|
||
13 years ago
|
|
||
14 years ago
|
cc = null;
|
||
|
}
|
||
|
|
||
13 years ago
|
public void testCascadeClassifier() {
|
||
|
cc = new CascadeClassifier();
|
||
|
assertTrue(null != cc);
|
||
|
}
|
||
|
|
||
|
public void testCascadeClassifierString() {
|
||
|
cc = new CascadeClassifier(OpenCVTestRunner.LBPCASCADE_FRONTALFACE_PATH);
|
||
|
assertTrue(null != cc);
|
||
|
}
|
||
|
|
||
|
public void testDetectMultiScaleMatListOfRect() {
|
||
|
CascadeClassifier cc = new CascadeClassifier(OpenCVTestRunner.LBPCASCADE_FRONTALFACE_PATH);
|
||
13 years ago
|
MatOfRect faces = new MatOfRect();
|
||
13 years ago
|
|
||
|
Mat greyLena = new Mat();
|
||
|
Imgproc.cvtColor(rgbLena, greyLena, Imgproc.COLOR_RGB2GRAY);
|
||
|
|
||
|
// TODO: doesn't detect with 1.1 scale
|
||
13 years ago
|
cc.detectMultiScale(greyLena, faces, 1.09, 3, Objdetect.CASCADE_SCALE_IMAGE, new Size(30, 30), new Size());
|
||
13 years ago
|
assertEquals(1, faces.total());
|
||
13 years ago
|
}
|
||
|
|
||
|
public void testDetectMultiScaleMatListOfRectDouble() {
|
||
|
fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
public void testDetectMultiScaleMatListOfRectDoubleInt() {
|
||
|
fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
public void testDetectMultiScaleMatListOfRectDoubleIntInt() {
|
||
|
fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
public void testDetectMultiScaleMatListOfRectDoubleIntIntSize() {
|
||
|
fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
public void testDetectMultiScaleMatListOfRectDoubleIntIntSizeSize() {
|
||
|
fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDouble() {
|
||
|
fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDouble() {
|
||
|
fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDoubleInt() {
|
||
|
fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDoubleIntInt() {
|
||
|
fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDoubleIntIntSize() {
|
||
|
fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDoubleIntIntSizeSize() {
|
||
|
fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDoubleIntIntSizeSizeBoolean() {
|
||
|
fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
public void testEmpty() {
|
||
|
cc = new CascadeClassifier();
|
||
|
assertTrue(cc.empty());
|
||
|
}
|
||
|
|
||
|
public void testLoad() {
|
||
|
cc = new CascadeClassifier();
|
||
|
cc.load(OpenCVTestRunner.LBPCASCADE_FRONTALFACE_PATH);
|
||
|
assertTrue(!cc.empty());
|
||
|
}
|
||
14 years ago
|
|
||
|
}
|