After all Vision SDK APIs are executed, call MxDeInit() to deinitialize the initialized global resources.
For details about APIs, see API Reference (C++).
The following are the code samples of each initialization method, which are for reference only and cannot be directly copied for compilation or running.
APP_ERROR ret = MxInit();
{
// After global initialization, the Vision SDK APIs can be called normally.
...
// After all Vision SDK APIs are executed, call the deinitialization API to destroy global resources.
}
ret = MxDeInit();
1 2 3 4 5 6 7 8 9 10 | // Configure the operator preloading configuration file as required. std::string ConfigPath = "op.json"; // Transfer the file path to the API for global initialization. APP_ERROR ret = MxInitFromConfig(ConfigPath); { // After global initialization, the Vision SDK APIs can be called normally. ... // After all Vision SDK APIs are executed, call the deinitialization API to destroy global resources. } ret = MxDeInit(); |
1 2 3 4 5 6 7 8 9 | AppGlobalCfg globalCfg; APP_ERROR ret = MxInit(globalCfg); { // After global initialization, the Vision SDK APIs can be called normally. ... // After all Vision SDK APIs are executed, call the deinitialization API to destroy global resources. } ret = MxDeInit(); |