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 croppedBitmapto AI-compatible format, using the static methodprocess(Bitmap, int)
2. Crop one largeBitmapto multipleFaceScanner.InputImages using bounds insideRectFobjects, withInputImageProcessor(Bitmap, int)andprocess(RectF). This allows processing multiple faces on oneBitmap, for usage withFaceDetectorand 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.InputImageprocess(Bitmap input)In normal mode of operation, we take a perfectly croppedBitmapcontaining one face and process it.static FaceScanner.InputImageprocess(Bitmap input, int sensorOrientation)In normal mode of operation, we take a perfectly croppedBitmapcontaining one face and process it.FaceScanner.InputImageprocess(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 croppedBitmapcontaining 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 croppedBitmapcontaining 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-RectFcontaining location of face cropped out next- Returns:
- Converted
FaceScanner.InputImage
-
-