diff --git a/ARE/components/sensor.XfacetrackerLK/src/main/java/eu/asterics/component/sensor/XfacetrackerLK/XFacetrackerLKInstance.java b/ARE/components/sensor.XfacetrackerLK/src/main/java/eu/asterics/component/sensor/XfacetrackerLK/XFacetrackerLKInstance.java index 6aee738d1..8707e64fa 100644 --- a/ARE/components/sensor.XfacetrackerLK/src/main/java/eu/asterics/component/sensor/XfacetrackerLK/XFacetrackerLKInstance.java +++ b/ARE/components/sensor.XfacetrackerLK/src/main/java/eu/asterics/component/sensor/XfacetrackerLK/XFacetrackerLKInstance.java @@ -123,6 +123,7 @@ public class XFacetrackerLKInstance extends AbstractRuntimeComponentInstance imp private Integer propFrameRate = 0; private boolean propDisplayGUI = true; private boolean propEnableOverlaySettings = true; + private Integer propResizeHeight = 120; private String instanceId = "XFacetrackerLK"; @@ -201,6 +202,8 @@ public Object getRuntimePropertyValue(String propertyName) { return propFrameRate; } else if ("enableOverlaySettings".equalsIgnoreCase(propertyName)) { return propEnableOverlaySettings; + } else if ("resizeHeight".equalsIgnoreCase(propertyName)) { + return propResizeHeight; } return ""; @@ -279,6 +282,13 @@ public Object setRuntimePropertyValue(String propertyName, Object newValue) { propEnableOverlaySettings = false; } return oldValue; + } else if ("resizeHeight".equalsIgnoreCase(propertyName)) { + oldValue = propResizeHeight; + propResizeHeight = 120; + try { + propResizeHeight = Integer.parseInt((String) newValue); + } catch (NumberFormatException e) { + } } if (wasRunning) { @@ -827,7 +837,7 @@ public void drawPoints(IplImage img, CvPoint2D32f corners) { public CvPoint2D32f findFeatures(IplImage imgA) { try { - faceRect = faceDetection.detectFace(imgA); + faceRect = faceDetection.detectFace(imgA,propResizeHeight); if (faceRect != null) { System.out.println("\nFound face at: " + faceRect); diff --git a/ARE/components/sensor.XfacetrackerLK/src/main/resources/bundle_descriptor.xml b/ARE/components/sensor.XfacetrackerLK/src/main/resources/bundle_descriptor.xml index 3d8cdda6f..43667ed15 100644 --- a/ARE/components/sensor.XfacetrackerLK/src/main/resources/bundle_descriptor.xml +++ b/ARE/components/sensor.XfacetrackerLK/src/main/resources/bundle_descriptor.xml @@ -78,7 +78,11 @@ + description="if selected, the video frame shows the current frame rate and device name as overlayed text."/> + @@ -143,6 +143,11 @@ + + + + + @@ -151,6 +156,11 @@ + + + + + diff --git a/ARE/services/ComputerVision/javacv-linux-arm.bnd b/ARE/services/ComputerVision/javacv-linux-arm.bnd new file mode 100644 index 000000000..c3ff4d756 --- /dev/null +++ b/ARE/services/ComputerVision/javacv-linux-arm.bnd @@ -0,0 +1,18 @@ +version=1.5 +opencv-ver=4.0.1 +src=./javacv +pkg=org/bytedeco +-includeresource: ${src}/${pkg}/javacv/${version}/javacv-${version}.jar, ${src}/${pkg}/javacv-platform/${version}/javacv-platform-${version}.jar, ${src}/${pkg}/javacpp/${version}/javacpp-${version}.jar, ${src}/${pkg}/opencv/${opencv-ver}-${version}/opencv-${opencv-ver}-${version}.jar, ${src}/${pkg}/opencv/${opencv-ver}-${version}/opencv-${opencv-ver}-${version}-linux-arm64.jar, ${src}/${pkg}/opencv/${opencv-ver}-${version}/opencv-${opencv-ver}-${version}-linux-armhf.jar, ${src}/${pkg}/opencv-platform/${opencv-ver}-${version}/opencv-platform-${opencv-ver}-${version}.jar, ${src}/${pkg}/openblas-platform/0.3.7-${version}/openblas-platform-0.3.7-${version}.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}-linux-armhf.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}-linux-arm64.jar +-exportcontents: org.bytedeco +-output: ../javacv-${version}-basic-linux-arm.jar +Bundle-ClassPath: ., javacv-${version}.jar, javacv-platform-${version}.jar, javacpp-${version}.jar, opencv-${opencv-ver}-${version}.jar, opencv-${opencv-ver}-${version}-linux-x86_64.jar, opencv-${opencv-ver}-${version}-linux-x86.jar, opencv-${opencv-ver}-${version}-linux-arm64.jar, opencv-${opencv-ver}-${version}-linux-armhf.jar, opencv-platform-${opencv-ver}-${version}.jar, openblas-platform-0.3.7-${version}.jar, openblas-0.3.7-${version}.jar, openblas-0.3.7-${version}-linux-x86.jar, openblas-0.3.7-${version}-linux-x86_64.jar, openblas-0.3.7-${version}-linux-armhf.jar, openblas-0.3.7-${version}-linux-arm64.jar +Manifest-Version: 1.0 +Created-By: bnd +Built-By: deinhofer +Bundle-ManifestVersion: 2 +Bundle-Name: asterics-services.javacv +Bundle-SymbolicName: org.bytedeco.javacv +Bundle-Version: ${version} +Export-Package: org.bytedeco.java*, org.bytedeco.opencv.opencv_*, org.bytedeco.*.global.* +Import-Package: *;resolution:=optional +DynamicImport-Package: diff --git a/ARE/services/ComputerVision/javacv-linux.bnd b/ARE/services/ComputerVision/javacv-linux.bnd index 1a0a37066..793f376da 100644 --- a/ARE/services/ComputerVision/javacv-linux.bnd +++ b/ARE/services/ComputerVision/javacv-linux.bnd @@ -1,10 +1,11 @@ -version=1.5.2 +version=1.5 +opencv-ver=4.0.1 src=./javacv pkg=org/bytedeco --includeresource: ${src}/${pkg}/javacv/${version}/javacv-${version}.jar, ${src}/${pkg}/javacv-platform/${version}/javacv-platform-${version}.jar, ${src}/${pkg}/javacpp/${version}/javacpp-${version}.jar, ${src}/${pkg}/opencv/4.1.2-${version}/opencv-4.1.2-${version}.jar, ${src}/${pkg}/opencv/4.1.2-${version}/opencv-4.1.2-${version}-linux-x86_64.jar, ${src}/${pkg}/opencv/4.1.2-${version}/opencv-4.1.2-${version}-linux-x86.jar, ${src}/${pkg}/opencv/4.1.2-${version}/opencv-4.1.2-${version}-linux-arm64.jar, ${src}/${pkg}/opencv/4.1.2-${version}/opencv-4.1.2-${version}-linux-armhf.jar, ${src}/${pkg}/opencv-platform/4.1.2-${version}/opencv-platform-4.1.2-${version}.jar, ${src}/${pkg}/openblas-platform/0.3.7-${version}/openblas-platform-0.3.7-${version}.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}-linux-x86.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}-linux-x86_64.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}-linux-armhf.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}-linux-arm64.jar +-includeresource: ${src}/${pkg}/javacv/${version}/javacv-${version}.jar, ${src}/${pkg}/javacv-platform/${version}/javacv-platform-${version}.jar, ${src}/${pkg}/javacpp/${version}/javacpp-${version}.jar, ${src}/${pkg}/opencv/${opencv-ver}-${version}/opencv-${opencv-ver}-${version}.jar, ${src}/${pkg}/opencv/${opencv-ver}-${version}/opencv-${opencv-ver}-${version}-linux-x86_64.jar, ${src}/${pkg}/opencv/${opencv-ver}-${version}/opencv-${opencv-ver}-${version}-linux-x86.jar, ${src}/${pkg}/opencv-platform/${opencv-ver}-${version}/opencv-platform-${opencv-ver}-${version}.jar, ${src}/${pkg}/openblas-platform/0.3.7-${version}/openblas-platform-0.3.7-${version}.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}-linux-x86.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}-linux-x86_64.jar -exportcontents: org.bytedeco -output: ../javacv-${version}-basic-linux.jar -Bundle-ClassPath: ., javacv-${version}.jar, javacv-platform-${version}.jar, javacpp-${version}.jar, opencv-4.1.2-${version}.jar, opencv-4.1.2-${version}-linux-x86_64.jar, opencv-4.1.2-${version}-linux-x86.jar, opencv-4.1.2-${version}-linux-arm64.jar, opencv-4.1.2-${version}-linux-armhf.jar, opencv-platform-4.1.2-${version}.jar, openblas-platform-0.3.7-${version}.jar, openblas-0.3.7-${version}.jar, openblas-0.3.7-${version}-linux-x86.jar, openblas-0.3.7-${version}-linux-x86_64.jar, openblas-0.3.7-${version}-linux-armhf.jar, openblas-0.3.7-${version}-linux-arm64.jar +Bundle-ClassPath: ., javacv-${version}.jar, javacv-platform-${version}.jar, javacpp-${version}.jar, opencv-${opencv-ver}-${version}.jar, opencv-${opencv-ver}-${version}-linux-x86_64.jar, opencv-${opencv-ver}-${version}-linux-x86.jar, opencv-${opencv-ver}-${version}-linux-arm64.jar, opencv-${opencv-ver}-${version}-linux-armhf.jar, opencv-platform-${opencv-ver}-${version}.jar, openblas-platform-0.3.7-${version}.jar, openblas-0.3.7-${version}.jar, openblas-0.3.7-${version}-linux-x86.jar, openblas-0.3.7-${version}-linux-x86_64.jar, openblas-0.3.7-${version}-linux-armhf.jar, openblas-0.3.7-${version}-linux-arm64.jar Manifest-Version: 1.0 Created-By: bnd Built-By: deinhofer diff --git a/ARE/services/ComputerVision/javacv-macosx.bnd b/ARE/services/ComputerVision/javacv-macosx.bnd index d381217cf..93b57eee7 100644 --- a/ARE/services/ComputerVision/javacv-macosx.bnd +++ b/ARE/services/ComputerVision/javacv-macosx.bnd @@ -1,10 +1,11 @@ -version=1.5.2 +version=1.5 +opencv-ver=4.0.1 src=./javacv pkg=org/bytedeco --includeresource: ${src}/${pkg}/javacv/${version}/javacv-${version}.jar, ${src}/${pkg}/javacv-platform/${version}/javacv-platform-${version}.jar, ${src}/${pkg}/javacpp/${version}/javacpp-${version}.jar, ${src}/${pkg}/opencv/4.1.2-${version}/opencv-4.1.2-${version}.jar, ${src}/${pkg}/opencv/4.1.2-${version}/opencv-4.1.2-${version}-macosx-x86_64.jar, ${src}/${pkg}/opencv/4.1.2-${version}/opencv-4.1.2-${version}-macosx-x86.jar, ${src}/${pkg}/opencv-platform/4.1.2-${version}/opencv-platform-4.1.2-${version}.jar, ${src}/${pkg}/openblas-platform/0.3.7-${version}/openblas-platform-0.3.7-${version}.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}-macosx-x86.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}-macosx-x86_64.jar +-includeresource: ${src}/${pkg}/javacv/${version}/javacv-${version}.jar, ${src}/${pkg}/javacv-platform/${version}/javacv-platform-${version}.jar, ${src}/${pkg}/javacpp/${version}/javacpp-${version}.jar, ${src}/${pkg}/opencv/${opencv-ver}-${version}/opencv-${opencv-ver}-${version}.jar, ${src}/${pkg}/opencv/${opencv-ver}-${version}/opencv-${opencv-ver}-${version}-macosx-x86_64.jar, ${src}/${pkg}/opencv/${opencv-ver}-${version}/opencv-${opencv-ver}-${version}-macosx-x86.jar, ${src}/${pkg}/opencv-platform/${opencv-ver}-${version}/opencv-platform-${opencv-ver}-${version}.jar, ${src}/${pkg}/openblas-platform/0.3.7-${version}/openblas-platform-0.3.7-${version}.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}-macosx-x86.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}-macosx-x86_64.jar -exportcontents: org.bytedeco -output: ../javacv-${version}-basic-macosx.jar -Bundle-ClassPath: ., javacv-${version}.jar, javacv-platform-${version}.jar, javacpp-${version}.jar, opencv-4.1.2-${version}.jar, opencv-4.1.2-${version}-macosx-x86_64.jar, opencv-4.1.2-${version}-macosx-x86.jar, opencv-platform-4.1.2-${version}.jar, openblas-platform-0.3.7-${version}.jar, openblas-0.3.7-${version}.jar, openblas-0.3.7-${version}-macosx-x86.jar, openblas-0.3.7-${version}-macosx-x86_64.jar +Bundle-ClassPath: ., javacv-${version}.jar, javacv-platform-${version}.jar, javacpp-${version}.jar, opencv-${opencv-ver}-${version}.jar, opencv-${opencv-ver}-${version}-macosx-x86_64.jar, opencv-${opencv-ver}-${version}-macosx-x86.jar, opencv-platform-${opencv-ver}-${version}.jar, openblas-platform-0.3.7-${version}.jar, openblas-0.3.7-${version}.jar, openblas-0.3.7-${version}-macosx-x86.jar, openblas-0.3.7-${version}-macosx-x86_64.jar Manifest-Version: 1.0 Created-By: bnd Built-By: deinhofer diff --git a/ARE/services/ComputerVision/javacv-windows-x86_64.bnd b/ARE/services/ComputerVision/javacv-windows-x86_64.bnd new file mode 100644 index 000000000..d3bc94ed3 --- /dev/null +++ b/ARE/services/ComputerVision/javacv-windows-x86_64.bnd @@ -0,0 +1,18 @@ +version=1.5 +opencv-ver=4.0.1 +src=./javacv +pkg=org/bytedeco +-includeresource: ${src}/${pkg}/javacv/${version}/javacv-${version}.jar, ${src}/${pkg}/javacv-platform/${version}/javacv-platform-${version}.jar, ${src}/${pkg}/javacpp/${version}/javacpp-${version}.jar, ${src}/${pkg}/opencv/${opencv-ver}-${version}/opencv-${opencv-ver}-${version}.jar, ${src}/${pkg}/opencv/${opencv-ver}-${version}/opencv-${opencv-ver}-${version}-windows-x86_64.jar, ${src}/${pkg}/opencv-platform/${opencv-ver}-${version}/opencv-platform-${opencv-ver}-${version}.jar, ${src}/${pkg}/openblas-platform/0.3.7-${version}/openblas-platform-0.3.7-${version}.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}-windows-x86_64.jar, ${src}/${pkg}/videoinput/0.200-${version}/videoinput-0.200-${version}.jar, ${src}/${pkg}/videoinput-platform/0.200-${version}/videoinput-platform-0.200-${version}.jar, ${src}/${pkg}/videoinput/0.200-${version}/videoinput-0.200-${version}-windows-x86_64.jar +-exportcontents: org.bytedeco +-output: ../javacv-${version}-basic-windows-x86_64.jar +Bundle-ClassPath: ., javacv-${version}.jar, javacv-platform-${version}.jar, javacpp-${version}.jar, opencv-${opencv-ver}-${version}.jar, opencv-${opencv-ver}-${version}-windows-x86_64.jar, opencv-${opencv-ver}-${version}-windows-x86.jar, opencv-platform-${opencv-ver}-${version}.jar, openblas-platform-0.3.7-${version}.jar, openblas-0.3.7-${version}.jar, openblas-0.3.7-${version}-windows-x86.jar, openblas-0.3.7-${version}-windows-x86_64.jar, videoinput-0.200-${version}.jar, videoinput-platform-0.200-${version}.jar, videoinput-0.200-${version}-windows-x86_64.jar, videoinput-0.200-${version}-windows-x86.jar +Manifest-Version: 1.0 +Created-By: bnd +Built-By: deinhofer +Bundle-ManifestVersion: 2 +Bundle-Name: asterics-services.javacv +Bundle-SymbolicName: org.bytedeco.javacv +Bundle-Version: ${version} +Export-Package: org.bytedeco.java*, org.bytedeco.opencv.opencv_*, org.bytedeco.*.global.* +Import-Package: *;resolution:=optional +DynamicImport-Package: diff --git a/ARE/services/ComputerVision/javacv-windows.bnd b/ARE/services/ComputerVision/javacv-windows.bnd index aa1a7f1b6..92ba293c9 100644 --- a/ARE/services/ComputerVision/javacv-windows.bnd +++ b/ARE/services/ComputerVision/javacv-windows.bnd @@ -1,10 +1,11 @@ -version=1.5.2 +version=1.5 +opencv-ver=4.0.1 src=./javacv pkg=org/bytedeco --includeresource: ${src}/${pkg}/javacv/${version}/javacv-${version}.jar, ${src}/${pkg}/javacv-platform/${version}/javacv-platform-${version}.jar, ${src}/${pkg}/javacpp/${version}/javacpp-${version}.jar, ${src}/${pkg}/opencv/4.1.2-${version}/opencv-4.1.2-${version}.jar, ${src}/${pkg}/opencv/4.1.2-${version}/opencv-4.1.2-${version}-windows-x86_64.jar, ${src}/${pkg}/opencv/4.1.2-${version}/opencv-4.1.2-${version}-windows-x86.jar, ${src}/${pkg}/opencv-platform/4.1.2-${version}/opencv-platform-4.1.2-${version}.jar, ${src}/${pkg}/openblas-platform/0.3.7-${version}/openblas-platform-0.3.7-${version}.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}-windows-x86.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}-windows-x86_64.jar, ${src}/${pkg}/videoinput/0.200-${version}/videoinput-0.200-${version}.jar, ${src}/${pkg}/videoinput-platform/0.200-${version}/videoinput-platform-0.200-${version}.jar, ${src}/${pkg}/videoinput/0.200-${version}/videoinput-0.200-${version}-windows-x86_64.jar, ${src}/${pkg}/videoinput/0.200-${version}/videoinput-0.200-${version}-windows-x86.jar +-includeresource: ${src}/${pkg}/javacv/${version}/javacv-${version}.jar, ${src}/${pkg}/javacv-platform/${version}/javacv-platform-${version}.jar, ${src}/${pkg}/javacpp/${version}/javacpp-${version}.jar, ${src}/${pkg}/opencv/${opencv-ver}-${version}/opencv-${opencv-ver}-${version}.jar, ${src}/${pkg}/opencv/${opencv-ver}-${version}/opencv-${opencv-ver}-${version}-windows-x86.jar, ${src}/${pkg}/opencv-platform/${opencv-ver}-${version}/opencv-platform-${opencv-ver}-${version}.jar, ${src}/${pkg}/openblas-platform/0.3.7-${version}/openblas-platform-0.3.7-${version}.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}.jar, ${src}/${pkg}/openblas/0.3.7-${version}/openblas-0.3.7-${version}-windows-x86.jar, ${src}/${pkg}/videoinput/0.200-${version}/videoinput-0.200-${version}.jar, ${src}/${pkg}/videoinput-platform/0.200-${version}/videoinput-platform-0.200-${version}.jar, ${src}/${pkg}/videoinput/0.200-${version}/videoinput-0.200-${version}-windows-x86.jar -exportcontents: org.bytedeco -output: ../javacv-${version}-basic-windows.jar -Bundle-ClassPath: ., javacv-${version}.jar, javacv-platform-${version}.jar, javacpp-${version}.jar, opencv-4.1.2-${version}.jar, opencv-4.1.2-${version}-windows-x86_64.jar, opencv-4.1.2-${version}-windows-x86.jar, opencv-platform-4.1.2-${version}.jar, openblas-platform-0.3.7-${version}.jar, openblas-0.3.7-${version}.jar, openblas-0.3.7-${version}-windows-x86.jar, openblas-0.3.7-${version}-windows-x86_64.jar, videoinput-0.200-${version}.jar, videoinput-platform-0.200-${version}.jar, videoinput-0.200-${version}-windows-x86_64.jar, videoinput-0.200-${version}-windows-x86.jar +Bundle-ClassPath: ., javacv-${version}.jar, javacv-platform-${version}.jar, javacpp-${version}.jar, opencv-${opencv-ver}-${version}.jar, opencv-${opencv-ver}-${version}-windows-x86_64.jar, opencv-${opencv-ver}-${version}-windows-x86.jar, opencv-platform-${opencv-ver}-${version}.jar, openblas-platform-0.3.7-${version}.jar, openblas-0.3.7-${version}.jar, openblas-0.3.7-${version}-windows-x86.jar, openblas-0.3.7-${version}-windows-x86_64.jar, videoinput-0.200-${version}.jar, videoinput-platform-0.200-${version}.jar, videoinput-0.200-${version}-windows-x86_64.jar, videoinput-0.200-${version}-windows-x86.jar Manifest-Version: 1.0 Created-By: bnd Built-By: deinhofer diff --git a/ARE/services/ComputerVision/pom.xml b/ARE/services/ComputerVision/pom.xml index 18fdc0c85..04bdb368f 100644 --- a/ARE/services/ComputerVision/pom.xml +++ b/ARE/services/ComputerVision/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.bytedeco.javacv demo - 1.5.2 + 1.5 1.8 1.8 @@ -11,7 +11,7 @@ org.bytedeco javacv-platform - 1.5.2 + 1.5 diff --git a/ARE/services/ComputerVision/src/main/java/eu/asterics/mw/computervision/FaceDetection.java b/ARE/services/ComputerVision/src/main/java/eu/asterics/mw/computervision/FaceDetection.java index f85c0e2d0..8adc332d3 100644 --- a/ARE/services/ComputerVision/src/main/java/eu/asterics/mw/computervision/FaceDetection.java +++ b/ARE/services/ComputerVision/src/main/java/eu/asterics/mw/computervision/FaceDetection.java @@ -57,8 +57,8 @@ public class FaceDetection { String classifierName = "data/service.computervision/haarcascade_frontalface_alt.xml"; CascadeClassifier classifier = null; - //Resize image to height of 75 to speed up face detection tremendously! - private static final int RESIZE_HEIGHT = 75; + //Resize image to height of 120 to speed up face detection tremendously! + private static final int RESIZE_HEIGHT = 120; // Objects allocated with a create*() or clone() factory method are // automatically released @@ -90,12 +90,23 @@ public FaceDetection() { * @throws Exception */ public CvRect detectFace(IplImage grayImage) throws Exception { + return detectFace(grayImage,RESIZE_HEIGHT); + } + + /** + * Detect the biggest face in given grayscale image. + * + * @param grayImage + * @return + * @throws Exception + */ + public CvRect detectFace(IplImage grayImage, int resizeHeight) throws Exception { // We already expect getting a grayscale image. Mat grayFrame=cvarrToMat(grayImage); //Resize frame to speed up face detection tremendously. - //Thanks to learnopencv and Satya Mallick for this trick!! - float RESIZE_SCALE=grayImage.height()/RESIZE_HEIGHT; + //Thanks to learnopencv and Satya Mallick for this trick!! + float RESIZE_SCALE=grayImage.height()/resizeHeight; Mat smallFrame=new Mat(); resize(grayFrame, smallFrame,new Size(),1.0/RESIZE_SCALE,1.0/RESIZE_SCALE,CV_INTER_AREA); @@ -126,10 +137,10 @@ public CvRect detectFace(IplImage grayImage) throws Exception { if (total > 0) { Rect faceRect = faces.get(0); - if ((faceRect.width()*RESIZE_SCALE) > MIN_FACE_WIDTH && (faceRect.height()*RESIZE_SCALE) > MIN_FACE_HEIGHT) { + // if ((faceRect.width()*RESIZE_SCALE) > MIN_FACE_WIDTH && (faceRect.height()*RESIZE_SCALE) > MIN_FACE_HEIGHT) { int x = (int)(faceRect.x()*RESIZE_SCALE), y = (int)(faceRect.y()*RESIZE_SCALE), w = (int)(faceRect.width()*RESIZE_SCALE), h = (int)(faceRect.height()*RESIZE_SCALE); return new CvRect(x,y,w,h); - } + // } // System.out.println("ignoring face with width: // "+faceRect.width()); } diff --git a/ARE/services/ComputerVision/src/main/java/eu/asterics/mw/computervision/SharedFrameGrabber.java b/ARE/services/ComputerVision/src/main/java/eu/asterics/mw/computervision/SharedFrameGrabber.java index ff2cd6348..438a97d6b 100644 --- a/ARE/services/ComputerVision/src/main/java/eu/asterics/mw/computervision/SharedFrameGrabber.java +++ b/ARE/services/ComputerVision/src/main/java/eu/asterics/mw/computervision/SharedFrameGrabber.java @@ -648,7 +648,8 @@ public void run() { } } catch (Exception e) { // TODO Auto-generated catch block - logger.warning("Could not start frame grabbing with grabber: "+grabber+", reason: "+e.getMessage()); + logger.fine("Could not start frame grabbing with grabber: "+grabber+", reason: "+e.getMessage()); + AstericsErrorHandling.instance.reportError(null,"Could not open camera device <"+deviceKey+">\nReason: "+e.getMessage()); } finally { if(grabber!=null) { // Grabbing can be safely stopped now diff --git a/ARE/services/ComputerVision/src/main/resources/META-INF/MANIFEST.MF b/ARE/services/ComputerVision/src/main/resources/META-INF/MANIFEST.MF index 7faaf480a..a572a5499 100644 --- a/ARE/services/ComputerVision/src/main/resources/META-INF/MANIFEST.MF +++ b/ARE/services/ComputerVision/src/main/resources/META-INF/MANIFEST.MF @@ -5,5 +5,5 @@ Bundle-SymbolicName: eu.asterics.mw.computervision Bundle-Version: 0.2.0 Bundle-ClassPath: . Export-Package: eu.asterics.mw.computervision -Require-Bundle: org.bytedeco.javacv;bundle-version=1.5.2 +Require-Bundle: org.bytedeco.javacv;bundle-version=1.5 DynamicImport-Package: * diff --git a/bin/ARE/profile/services-linux.ini b/bin/ARE/profile/services-linux.ini index 8e0e49bcf..40189379e 100644 --- a/bin/ARE/profile/services-linux.ini +++ b/bin/ARE/profile/services-linux.ini @@ -4,6 +4,6 @@ asterics.mw.systemstatechange.jar asterics.mw.cimcommunication.jar #Provides crossplatform computervision and framegrabbing libraries (opencv, libfreenect,...) -javacv-1.5.2-basic-linux.jar +javacv-1.5-basic-linux.jar #Provides a wrapper for camera initialization within AsTeRICS, depends on javacv service asterics.mw.computervision.jar diff --git a/bin/ARE/profile/services-macosx.ini b/bin/ARE/profile/services-macosx.ini index 637a19f43..1519aa1ab 100644 --- a/bin/ARE/profile/services-macosx.ini +++ b/bin/ARE/profile/services-macosx.ini @@ -4,6 +4,6 @@ asterics.mw.systemstatechange.jar asterics.mw.cimcommunication.jar #Provides crossplatform computervision and framegrabbing libraries (opencv, libfreenect,...) -javacv-1.5.2-basic-macosx.jar +javacv-1.5-basic-macosx.jar #Provides a wrapper for camera initialization within AsTeRICS, depends on javacv service asterics.mw.computervision.jar diff --git a/bin/ARE/profile/services-windows.ini b/bin/ARE/profile/services-windows.ini index c99d198d1..fda5991ca 100644 --- a/bin/ARE/profile/services-windows.ini +++ b/bin/ARE/profile/services-windows.ini @@ -7,6 +7,6 @@ asterics.mw.cimcommunication-windows.jar #asterics.mw.cimcommunication.jar #Provides crossplatform computervision and framegrabbing libraries (opencv, libfreenect, videoInput,...) -javacv-1.5.2-basic-windows.jar +javacv-1.5-basic-windows.jar #Provides a wrapper for camera initialization within AsTeRICS, depends on javacv service asterics.mw.computervision.jar