how to use NMI for images
조회 수: 2 (최근 30일)
이전 댓글 표시
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
Walter Roberson
2020년 4월 4일
Replace
x = x-l+1;
y = y-l+1;
with
x = double(x-l+1);
y = double(y-l+1);
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!