When trying to use imageSegmenter with a a uint8 from the workspace or from file, I get a strange error.

1 次查看(过去 30 天)
So I have a very simple code:
clear
clc
close all
I = imread('Ji2013t.PNG');
figure
imagesc(I)
axis equal
%%imdistline 100 microns = 30 pixels
Ic = I(1:135,142:end,:);
Ic = (Ic);
figure
imagesc(Ic)
axis equal
imageSegmenter(Ic);
And MATLAB 2017b runs all of this fine. However, when it opens the ImaeSegmenter App, it throws a ton of red, with the message:
57 imageLoadSuccess = self.Toolstrip.loadImageInSegmentTab(im);
Warning: The following error was caught while executing
'iptui.internal.segmenter.TwoMaskScrollPanel' class destructor:
Undefined function 'isvalid' for input arguments of type 'double'.
Error in iptui.internal.segmenter.TwoMaskScrollPanel/delete (line
221)
if isvalid(self.hFig)
Error in iptui.internal.segmenter.TwoMaskScrollPanel (line 36)
function self = TwoMaskScrollPanel(im)
Error in
iptui.internal.segmenter.ImageSegmentationTool/buildScrollPanel
(line 590)
self.ScrollPanel =
iptui.internal.segmenter.TwoMaskScrollPanel(im);
Error in
iptui.internal.segmenter.ImageSegmentationTool/createSessionFromImage
(line 89)
self.buildScrollPanel(im);
Error in iptui.internal.segmenter.SegmentTab/importImageData (line
202)
self.hApp.createSessionFromImage(im,
self.IsDataNormalized, self.IsInfNanRemoved);
Error in iptui.internal.segmenter.Toolstrip/loadImageInSegmentTab
(line 100)
TF = self.hSegmentTab.importImageData(im);
Error in iptui.internal.segmenter.ImageSegmentationTool (line 57)
imageLoadSuccess =
self.Toolstrip.loadImageInSegmentTab(im);
Error in imageSegmenter (line 46)
iptui.internal.segmenter.ImageSegmentationTool(I,isRGB);
Error in Ji2013 (line 18)
imageSegmenter(Ic);
> In iptui.internal.segmenter.TwoMaskScrollPanel (line 36)
In iptui.internal.segmenter.ImageSegmentationTool/buildScrollPanel (line 590)
In iptui.internal.segmenter.ImageSegmentationTool/createSessionFromImage (line 89)
In iptui.internal.segmenter.SegmentTab/importImageData (line 202)
In iptui.internal.segmenter.Toolstrip/loadImageInSegmentTab (line 100)
In iptui.internal.segmenter.ImageSegmentationTool (line 57)
In imageSegmenter (line 46)
In Ji2013 (line 18)
Error using figure
Value must be either:
an Mx3 array of type single or double in the range [0 1]
an Mx3 array of type uint8
Error in iptui.internal.segmenter.TwoMaskScrollPanel (line 43)
self.hFig = figure(...
Error in
iptui.internal.segmenter.ImageSegmentationTool/buildScrollPanel
(line 590)
self.ScrollPanel =
iptui.internal.segmenter.TwoMaskScrollPanel(im);
Error in
iptui.internal.segmenter.ImageSegmentationTool/createSessionFromImage
(line 89)
self.buildScrollPanel(im);
Error in iptui.internal.segmenter.SegmentTab/importImageData (line
202)
self.hApp.createSessionFromImage(im,
self.IsDataNormalized, self.IsInfNanRemoved);
Error in iptui.internal.segmenter.Toolstrip/loadImageInSegmentTab
(line 100)
TF = self.hSegmentTab.importImageData(im);
Error in iptui.internal.segmenter.ImageSegmentationTool (line 57)
imageLoadSuccess =
self.Toolstrip.loadImageInSegmentTab(im);
Error in imageSegmenter (line 46)
iptui.internal.segmenter.ImageSegmentationTool(I,isRGB);
Error in Ji2013 (line 18)
imageSegmenter(Ic);
I have never experienced this kind of error from MATLAB. I'm ussually prett aware of any errors I can make, but I have no clue for this one. I tried to convert my uint8 to double using double(Ic), but that failed too. I tried to upload from file, same error, I tried different images, no go, I even tried to debug the function iptui.internal.segmenter.ImageSegmentationTool(I,isRGB), and got to:
imageLoadSuccess = self.Toolstrip.loadImageInSegmentTab(im);
However, when trying to go into loadImageInSegment, I run int problems as it is either JAVA or C++ code and MATLAB can't find it.
Any help would be useful.
Sincerely
Alex
  1 个评论
Alexander Dumont
Alexander Dumont 2020-1-27
After further digging, I determined that line 221 of function 'iptui.internal.segmenter.TwoMaskScrollPanel' is the error. The function isvalid does not seem to be defined. Very strange.

请先登录,再进行评论。

采纳的回答

Harsha Priya Daggubati
Hi
I tried reproducing the issue in 2017b version, but everything works fine for me. I suggest to use the following commands and run the code again.
rehash toolbox
rehash toolboxcache
Hope this works!

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Objects 的更多信息

产品


版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by