Skip to content

Implementing 'face' for android app #16

@ghost

Description

Issue 1: face package not recognized in opencv:4.1.0
implementation 'com.quickbirdstudios:opencv:4.1.0'
implementation 'com.quickbirdstudios:opencv:4.1.0-contrib'

error: package org.opencv.face does not exist
error: cannot find symbol class FaceRecognizer  

Issue 2: model.read() function not seeing file (returns null pointer error)
--> I am trying to read a saved YAML model and load it into my new FaceRecognizer object.
--> The model is saved in the external files directory (is this the best option)
--> Does the 'read' function have the ability to read from this directory?

To account for Issue 1, using 3.4.1
implementation 'com.quickbirdstudios:opencv:3.4.1'
implementation 'com.quickbirdstudios:opencv:3.4.4-contrib'

String externalDir = getExternalFilesDir (Environment.getDataDirectory().getAbsolutePath()) .getAbsolutePath();
String modelPath = externalDir+"/model.yml";
FaceRecognizer model;
model.read(modelPath);

java.lang.NullPointerException: Attempt to invoke virtual method 'void org.opencv.face.FaceRecognizer.read(java.lang.String)' on a null object reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions