forked from mackhasegawa/lecture_image_processing
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dc15a7f
commit 0cea7bf
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
% 課題8 ラベリング | ||
% 二値化された画像の連結成分にラベルをつけよ. | ||
% 下記はサンプルプログラムである. | ||
% 課題作成にあたっては「Lenna」以外の画像を用いよ. | ||
% 例 | ||
|
||
ORG = imread('Lenna.jpg'); % 画像の読み込み | ||
ORG = rgb2gray(ORG); % 白黒濃淡画像に変換 | ||
imagesc(ORG); colormap(gray); colorbar; % 画像の表示 | ||
pause; | ||
IMG = ORG > 128; % 閾値128で二値化 | ||
imagesc(IMG); colormap(gray); colorbar; % 画像の表示 | ||
pause; | ||
IMG = bwlabeln(IMG); | ||
imagesc(IMG); colormap(jet); colorbar; % 画像の表示 | ||
pause; |