imregionalmax to find peaks in 3d. I get an error Index exceeds matrix dimensions.
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
OldCar
el 11 de Abr. de 2016
Comentada: Image Analyst
el 15 de Abr. de 2016
As said in the title I have got an error using imregionalmax. I have two monotone variable xVec, yVec and a third dependent variable imageMag that is experimental value. imageMag is 31x593. I have used
x=xVec;
y=yVec;
z=imageMag;
mesh(x,y,z,'FaceColor','interp')
ix = find(imregionalmax(z));
hold on
plot3(x(ix),y(ix),z(ix),'r*','MarkerSize',24)
but it says that index exceeds matrix dimensions. Why?
Respuesta aceptada
Mike Garrity
el 11 de Abr. de 2016
Editada: Mike Garrity
el 11 de Abr. de 2016
I'm just guessing, but that code snippet is assuming that x & y are full, 2D arrays. The mesh function allows for another case where they're vectors. From the name of your variables, I would guess that you've got that case.
[x,y] = meshgrid(xVec,yVec);
z = imageMag;
mesh(x,y,z,'FaceColor','interp')
ix = find(imregionalmax(z));
hold on
plot3(x(ix),y(ix),z(ix),'r*','MarkerSize',24)
2 comentarios
Image Analyst
el 15 de Abr. de 2016
imregionalmax is meant to work with a volumetric image in 3D, not 1-D vectors.
Más respuestas (0)
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!