To calculate the structure tensor eigenvalues of an image in Matlab, you can use the structureTensorEigenvalues
function from the Computer Vision System Toolbox. Here's an example:
main.m387 chars13 lines
In this example, we first read in the image using imread
. Then, we specify the gradient type we want to use (in this case, the Prewitt filter) in the opts
structure. Finally, we pass the image and opts
to structureTensorEigenvalues
to obtain the eigenvalues, which are stored in E1
and E2
. We then display the original image and the two eigenvalues using imshow
. The []
argument in imshow
tells Matlab to automatically scale the pixel values to the full range of the display.
gistlibby LogSnag