What is the meaning of setRequestedFps in mobile vision API.
Camera Code :
mCameraSource =
new CameraSource.Builder(getApplicationContext(), textRecognizer)
.setFacing(CameraSource.CAMERA_FACING_BACK)
.setRequestedPreviewSize(1280, 1024)
.setRequestedFps(40.0f)
.setFlashMode(useFlash ? Camera.Parameters.FLASH_MODE_TORCH : null)
.setFocusMode(autoFocus ? Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE : null)
.build();
Initializing Processing Object.
ocrDetectorProcessor =new OcrDetectorProcessor(this,mGraphicOverlay,documentType);
TextRecognizer textRecognizer = new TextRecognizer.Builder(context).build();
textRecognizer.setProcessor(ocrDetectorProcessor);
Processor Class
class OcrDetectorProcessor{
public OcrDetectorProcessor(OcrCaptureActivity ocrCaptureActivity,GraphicOverlay<OcrGraphic> mGraphicOverlay,String documentType) {
}
@Override
public void receiveDetections(Detector.Detections<TextBlock> detections) {
}}
My Question : If I set setRequestedFps(40.0f) then receiveDetections will called 40 times in a second or not
Yes if The device supports. If not it will change to the best available FPS.
as it mentioned at Google APIs for Android
Sets the requested frame rate in frames per second. If the exact requested value is not available, the best matching available value is selected. Default: 30.
My Question : If I set setRequestedFps(40.0f) then receiveDetections will (be) called 40 times in a second or not
Camera will send that many frames to the underlying detector. Now whether or not the detector is able to process that many frames in a second will depend on the processing power of your phone
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.