matlab code for image segmentation in HSL

hello , i am trying to get the result stated in the figure 6.42 ( e,f,h )in rafael gonzalez digital image processing third edition book
thanks a lot ,,

 採用された回答

yanqi liu
yanqi liu 2021 年 12 月 15 日

0 投票

yes,sir,may be use
clc; clear all; close all;
img = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/834275/image.png');
im = imcrop(img, [205 5 265 140]);
hsv = rgb2hsv(im);
h = mat2gray(hsv(:,:,1));
s = mat2gray(hsv(:,:,2));
v = mat2gray(hsv(:,:,3));
figure;
subplot(4, 2, 1); imshow(im);
subplot(4, 2, 2); imshow(h);
subplot(4, 2, 3); imshow(s);
subplot(4, 2, 4); imshow(v);
e = im2bw(s, graythresh(s));
subplot(4, 2, 5); imshow(e);
f = im2uint8(mat2gray(h.*double(e)));
subplot(4, 2, 6); imshow(f,[]);
subplot(4, 2, 7); imhist(f);
h = im2bw(f, graythresh(f));
subplot(4, 2, 8); imshow(h);

1 件のコメント

aziz alfares
aziz alfares 2021 年 12 月 15 日
Thanks a lot for your answer

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeImages についてさらに検索

製品

リリース

R2019b

質問済み:

2021 年 12 月 14 日

コメント済み:

2021 年 12 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by