title: regionprops() is giving an error in matlab
body: <p>I'm using <code>regionprops()</code> but I'm getting an error with the following code:</p>
  
  <pre><code>J = imread('E:\Canopy New Exp\Data Set\input.jpg');
  I = rgb2gray(J);
  BW = regionprops(J,'basic');
  stats = regionprops('table',BW,'Centroid',...
       'MajorAxisLength','MinorAxisLength');
  centers = stats.Centroid;
  diameters = mean([stats.MajorAxisLength stats.MinorAxisLength],2);
  radii = diameters/2;
  
  hold on;
  viscircles(centers,radii);
  hold off;
  </code></pre>
  
  <p>But I'm getting the following error:</p>
  
  <pre><code>Error using regionprops
  Expected input number 1, L, to be one of these types:
  
  double, single, uint8, uint16, uint32, uint64, int8, int16, int32, int64
  
  Instead its type was char.
  
  Error in regionprops (line 142)
       validateattributes(L, {'numeric'}, ...
  
  Error in Untitled (line 8)
  stats = regionprops('table',BW,'Centroid',...
  </code></pre>
  
  <p>Any suggestions?</p>
  
  <p>Thanks in advance!</p>