title: Matlab vision.blobAnalysis bbox area-center usage
body: <p>I am using this code in the below.</p>
  
  <pre><code>  function videoAnalysis()
  foregroundDetector = vision.ForegroundDetector('NumGaussians', 3, 'NumTrainingFrames', 50);
  
  [filename, pathname] = uigetfile( ...
      {'*.*',  'All Files (*.*)'}, ...
      'Select a video file');
  
  videoReader = vision.VideoFileReader(fullfile(pathname,filename));
  % fRate = videoReader.info.VideoFrameRate;
  % disp(fRate);
  
  for i = 1:150
      frame = step(videoReader);
      foreground = step(foregroundDetector, frame);
  end
  se = strel('square', 3);
  filteredForeground = imopen(foreground, se);
  
  blobAnalysis = vision.BlobAnalysis('BoundingBoxOutputPort', true, ...
      'AreaOutputPort', false, 'CentroidOutputPort', false, ...
      'MinimumBlobArea', 350 , 'MaximumBlobArea', 15000, ...
      'MajorAxisLengthOutputPort' , true, 'MaximumCount', 5);
  
  bbox = step(blobAnalysis, filteredForeground);
  
  result = insertShape(frame, 'Rectangle', bbox, 'Color', 'green');
  
  numCars = size(bbox, 1);
  result = insertText(result, [10 10], numCars, 'BoxOpacity', 1, 'FontSize', 14);
  
  videoPlayer = vision.VideoPlayer('Name', 'Detected Cars');
  
  videoPlayer.Position(3:4) = [650,400];  % window size: [width, height]
  % se = strel('square', 3); % morphological filter for noise removal
  
  i = 0;
  while ~isDone(videoReader)
  %     if ( mode(i,10) == 0 )
  %         disp(i);
  %     end
  %     i = i + 1;
      frame = step(videoReader); % read the next video frame
  
      % Detect the foreground in the current video frame
      foreground = step(foregroundDetector, frame);
  
      % Use morphological opening to remove noise in the foreground
      filteredForeground = imopen(foreground, se);
  
      % Detect the connected components with the specified minimum area, and
      % compute their bounding boxes
      bbox = step(blobAnalysis, filteredForeground);
  
      % Draw bounding boxes around the detected cars
      result = insertShape(frame, 'Rectangle', bbox, 'Color', 'blue');
  %     imshow(result);
  %     
  
      % Display the number of cars found in the video frame
      numCars = size(bbox, 1);
      result = insertText(result, [10 10], numCars, 'BoxOpacity', 1, 'FontSize', 14);
  
      %if there is moving object
      if numCars == 0
          result = insertText(result, [100 20], 'You can pass now', 'BoxOpacity', 1, 'FontSize', 14, 'BoxColor', 'green');
      else
          result = insertText(result, [100 20], 'Please wait', 'BoxOpacity', 1, 'FontSize', 14, 'BoxColor', 'red');
      end
  
      step(videoPlayer, result);  % display
  end
  
  release(videoReader); % close
  
  end
  </code></pre>
  
  <p>Basically code looks for a video and detects the moving object between video frames and draw bounding boxes around changed pixels. I need these bounding boxes' center and area informations. To do that I assume I have to change AreaOutputPort and CentroidOutputPort parameters in blobAnalysis to TRUE. But if I do that Matlab gives error: <em>The POSITION matrix must have four columns for shape Rectangle</em>.
  How can I obtain these values?</p>
  
  <p>Thank you.</p>