Image Segmenter - how to load grayscale image from workspace correctly?

4 ビュー (過去 30 日間)
Veronika Poláková
Veronika Poláková 2018 年 12 月 6 日
編集済み: Veronika Poláková 2018 年 12 月 18 日
Hello, I would like to segment grayscale image (uint16) in Image Segmenter app (Matlab R2018a academic use).
grayscale.jpg
However, when I load it from workspace, I see only a black image, where I can´t recognize anything.
black.jpg
I think that the problem is that the app shows the image like imshow(picture) instead of imshow(picture,[ ]). Is it possible to change it? Or is there any other way how to solve the problem?
Thanks in advance.

採用された回答

Sharon He
Sharon He 2018 年 12 月 17 日
Hi Veronika,
Here is the steps I tried, and I am able to have the image displayed in the app.
  1. I download the image you uploaded, and it is a 'jfif' file.
  2. type the following code in the matlab command line:
img = imread('C:\Users\Downloads\sample.jfif');
img = rgb2gray(img); % convert the rgb image to gray image; this line should be omitted if your image is already a gray image;
imageSegmenter(img)
Please let me know if you have any questions.
Thanks,
Sharon
  3 件のコメント
Sharon He
Sharon He 2018 年 12 月 18 日
One way to get around this problem is to convert the unit16 datatype to double:
img = dicomread('I10');
imageSegmenter(double(img))
Veronika Poláková
Veronika Poláková 2018 年 12 月 18 日
編集済み: Veronika Poláková 2018 年 12 月 18 日
If I allow normalizing the image it works. Thanks.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by