Filter löschen
Filter löschen

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

2 Ansichten (letzte 30 Tage)
Alaa
Alaa am 28 Feb. 2016
Kommentiert: Walter Roberson am 29 Feb. 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 Kommentar
Walter Roberson
Walter Roberson am 29 Feb. 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;

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by