unable to run the label overlay of original and labeled image for data training on matlab

1 回表示 (過去 30 日間)
eten hyle
eten hyle 2023 年 8 月 23 日
コメント済み: Image Analyst 2023 年 8 月 23 日
i want to train the data using vgg16,which expects input in rgb.
first i changed the graylevel mri images to rgb using the command ,rgbImage = ind2rgb(x, gray(256));
then i labeled the image using image labler on matlab,then the pixellabeldata is stored in png format,and i don't know why but the labeled image adjusted itself in graylevel and png format,when i tried to convert the pixellabeldata in to rgb using rgbImage = ind2rgb(x, gray(256));,command but the labeloverlay returns error saying.Error in labeloverlay>parseInputs (line 150)
validateattributes(Ldouble,allowedTypes,{'integer','nonsparse','real','nonnegative','nonempty','ndims',2},mfilename);
Error in labeloverlay (line 88)
parsedInputs = parseInputs(varargin{:});
Error in viewmask (line 23)
labeloverlayImg = labeloverlay(img, label
what is the problem is that because try to convert labeled image to rgb?can i simply apply the rgb image and the pixellabel image which adjusted itself to png and graylevel format for inputing on vgg16 or what is the solution

回答 (1 件)

Image Analyst
Image Analyst 2023 年 8 月 23 日
I'm not sure what your x is, but something like this works fine:
x = imread('moon.tif'); % x is a gray scale image.
rgbImage = ind2rgb(x, gray(256));
Alternatively you can do this:
rgbImage = cat(3, x, x, x);
  2 件のコメント
eten hyle
eten hyle 2023 年 8 月 23 日
i already tried it ,i apply the above command the labeled image converted to rgb but when i run the labeloverlay(labeloverlayImg = labeloverlay(img, label); it returns error
Error in labeloverlay>parseInputs (line 150)
validateattributes(Ldouble,allowedTypes,{'integer','nonsparse','real','nonnegative','nonempty','ndims',2},mfilename);
Error in labeloverlay (line 88)
parsedInputs = parseInputs(varargin{:});
Error in viewmask (line 23)
labeloverlayImg = labeloverlay(img, label
Image Analyst
Image Analyst 2023 年 8 月 23 日
This does not look like the correct syntax:
labeloverlay(labeloverlayImg = labeloverlay(img, label);
Check it.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeImage Processing and Computer Vision についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by