필터 지우기
필터 지우기

Foreground Detector - how do I save/load an existing background model?

조회 수: 2 (최근 30일)
Jonathan
Jonathan 2014년 10월 14일
댓글: Birju Patel 2018년 4월 16일
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.

채택된 답변

Birju Patel
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
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
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 CenterFile Exchange에서 Computer Vision Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by