フォルダでのSSIM算出について
11 views (last 30 days)
Show older comments
Reference画像に対して複数枚の画像(比較画像)と
ssimを行う場合に教えて頂い下記のコードを使用しています。
% 参照画像読み込み
>> I = imread('cameraman.tif');
% imgs フォルダには 複数枚の画像が入っていると仮定します
% イメージデータストアの作成
>> imds = imageDatastore('imgs');
% ReadFcn で ssim() 関数を実行 (ファイルを読み込む時点でReadFcnが実行される)
>> imds.ReadFcn = @(filename) ssim(I, imread(filename))
% imgsフォルダ内の画像群に対して ssim() を実行
>> readall(imds)
今回はReference画像の1~10と比較画像1~10のSSIM算出を一括で行いたい考えています。
※全部で10この結果を求めたいと思っています。
Reference画像と比較画像のフォルダを作成して比較したいと考えていますが、よくわかりません。
フォルダ同士でのSSIM算出方法についてご教示頂けると助かります。
何卒よろしくお願い申し上げます。
0 Comments
Accepted Answer
Shunichi Kusano
on 24 Mar 2022
複数のデータセットを"ペア"として使いたい場合は、combinedDatastoreという仕組みが使えるかと思います。コードのイメージは次のようになります。
% 各画像フォルダのデータストアを作成
imds1 = imageDatastore('folder1');
imds2 = imageDatastore('folder2');
% combinedDatastoreを作成
cds = combine(imds1,imds2);
% 下記をデータセット分繰り返す
% データをペアで読み込む
data = read(cds);
% SSIMによる評価値を算出
value = ssim(data{1},data{2});
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!