Foreground Detector - how do I save/load an existing background model?
4 次查看(过去 30 天)
显示 更早的评论
Hi all, I am trying to come up with a way of saving and re-loading the Gaussian mixture model generated by the vision.ForegroundDetector. Basically I want to be able to:
- Run the foreground detector
- Train it on an empty scene to learn the background of the scene
- SAVE this trained foreground detector so that I can use it in the future without re-training
- LOAD this trained foreground detector and use it on new data.
Would anyone have any idea how this can be done? I have tried saving and loading a trained foreground detector instance to/from a .mat file, but all this does it copy the public properties, and does not appear to save the trained model. If I can't get this to work I will need to completely change my approach, this is literally the last step in what I am needing to do. Your help would be really, really appreciated.
0 个评论
采纳的回答
Birju Patel
2014-10-14
Hi,
You'll need to execute:
feature('SystemObjectsFullSaveLoad',1);
to enable the save/load to work correctly for vision.ForegroundDetector. You should use that command right before you call SAVE on the vision.ForegroundDetector object.
Also, you should save the “locked” object (i.e. do not call release prior to saving). You can execute the isLocked method on the vision.ForegroundDetector object to check if it's locked or not.
Hope that helps.
3 个评论
Keir Bowater
2018-4-7
Birju, has feature('SystemObjectsFullSaveLoad',1) been deprecated in more recent versions of MATLAB? I searched the documentation and couldn't find any new function to allow the same thing. If I run feature('SystemObjectsFullSaveLoad',1);, MATLAB throws an error: Error using feature Feature SystemObjectsFullSaveLoad not found.
Birju Patel
2018-4-16
Hi Keir,
You don't need to enable the SystemObjectsFullSaveLoad feature any longer. Saving and loading the vision.ForegroundDetector should work without it.
The command errors out now because that feature keyword has been removed.
Birju
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Computer Vision with Simulink 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!