Under the "Detect Coins" paragraph in the "Measuring Planar Objects using a calibrated camera" example, the lines:
[areas, boxes] = step(blobAnalysis, imCoin);% Sort connected components in descending order by area[~, idx] = sort(areas, 'Descend');% Get the two largest components.boxes = double(boxes(idx(1:2), :));% Adjust for coordinate system shift caused by undistortImageboxes(:, 1:2) = bsxfun(@plus, boxes(:, 1:2), newOrigin);
I am uncertain of what the brackets, after the second occurrence of idx, are trying to define. I am trying to apply this to my own image and it gives me an error which states: Index exceeds matrix dimensions. Could someone please clarify this for me?