| class info |
| com.huawei.hms.mlsdk.common.MLCompositeAnalyzer |
| Represents a composite analyzer, which extends MLAnalyzer and can integrate with multiple types of analyzers to detect different types of objects at the same time. For example, it can simultaneously recognize faces and texts in an image. |
- // Create an instance of MLCompositeAnalyzer
- MLCompositeAnalyzer analyzer = new MLCompositeAnalyzer.Creator()
- .add(faceAnalyzer)
- .add(objectAnalyzer)
- .create();
- // Create an instance of LensEnginebased on the instance of MLCompositeAnalyzer
- LensEngine mLensEngine = new LensEngine.Creator(getAppContext(), analyzer)
- .setLensType(LensEngine.BACK_LENS)
- .applyDisplayDimension(640, 480)
- .applyFps(30.0f)
- .enableAutomaticFocus(true)
- .create();
| Return type | Method name |
| android.util.SparseArray<Object> | analyseFrame(MLFrame frame) |
| void | destroy() |
| boolean | isAvailable() |
| void | obtainPicture(MLFrame frame) |
Parameters
| Parameter name | Parameter desc |
| frame | Image whose information is to be detected. |
Return
| Type | desc |
| android.util.SparseArray<Object> | Detection results |
| Method |
| public void destroy() |
| Releases resources occupied by a composite analyzer. |
| Method |
| public boolean isAvailable() |
| Checks whether an analyzer is available, that is, whether all required resources are loaded. |
Return
| Type | desc |
| boolean | true: analyzer available false: analyzer unavailable |
| Method |
| public void obtainPicture(MLFrame frame) |
| Receives MLFrame instance and uses it as the input of a composite analyzer. |
Parameters
| Parameter name | Parameter desc |
| frame | MLFrame instance |