Skip to content

Commit

Permalink
課題8の追加
Browse files Browse the repository at this point in the history
  • Loading branch information
mackhasegawa committed Nov 30, 2015
1 parent dc15a7f commit 0cea7bf
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions kadai8.m
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;

0 comments on commit 0cea7bf

Please sign in to comment.