Centroid Analysis on frames in a video

1 view (last 30 days)
Ali
Ali on 22 Apr 2014
Commented: Image Analyst on 23 Apr 2014
Hi, Im working on a project right now, Ive got background subtraction working and some blob analysis. My problem is that once ive got my centroids I want to raise a warning if they are at a certain height in the image, and if they are there for a certain amount frames then raise a warning. Whats the best way of doing this?

Answers (1)

Image Analyst
Image Analyst on 22 Apr 2014
I did that (almost) just a few days ago for Yassine. Look here for the code: http://www.mathworks.com/matlabcentral/answers/126287#comment_208962. It finds the centroids on all the frames. You just need to add some code like
if row < certainHeight
warningMessage = sprintf('Warning: Object is at height %d, which is above %d, in frame #%d', row, certainHeight, frame);
uiwait(warndlg(warningMessage));
end
  10 Comments
Ali
Ali on 23 Apr 2014
sorry, should have posted the whole error message.
Warning, person is possibly falling. Please check status ImmediatelyError using dialogCellstrHelper Expected input to be one of these types:
char, cell
Instead its type was double.
Error in dialogCellstrHelper (line 10) validateattributes(inputStr, {'char','cell'}, {'2d'},mfilename);
Error in warndlg (line 38) WarnStringCell = dialogCellstrHelper(WarnString);
Error in BGS7 (line 96) uiwait(warndlg(warningMessage));
Image Analyst
Image Analyst on 23 Apr 2014
fprintf() does not produce a string. Use sprintf instead.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!