how can I save/load vision.For​egroundDet​ector object?

조회 수: 5 (최근 30일)
Evgeny
Evgeny 2015년 1월 12일
댓글: Birju Patel 2015년 1월 13일
This was already asked here http://www.mathworks.com/matlabcentral/answers/158594-foreground-detector-how-do-i-save-load-an-existing-background-model, but the solution doesn't work for me on R2014a or R2014b. Here is what I did:
clear all
% init model
detector = vision.ForegroundDetector();
% train model
image = imread ('frame0.png');
step(detector, image);
image = imread ('frame1.png');
step(detector, image);
% save the trained model
feature('SystemObjectsFullSaveLoad',1);
save('detector.mat', 'detector');
% clear and load the trained model
clear all
load('detector.mat');
% try to use
image = imread ('frame0.png');
mask = step(detector, image); % this crashes matlab
At the last line, Matlab crashes with a segmentation fault. Is it a bug or is there some other function to call prior to saving?
  댓글 수: 2
Birju Patel
Birju Patel 2015년 1월 13일
Hi,
I tried on both R2014a and R2014b and I couldn't reproduce the segmentation fault.
Do you have the stack trace from the seg fault? That might help determine where the problem is coming from.
Birju Patel
Birju Patel 2015년 1월 13일
Also, can you post the images you used (frame0,frame1)? They might be required to reproduce the issue.

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2015년 1월 13일
Any serious problem like a segmentation fault where the entire MATLAB development shuts down unexpectedly should be reported to the Mathworks.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing and Computer Vision에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by