エッジ加工

19 visualizzazioni (ultimi 30 giorni)
大空
大空 il 23 Set 2022
Commentato: Atsushi Ueno il 18 Ott 2022
ファイル内にある画像をまとめてエッジ加工したいのですがどうすればよろしいでしょうか?
こちらを参考に加工したのですが写真一枚の加工しかわからなく

Risposta accettata

Atsushi Ueno
Atsushi Ueno il 23 Set 2022
>ファイル内にある画像をまとめてエッジ加工したいのですがどうすればよろしいでしょうか?
⇒「フォルダ内にある画像をまとめて」と解釈しました。フォルダが多重階層ではない場合で動作確認しました。
impath = uigetdir(pwd); % 画像が含まれるフォルダを選択する
imds = imageDatastore(impath); % イメージデータストア作成
imds.writeall(impath) % 選択フォルダ内にバックアップを作成しておく
for k = 1:length(imds.Files)
I = readimage(imds,k); % 画像を順番に読み込む
G = rgb2gray(I); % グレースケール画像に変換
BW1 = edge(G,'canny'); % エッジ検出画像に変換
imwrite(BW1,imds.Files{k}); % エッジ検出画像を書き込む
end
  3 Commenti
大空
大空 il 18 Ott 2022
Atsushi Ueno
Atsushi Ueno il 18 Ott 2022
https://jp.mathworks.com/help/images/edge-detection.html
こちらを参考に加工したのですが写真一枚の加工しかわからなく
との事だったので、必要なToolboxをお持ちだと思ってました。

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Convert Image Type in Help Center e File Exchange

Prodotti


Release

R2022a

Community Treasure Hunt

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

Start Hunting!