Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Mobile Vision

funnelbit
August 31, 2016

Mobile Vision

funnelbit

August 31, 2016
Tweet

More Decks by funnelbit

Other Decks in Technology

Transcript

  1. %FUFDUPS5 Frame frame = new Frame.Builder().setBitmap(bitmap).build(); FaceDetector detector = new

    FaceDetector.Builder(context)
 .setProminentFaceOnly(true)
 .build(); 
 SparseArray<Face> faces = detector.detect(frame); Face face = faces.valueAt(0);
  2. 5SBDLFS w நग़͞ΕͨJUFNͷঢ়ଶมԽΛ஌ΔͨΊͷΫϥε private class FaceTracker extends Tracker<Face> {
 @Override


    public void onNewItem(int faceId, Face item) {
 // item ͷτϥοΩϯά͕։࢝͞Εͨ
 }
 @Override
 public void onUpdate(FaceDetector.Detections<Face> detectionResults, Face face) {
 // ͢Ͱʹ։͍࢝ͯ͠Δ item ͕Ξοϓσʔτ͞Εͨ
 }
 @Override
 public void onMissing(FaceDetector.Detections<Face> detectionResults) {
 // τϥοΩϯάʹࣦഊͨ͠ }
 @Override
 public void onDone() {
 // ͢ͰʹτϥοΩϯά͍ͯͨ͠ item ͕ແ͘ͳΓɺτϥοΩϯά͕ऴྃͨ͠
 }
 }
  3. .VMUJ1SPDFTTPS w ෳ਺ͷݕग़ΛϋϯυϦϯά͠ɺ5SBDLFSʹ௨஌͢Δ 
 FaceDetector faceDetector = …
 faceDetector.setProcessor(new MultiProcessor.Builder<>(


    new MultiProcessor.Factory<Face>() {
 @Override
 public Tracker<Face> create(Face face) {
 return new FaceTracker();
 }
 }
 ).build());
 cameraSource.build(getApplicationContext(), faceDetector);
  4. .VMUJ%FUFDUPS 'SBNF %FUFDUPS 'SBNF 'SBNF 5SBDLFS 5SBDLFS $BNFSB4PVSDF .VMUJ%FUFDUPS %FUFDUPS

    5SBDLFS 5SBDLFS .VMUJ1SPDFTTPS 5SBDLFS'BDUPSZ .VMUJ1SPDFTTPS 5SBDLFS'BDUPSZ JUFN JUFN JUFN JUFN