Giter VIP home page Giter VIP logo

facerecognition's Introduction

OSL 脸部剪裁

#简介 在做社交类APP时,常常会遇到让用户自己上传图片的情况。只是用户上传的图片大小是未知的,而呈现在手机屏幕上时常常需要裁剪,这时候如果使用固定位置裁剪可能不能达到最佳效果。
例如用户上传一张生活照,需要裁剪成一个正方形图片,这个时候如果单纯的取图片的中心区域的方形,可能会把脑袋剪裁成一半。
本项目就是用于解决此种问题而创建的。

#使用方法 更多详细使用方法请查看开源实验室中智能相片裁剪的讲解

//最简单的使用,你只需要记住一个方法就够了
@Override
public void initWidget() {
    super.initWidget();

    Bitmap bitmap = BitmapCreate.bitmapFromResource(getResources(),
        R.drawable.image, 0, 0);
    imgOriginal.setImageBitmap(bitmap);
    
    //核心方法
    FaceCropper faceCropper = new FaceCropper();
    faceCropper.setDebug(false);
    Bitmap cropBitmap = faceCropper.cropFace(bitmap);

    imgNew.setImageBitmap(cropBitmap);
}

!image image

facerecognition's People

Contributors

kymjs avatar

Watchers

 avatar  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.