Effacer les filtres
Effacer les filtres

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

2 vues (au cours des 30 derniers jours)
Alaa
Alaa le 28 Fév 2016
Commenté : Walter Roberson le 29 Fév 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 commentaire
Walter Roberson
Walter Roberson le 29 Fév 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;

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by