index exceeds matrix dimensions
Mostrar comentarios más antiguos
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 comentario
Walter Roberson
el 14 de Jun. de 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.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Image Segmentation en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

