Coder Social home page Coder Social logo

imagerecognition's Introduction

ImageRecognition

这是一个图片识别项目,主要用于识别两张图片的相似度。 识别算法比较简单,就是遍历比较两张图片的所有像素点的灰度值, 然后比较这两个像素的灰度值差是否在一定的容差范围内来判断该像素点是否相似。 最后得到所有的相似像素点和不相似像素点,求出图片的相似度。 这里可能比较大图,为了防止内存溢出和识别速率,会将大图压缩到一定比例后在进行比较。 其他更多详细的说明在项目的Library里有很详细的注释,有兴趣的用户可以参考一下。 声明一下,该项目不做任何依据,都是个人的见解,如果你有更好的思路或代码可以共同讨论。

先贴出几张效果图

Screenshot Screenshot Screenshot Screenshot

怎么使用

使用起来十分的简洁,只需要短短的几行代码,demo里面虽然有很多乱七八糟的代码, 但是真正核心的只有几句,如下:

SimilarityHelper similarityHelper = SimilarityHelper.instance(); 
similarityHelper.similarity(res1, res2, new SimilarityCallBack() {
                    @Override
                    public void onSimilarityStart() {
                    }
                    @Override
                    public void onSimilaritySuccess(int similarity, int different) {
                    }
                    @Override
                    public void onSimilarityError(String reason) {
                    }
                },getApplicationContext());
                
 或者是这样:
 
 similarityHelper.similarity(bitmap1,bitmap2,new SimilarityCallBack() {
                    @Override
                    public void onSimilarityStart() {
                    }
                    @Override
                    public void onSimilaritySuccess(int similarity, int different) {
                    }
                    @Override
                    public void onSimilarityError(String reason) {
                    }
                });
 
                

imagerecognition's People

Contributors

15018777629 avatar

Watchers

James Cloos avatar Hzx avatar

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.