图像相似性搜刮的道理
发布时间:2021-05-14 19:53:24 所属栏目:大数据 来源:网络整理
导读:本文转自: http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html http://www.voidcn.com/article/p-nvcdxgfv-bnx.html http://blog.sina.com.cn/s/blog_b27f71160101gp9c.html http://www.voidcn.com/article/p-ojqegjmq-wy.html
关于均值哈希算法的实现,请参考:Google?以图搜图?-?相似图片搜刮道理?-?Java实现http://blog.csdn.net/luoweifu/article/details/7733030
%http://blog.sina.com.cn/s/blog_b27f71160101gp9c.html %输入两幅图片,返回值为它们的为汉明间隔。 %相似图片搜刮道理:均匀哈希算法 %对两幅图别离作如下处理赏罚: %1:将两副256品级的灰度图像转化成8x8巨细的64品级的灰度图像 %2:叱责局灰度均匀值 %3:逐次将灰度值与均匀灰度值较量,大于便是的置为1,不然置为0 %4:将0、1序列看做8个字节(同一次序) %5:较量两幅图的数据位,假如差异的数据为不高出5位,则很是相似,若高出10为则以为两幅图无关 function v=tineyesearch_ahash(picture1,picture2) t1=imresize(picture1,[8 8],'bicubic'); %图片放缩到牢靠巨细 t2=imresize(picture2,'bicubic'); %图片放缩到牢靠巨细 t1=round(t1/4); t2=round(t2/4); mem1=round(sum(sum(t1))/64); mem2=round(sum(sum(t2))/64); for i=1:8 for j=1:8 if t1(i,j)>=mem1 t1(i,j)=1; else t1(i,j)=0; end if t2(i,j)>=mem2 t2(i,j)=1; else t2(i,j)=0; end end end h=abs(t1-t2); v=sum(sum(h)); (编辑:湖南网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |