美文网首页
眼球瞳孔识别源码方案

眼球瞳孔识别源码方案

作者: Softboys | 来源:发表于2022-04-23 09:44 被阅读0次

     本专栏是介绍人脸相关的一些源码方案,比如人脸识别,对比,特征点提取(如眼睛嘴巴眼球鼻子的3D位置点),性别年龄,表情识别,活体识别(识别张嘴眨眼转头点头动作活体以及静默活体识别)等, 旨在提供一个可以接近商用的源码方案。

    【原创文章,订阅获取方案和讲解详情】

    先看看这个眼球识别的视频效果吧:App可以选择图片,可以选择视频,可以打开摄像头三种方式测试。您可以下载自行测试(安卓设备测试): 


    眼球瞳孔识别源码Demo app运行演示视频

     领先的人脸眼球瞳孔识别源码Demo安卓手机演示视频

    对于人脸特征点,目前开源使用较为广泛的是Dlib,效果如下。但是使用过你就会发现,它能用但是商用还是多少不合适。1:效率不高 ,比较慢,安卓设备大概帧率在10fps . 2:不稳定,抖动厉害。什么意思? 就是你不动,他识别的轮廓也会左右跳动。在商用时候,比如人脸特效,效果可想而知。

    Dlib的使用效果

    鉴于Dlib使用效果不理想,我使用了新的方案。

    代码为安卓上面java程序:

    软件主界面代码:

    publicclassPortalActivityextendsAppCompatActivity{@OverrideprotectedvoidonCreate(@NullableBundle savedInstanceState){super.onCreate(savedInstanceState);        setContentView(R.layout.portal_main);    }publicvoidonClick(View v){Intentintent=newIntent();        intent.setClass(this, MainActivity.class);if(v.getId() == R.id.button_load_picture) {            intent.putExtra("mode",0);        }elseif(v.getId() == R.id.button_load_video) {            intent.putExtra("mode",1);        }elseif(v.getId() == R.id.button_start_camera) {            intent.putExtra("mode",2);        }        startActivity(intent);    }staticbooleanmCopying=false;privatevoidinitAssetsFile(){if(mCopying) {return;        }InputStreamis=null;Filefile=getDir("libs", Context.MODE_PRIVATE);if(!file.exists()){            file.mkdirs();        }FiletoFile=newFile(file.getAbsolutePath(),"softboy.so");if(toFile.exists()){            System.load(toFile.getAbsolutePath());return;        }try{            mCopying =true;            is = getAssets().open("softboyv7.so");FileOutputStreamfos=newFileOutputStream(toFile);byte[] buffer =newbyte[1024];intbyteCount=0;while((byteCount = is.read(buffer)) != -1) {                fos.write(buffer,0, byteCount);            }            fos.flush();            is.close();            fos.close();        }catch(Exception e) {            toFile.delete();            e.printStackTrace();        }        System.load(toFile.getAbsolutePath());        mCopying =false;    }

    相关文章

      网友评论

          本文标题:眼球瞳孔识别源码方案

          本文链接:https://www.haomeiwen.com/subject/usxaertx.html