how to use NMI for images
Mostra commenti meno recenti
hi every body. I am trying to use nmi.m which is attached below and downloaded from mathworks to calculate normalized mutual information between to images.
x=rgb2gray(imread('a.jpg'));
y=rgb2gray(imread('b.jpg'));
z = nmi(x, y);
but i have this error:
Error using sparse
Index into matrix must be an integer.
Error in nmi (line 19)
Mx = sparse(idx,x,1,n,k,n);
could anyone solve this error for me?
6 Commenti
Walter Roberson
il 4 Apr 2020
After you create x and y, please show class(x) and class(y), and also min(unique(diff([x(:);y(:)])))
talayeh ghodsi
il 4 Apr 2020
Walter Roberson
il 4 Apr 2020
What showed up for
min(unique(diff([x(:);y(:)])))
?
Also please show min(x(:)), max(x(:))
talayeh ghodsi
il 4 Apr 2020
Walter Roberson
il 4 Apr 2020
Replace
x = x-l+1;
y = y-l+1;
with
x = double(x-l+1);
y = double(y-l+1);
talayeh ghodsi
il 4 Apr 2020
Risposte (0)
Categorie
Scopri di più su Image Arithmetic in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!