目次
Table of Contents |
---|
準備-クラスタ構成
1. クラスタープロファイルマネージャーの表示
...
クラスタープロファイルの検証をクリックします。その後、ユーザー名とパスワードが聞かれます。
クラスタの検証が成功すると、以下のようになります。
...
演習
解析するファイルの準備
...
Coding files>Block Process On Large Imageファイルのinput_img.ngをC:\Users\ユーザー名\Documents\MATLABに移す。
...
移動したファイルが画像左の現在のフォルダーに表示されていれば成功。
...
クラスタープロファイルの切り替え(localとa9 Server)
localとa9 Serverの切り替えは、それぞれのクラスタープロファイルについて既定の設定を切り替えて行います。
...
並列処理ありとなしの切り替え
並列処理ありとなしの切り替えは、コマンドにおける'UseParallel',trueを'UseParallel',falseに書き換える。
並列処理あり
Code Block |
---|
tic % Start stopwatch timer
% Input image
input_img = "input_img.jpg"; % Add image path
% Initialize Edge detection function
fun = @(block_struct) edge(block_struct.data,"canny");
% Covert source image from RGB to GRAY
input_image= rgb2gray(imread(input_img));
% Perform Parallel Block Process
result = blockproc(input_image,[25 25],fun, ...
'UseParallel',true);
toc % Terminate stopwatch timer
% Show ouput image
imshow(result) |
並列処理なし
Code Block |
---|
tic % Start stopwatch timer
% Input image
input_img = "input_img.jpg"; % Add image path
% Initialize Edge detection function
fun = @(block_struct) edge(block_struct.data,"canny");
% Covert source image from RGB to GRAY
input_image= rgb2gray(imread(input_img));
% Perform Parallel Block Process
result = blockproc(input_image,[25 25],fun, ...
'UseParallel',false);
toc % Terminate stopwatch timer
% Show ouput image
imshow(result |
...
演習1:大きな画像に対するブロック処理
並列処理ありの場合
Code Block tic % Start stopwatch timer % Input image input_img = "input_img.jpg"; % Add image path % Initialize Edge detection function fun = @(block_struct) edge(block_struct.data,"canny"); % Covert source image from RGB to GRAY input_image= rgb2gray(imread(input_img)); % Perform Parallel Block Process result = blockproc(input_image,[25 25],fun, ... 'UseParallel',true); toc % Terminate stopwatch timer % Show ouput image imshow(result)
並列処理なしの場合
Code Block tic % Start stopwatch timer % Input image input_img = "input_img.jpg"; % Add image path % Initialize Edge detection function fun = @(block_struct) edge(block_struct.data,"canny"); % Covert source image from RGB to GRAY input_image= rgb2gray(imread(input_img)); % Perform Parallel Block Process result = blockproc(input_image,[25 25],fun, ... 'UseParallel',false); toc % Terminate stopwatch timer % Show ouput image imshow(result
...