Path: blob/master/modules/objdetect/misc/java/test/CascadeClassifierTest.java
16354 views
package org.opencv.test.objdetect;12import org.opencv.core.Mat;3import org.opencv.core.MatOfRect;4import org.opencv.core.Size;5import org.opencv.imgproc.Imgproc;6import org.opencv.objdetect.CascadeClassifier;7import org.opencv.objdetect.Objdetect;8import org.opencv.test.OpenCVTestCase;9import org.opencv.test.OpenCVTestRunner;1011public class CascadeClassifierTest extends OpenCVTestCase {1213private CascadeClassifier cc;1415@Override16protected void setUp() throws Exception {17super.setUp();1819cc = null;20}2122public void testCascadeClassifier() {23cc = new CascadeClassifier();24assertTrue(null != cc);25}2627public void testCascadeClassifierString() {28cc = new CascadeClassifier(OpenCVTestRunner.LBPCASCADE_FRONTALFACE_PATH);29assertTrue(null != cc);30}3132public void testDetectMultiScaleMatListOfRect() {33CascadeClassifier cc = new CascadeClassifier(OpenCVTestRunner.LBPCASCADE_FRONTALFACE_PATH);34MatOfRect faces = new MatOfRect();3536Mat greyLena = new Mat();37Imgproc.cvtColor(rgbLena, greyLena, Imgproc.COLOR_RGB2GRAY);38Imgproc.equalizeHist(greyLena, greyLena);3940cc.detectMultiScale(greyLena, faces, 1.1, 3, Objdetect.CASCADE_SCALE_IMAGE, new Size(30, 30), new Size());41assertEquals(1, faces.total());42}4344public void testDetectMultiScaleMatListOfRectDouble() {45fail("Not yet implemented");46}4748public void testDetectMultiScaleMatListOfRectDoubleInt() {49fail("Not yet implemented");50}5152public void testDetectMultiScaleMatListOfRectDoubleIntInt() {53fail("Not yet implemented");54}5556public void testDetectMultiScaleMatListOfRectDoubleIntIntSize() {57fail("Not yet implemented");58}5960public void testDetectMultiScaleMatListOfRectDoubleIntIntSizeSize() {61fail("Not yet implemented");62}6364public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDouble() {65fail("Not yet implemented");66}6768public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDouble() {69fail("Not yet implemented");70}7172public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDoubleInt() {73fail("Not yet implemented");74}7576public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDoubleIntInt() {77fail("Not yet implemented");78}7980public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDoubleIntIntSize() {81fail("Not yet implemented");82}8384public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDoubleIntIntSizeSize() {85fail("Not yet implemented");86}8788public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDoubleIntIntSizeSizeBoolean() {89fail("Not yet implemented");90}9192public void testEmpty() {93cc = new CascadeClassifier();94assertTrue(cc.empty());95}9697public void testLoad() {98cc = new CascadeClassifier();99cc.load(OpenCVTestRunner.LBPCASCADE_FRONTALFACE_PATH);100assertTrue(!cc.empty());101}102103}104105106