Clarification of idx in Planar Object Measuring tutorial
이전 댓글 표시
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 undistortImage
boxes(:, 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?
댓글 수: 2
Guillaume
2015년 7월 3일
Could you provide a link to the tutorial you mention? You can right click on the page in the help browser and select Get Page Address.
Kasia Hearn
2015년 7월 3일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Image Processing and Computer Vision에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!