package org.myrobotlab.opencv;

import org.bytedeco.opencv.opencv_core.IplImage;
import org.junit.Before;
import org.junit.Assert;

public class OpenCVFilterFaceDetectTest extends AbstractOpenCVFilterTest {
  
  @Before
  public void before() {
    debug = false;
  }
  
  @Override
  public OpenCVFilter createFilter() {
    // create our test filter.
    OpenCVFilterFaceDetect filter = new OpenCVFilterFaceDetect("facedetect");
    return filter;
  }

  @Override
  public IplImage createTestImage() {
    // TODO Auto-generated method stub
    // let's use lena.png.
    IplImage input = defaultImage();
    return input;
  }

  @Override
  public void verify(OpenCVFilter filter, IplImage input, IplImage output) {
    // it should have found 1 face
    OpenCVFilterFaceDetect f = (OpenCVFilterFaceDetect)filter;
    // expected vs actual
    Assert.assertEquals(1, f.bb.size());
    
  }
  
}

@@ -25,16 +25,63 @@
 pencv;%0A%0A
+import static org.junit.Assert.assertNotNull;%0A%0A
 import o
@@ -648,16 +648,61 @@
 mage();%0A
+    assertNotNull(%22bad input image%22, input);%0A
     retu
@@ -953,16 +953,45 @@
 tEquals(
+%22could not find the 1 face%22, 
 1, f.bb.

test failed once ...