Clarification of idx in Planar Object Measuring tutorial
Mostra commenti meno recenti
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 Commenti
Guillaume
il 3 Lug 2015
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
il 3 Lug 2015
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Image Processing and Computer Vision in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!