Package com.libremobileos.yifan.face
Class FaceScanner.InputImageProcessor
- java.lang.Object
-
- com.libremobileos.yifan.face.FaceScanner.InputImageProcessor
-
- Enclosing class:
- FaceScanner
public static class FaceScanner.InputImageProcessor extends Object
Processes Bitmaps to compatible format. This class supports 2 modes of operation:
1. Preprocess perfectly croppedBitmap
to AI-compatible format, using the static methodprocess(Bitmap, int)
2. Crop one largeBitmap
to multipleFaceScanner.InputImage
s using bounds insideRectF
objects, withInputImageProcessor(Bitmap, int)
andprocess(RectF)
. This allows processing multiple faces on oneBitmap
, for usage withFaceDetector
and similar classes.- See Also:
FaceScanner.InputImage
-
-
Constructor Summary
Constructors Constructor Description InputImageProcessor(Bitmap rawImage, int sensorOrientation)
If the class gets instantiated, we enter a special mode of operation for detecting multiple faces on one largeBitmap
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FaceScanner.InputImage
process(Bitmap input)
In normal mode of operation, we take a perfectly croppedBitmap
containing one face and process it.static FaceScanner.InputImage
process(Bitmap input, int sensorOrientation)
In normal mode of operation, we take a perfectly croppedBitmap
containing one face and process it.FaceScanner.InputImage
process(RectF inputBB)
In special mode of operation, we crop the image to detect multiple faces on one largeBitmap
(in multiple passes).
-
-
-
Constructor Detail
-
InputImageProcessor
public InputImageProcessor(Bitmap rawImage, int sensorOrientation)
If the class gets instantiated, we enter a special mode of operation for detecting multiple faces on one largeBitmap
.- Parameters:
rawImage
- The image with all faces to be detectedsensorOrientation
- rotation if the image should be rotated, or 0.
-
-
Method Detail
-
process
public static FaceScanner.InputImage process(Bitmap input, int sensorOrientation)
In normal mode of operation, we take a perfectly croppedBitmap
containing one face and process it.- Parameters:
input
- Bitmap to process.sensorOrientation
- rotation if the image should be rotated, or 0.- Returns:
- Converted
FaceScanner.InputImage
-
process
public FaceScanner.InputImage process(Bitmap input)
In normal mode of operation, we take a perfectly croppedBitmap
containing one face and process it. This utility method uses sensorOrientation that was passed in the constructor and callsprocess(Bitmap, int)
- Parameters:
input
- Bitmap to process.- Returns:
- Converted
FaceScanner.InputImage
- See Also:
process(Bitmap, int)
-
process
public FaceScanner.InputImage process(RectF inputBB)
In special mode of operation, we crop the image to detect multiple faces on one largeBitmap
(in multiple passes).- Parameters:
inputBB
-RectF
containing location of face cropped out next- Returns:
- Converted
FaceScanner.InputImage
-
-