Gordon
Posts:
6
Registered:
3/28/12
|
|
Re: vision.ForegroundDetector on Images
Posted:
Mar 29, 2012 6:56 AM
|
|
Hi,
Sorry to bother again. Can you please show me how I can modify this code to draw boxes around the detected objects in the images please?
Thanks so much for your time!
"Gordon" wrote in message <jkvcvs$t4k$1@newscl01ah.mathworks.com>... > Thanks a lot! Your help is greatly appreciated. > > witek@mathworks.com wrote in message <jkvavm$j01$1@newscl01ah.mathworks.com>... > > 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.
|
|