エッジ加工
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
大空
am 23 Sep. 2022
Kommentiert: Atsushi Ueno
am 18 Okt. 2022
ファイル内にある画像をまとめてエッジ加工したいのですがどうすればよろしいでしょうか?
こちらを参考に加工したのですが写真一枚の加工しかわからなく
0 Kommentare
Akzeptierte Antwort
Atsushi Ueno
am 23 Sep. 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 Kommentare
Atsushi Ueno
am 18 Okt. 2022
https://jp.mathworks.com/help/images/edge-detection.html
こちらを参考に加工したのですが写真一枚の加工しかわからなく
との事だったので、必要なToolboxをお持ちだと思ってました。
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Convert Image Type finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!