From 2c972b6d5469e5833e2229bc3d9cacf1be9dca98 Mon Sep 17 00:00:00 2001 From: Emilian Peev Date: Fri, 21 Sep 2012 14:47:12 +0300 Subject: CameraHal: Disable filtering of FD coordinates - Currently filtering of the FD coordinates was done at the HAL level, which doesn't seem to be longer needed as similar mechanism is employed at the OMX Camera component layer. Change-Id: Ie096b9eca5435caa4098a9a3a9baa0e60782fc3e Signed-off-by: Emilian Peev --- camera/OMXCameraAdapter/OMXFD.cpp | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) (limited to 'camera/OMXCameraAdapter') diff --git a/camera/OMXCameraAdapter/OMXFD.cpp b/camera/OMXCameraAdapter/OMXFD.cpp index 08e5a60..1a482b2 100644 --- a/camera/OMXCameraAdapter/OMXFD.cpp +++ b/camera/OMXCameraAdapter/OMXFD.cpp @@ -24,13 +24,6 @@ #include "CameraHal.h" #include "OMXCameraAdapter.h" -// constants used for face smooth filtering -static const int HorizontalFilterThreshold = 40; -static const int VerticalFilterThreshold = 40; -static const int HorizontalFaceSizeThreshold = 30; -static const int VerticalFaceSizeThreshold = 30; - - namespace Ti { namespace Camera { @@ -463,24 +456,15 @@ status_t OMXCameraAdapter::encodeFaceCoordinates(const OMX_FACEDETECTIONTYPE *fa int tempSizeY = (faceDetectionLastOutput[j].rect[trans_bot] - faceDetectionLastOutput[j].rect[trans_top] ) ; - if ( (abs(tempCenterX - centerX) < HorizontalFilterThreshold) && - (abs(tempCenterY - centerY) < VerticalFilterThreshold) ) - { - // Found Face. It did not move too far. - // Now check size of rectangle compare to last output - if ( (abs (tempSizeX -sizeX) < HorizontalFaceSizeThreshold) && - (abs (tempSizeY -sizeY) < VerticalFaceSizeThreshold) ) - { - // Rectangle is almost same as last time - // Output exactly what was done for this face last time. - faces[i] = faceDetectionLastOutput[j]; + if ( ( tempCenterX == centerX) && + ( tempCenterY == centerY) ) { + // Found Face. + // Now check size of rectangle + // compare to last output. + if ( ( tempSizeX == sizeX ) && + ( tempSizeY == sizeY ) ) { faceChanged = false; } - else - { - // TODO(XXX): Rectangle size changed but position is same. - // Possibly we can apply just positional correctness. - } } } // Send face detection data after some face coordinate changes -- cgit v1.1