2枚の画像に対してブロックごとにSSIMを出したい
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
2枚の入力画像(300×300)に対し、10×10のブロックごとにSSIMを出し、入力画像のどこのブロックに差があるのかを出力したいと考えています。
画像に対するブロックごとの処理ということでblockprocを用いて行おうとしましたが、入力が2つあるため上手く実装することができませんでした。
この場合、どのように実装すればよろしいでしょうか?
0 commentaires
Réponse acceptée
Atsushi Ueno
le 4 Août 2021
2枚のデータ(2次元)を3次元方向に重ねれば、まとめてblockproc関数に渡す事が出来ます。
star = rgb2gray(imread('star.png'));
circle = rgb2gray(imread('circle.png'));
stacks = cat(3,star,circle); % 2枚の入力画像を1変数に重ねる
fun = @(block_struct) ssim(block_struct.data(:,:,1),block_struct.data(:,:,2));
ssimvals = blockproc(stacks,[10 10],fun); % 10×10のブロックごとにSSIMを出す
imshow(ssimvals); % 30×30のSSIM値を試しに画像として表示してみる
検証用に準備した2枚の入力画像(300×300)は、適当な絵(〇と☆)で類似性は全くありません。
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Display Point Clouds dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!