Code Monkey home page Code Monkey logo

imagesimilarfinder's Introduction

ImageSimilarFinder

这个工具是为了在Android源码中快速找出相似的图片,并进一步进行优化,减少编译生成的img的大小。

首先感谢开源项目dHash:https://github.com/Jetsetter/dhash

比较图片的原理:

  1. 遍历指定文件中的所有图片,并按照长宽比进行归类。
  2. 在已归类好的图片文件夹中,计算每一张图的dHash(mode=hex),根据算出来的值进行排序。
  3. 计算dhash是按照指定的size,进行图片的缩放,然后对于缩放后的图的每一个像素点,进行两两比较,以0和1生成一个整型数值。
  4. 对排序好的图片,进行相邻两张图的两两比较,计算diff.

用法:

ImageSimilarFinder.py  -s 16 -t 20 -p /Users/zhangji/Downloads/SimilarResults -f frameworks packages

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.