Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: vision.ForegroundDetector on Images
Replies: 12   Last Post: Feb 28, 2014 5:41 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Witek Jachimczyk

Posts: 132
Registered: 12/7/04
Re: vision.ForegroundDetector on Images
Posted: Mar 28, 2012 11:33 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi Gordon,

We'll consider adding an object like this in the future.
In the meantime, you can use the following strategy:

imageNames = dir(fullfile(<your directory>,'*.jpg'));
imageNames = {imageNames.name}';

% you may need to sort the file names at this point in time, see
% http://www.mathworks.com/products/matlab/demos.html?file=/products/demos/shipping/matlab/imagesAndVideo.html#16
% for details

foregroundEst = vision.ForegroundEstimator;

for ii = 1:length(imageNames)
img = imread(fullfile(workingDir,'images',imageNames{ii}));

fg = foregroundEst.step(img);

<do whatever else needs to be done>

end

HTH,

Witek


Gordon <gordon.aguis91@gmail.com> wrote:
> Thanks a lot! Yes, my data changes with time, it is like a video sequence but it is made up of images.
> I was wondering whether there exists something like vision.VideoFileReader() but for images instead.
>
> Thanks.




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.