エッジ加工
    1 view (last 30 days)
  
       Show older comments
    
ファイル内にある画像をまとめてエッジ加工したいのですがどうすればよろしいでしょうか?
こちらを参考に加工したのですが写真一枚の加工しかわからなく
0 Comments
Accepted Answer
  Atsushi Ueno
      
 on 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 Comments
  Atsushi Ueno
      
 on 18 Oct 2022
				https://jp.mathworks.com/help/images/edge-detection.html
こちらを参考に加工したのですが写真一枚の加工しかわからなく
との事だったので、必要なToolboxをお持ちだと思ってました。
More Answers (0)
See Also
Categories
				Find more on オブジェクト解析 in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

