How can I get the correct output using the Auto threshold imagej Plugin?

8 visualizaciones (últimos 30 días)
Alaa
Alaa el 28 de Feb. de 2016
Comentada: Walter Roberson el 29 de Feb. de 2016
Hi every one, I have tried the following code, where I read an image from a directory and use ImageJ Auto Threshold plugin to segment my image. Any one can do that easily using imagej program as follow:
1- Open an image.
2- Then Go to : image->Adjust->Auto Threshold.
3- From methods drop list: Select the mean method.
4- Pick the white object on the black background.
My problem is I can't call this plugin correctly from Matlab. My Matlab code as follows:
javaaddpath 'C:\Program Files\MATLAB\R2013b\java\mij.jar'
javaaddpath 'C:\Program Files\MATLAB\R2013b\java\ij.jar'
MIJ.start
MIJ.run('Open...', 'path=[E:\\sun\\Endothelium Project\\Endothelium Code\\MIJ Code\\ENDOTHELIAL IMAGES\\12.bmp]');
MIJ.run('Threshold...','setAutoThreshold=mean');
MIJ.run('setOption=BlackBackground');
MIJ.run('Convert to Mask');
SegmentedImage = (VorImage);
figure, imshow(SegmentedImage);
Thank you in advance.
  1 comentario
Walter Roberson
Walter Roberson el 29 de Feb. de 2016
Your line
SegmentedImage = (VorImage);
is suspicious. If you are attempting to retrieve data from MIJ then you would need a reference to MIJ there. For example it might look something like
SegmentedImage = MIJ.VorImage;

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Read, Write, and Modify Image 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!

Translated by