Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Tanimoto Coefficient using Matlab
Date: Sun, 4 Mar 2012 10:11:12 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <jivf40$bc3$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-04-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1330855872 11651 172.30.248.35 (4 Mar 2012 10:11:12 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 4 Mar 2012 10:11:12 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 3063614
Xref: news.mathworks.com comp.soft-sys.matlab:759783

I need to calculate Tanimoto Coefficient. I don't know what's wrong in my code. I have 2 nearly similar images. But the value obtained using my code indicates that the two images are highly dissimilar. Kindly help me with my code.

%Tanimoto coeff
I=imread('sliver3.jpg');
J=imread('ref5.jpg');
figure,imshow(I),title('Original');
figure,imshow(J),title('Reference');
inter=intersect(I,J,'rows');
uni=union(I,J,'rows');
si=size(inter);
su=size(uni);
tc=si/su