PHP实现搜索相似图片

(编辑:jimmy 日期: 2024/9/30 浏览:2)

感知哈希算法

count < =5 匹配最相似
count > 10 两张不同的图片
var_dump(ImageHash::run(‘./1.png', ‘./psb.jpg'));

<"htmlcode">
hash($f);
 }
 return $isString "htmlcode">
 
require_once "Imghash.class.php";
$instance = ImgHash::getInstance();
$result = $instance->checkIsSimilarImg('chenyin/IMG_3214.png', 'chenyin/IMG_3212.JPG');

如果$result值为true, 则表明2个图片相似,否则不相似。