Skip to content

Read CascadeClassifier from string in memory (instead of file) #1591

@alexsosa2000

Description

@alexsosa2000

Summary of your issue

I'm trying to do face detection in Blazor WebAssembly by using CascadeClassifier. The problem is it seems to only be able to initialize from a file (which can't be done in the browser). Therefore, I'm trying to figure out how to initialize CascadeClassifier from a string in memory (hardcoded XML).

I've seen other examples of people doing this like (C++ example):

CascadeClassifier cc;
FileStorage fs( the_whole_cascade_in_a_string, FileStorage::READ | FileStorage::MEMORY);
cc.read(fs.getFirstTopLevelNode());

Ref: https://answers.opencv.org/question/27970/cascadeclassifierload-from-memory/

The problem is there's no CascadeClassifer.Read() method that allows me to pass in FileStorage.GetFirstTopLevelNode().

Any idea on how to be able to initialize the CascadeClassifier from a string in memory?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requestedwontfix

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions