Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Black Image When setExact is FALSE #78

Open
Mouadabdelghafouraitali opened this issue Jun 16, 2021 · 0 comments
Open

Black Image When setExact is FALSE #78

Mouadabdelghafouraitali opened this issue Jun 16, 2021 · 0 comments

Comments

@Mouadabdelghafouraitali

I'm using the following code to get the foreground only from a given bitmap :

    private MLImageSegmentationAnalyzer analyzer;

    public void analyzer(Bitmap src, MLCallBack mlCallBack) {
        MLImageSegmentationSetting setting = new MLImageSegmentationSetting.Factory()
                .setExact(false)
                .setAnalyzerType(MLImageSegmentationSetting.BODY_SEG)
                .setScene(MLImageSegmentationScene.FOREGROUND_ONLY)
                .create();
        
        this.analyzer = MLAnalyzerFactory.getInstance().getImageSegmentationAnalyzer(setting);
        MLFrame mlFrame = new MLFrame.Creator().setBitmap(src).create();
        Task<MLImageSegmentation> task = this.analyzer.asyncAnalyseFrame(mlFrame);
        task.addOnSuccessListener(mlImageSegmentationResults ->
                mlCallBack.onMLCompleted(mlImageSegmentationResults.getForeground()))
                .addOnFailureListener(e ->
                        mlCallBack.onMLFailed());
    }

But the output is always BLACK, when I set .setExact(true), everything works fine, I would like to speed up to background remover process that's why I set False to setExact()

@Mouadabdelghafouraitali Mouadabdelghafouraitali changed the title Black bitmap when setExact is FALSE Black Image When setExact is FALSE Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant