index exceeds matrix dimensions
Afficher commentaires plus anciens
I am tring to code the parallelogram haar like features and while calculating the sum of intensities in the parallelogram region I get this error.
labeledImage = bwlabel(TP1);
measurements = regionprops(labeledImage, 'BoundingBox');
allBB = zeros(length(measurements), 4);
for k = 1 : length(measurements)
thisBB = round(measurements(k).BoundingBox);
allBB(k, :) = thisBB;
[x, y, w1, h1] = deal(thisBB(1),thisBB(2),thisBB(3),thisBB(4));
end
SP1 = TP1(y+h1-1,-(x+w1-h1)) + TP1(-(x-h1),y+h1-1) - TP1(x+w1,y-1) - TP1(x,y-1); % (ERROR LINE)
if any one is getting my point than kindly help me.
1 commentaire
Walter Roberson
le 14 Juin 2019
When you put in a breakpoint at the assignment to SP1, then what shows up as the values of x, y, w1, h1, and what shows up as size(TP1) ?
Note that you are overwriting x, y, w1, h1 at each iteration of the for k loop, so your assignment to SP1 uses the final values that x y w1 h1 happened to get set to.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Image Segmentation dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

