Giter Club home page Giter Club logo

androidcameraxndkopencv's Introduction

AndroidCameraXNDKOpenCV

OpenCV4.5,摄像头调用的是JetPack CameraX,利用NDK方式实现的实时画面处理。

2020-12-30 加入OpenCV4后才有的的二维码检测和识别功能,点击左下角的图标按钮可以进行功能切换。

2020-12-21 在DNN的基础上加入换脸贴图的小测试。

2020-12-16 加入了DNN人脸检测功能,摄像头界面加上点击切换模式功能,可以在灰度图和人脸检测中来回切换。

2020-12-03 实现了图片实时显示灰度图

androidcameraxndkopencv's People

Contributors

vaccae avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

androidcameraxndkopencv's Issues

有个疑问

grayShow方法中,把灰度处理注释掉,直接返回src,也就是说不进行处理,为什么显示的画面不是原图像?而是变成灰色的了?
//根据传入的Byte生成Mat
Mat src = byteArrayToMat(env, bytes, width, height);
//灰度图
//Mat gray;
//cvtColor(src, gray, COLOR_BGRA2GRAY);
//Mat resultMat;
//cvtColor(gray, resultMat, COLOR_GRAY2BGRA);
//转换生成图片的intArray
jintArray result = matToIntArray(env, src);

几点建议

  1. YUV数据到RGB的转换可以在Java层通过ScriptIntrinsicYuvToRGB或者ImageAnalysis的setOutputImageFormat(OUTPUT_IMAGE_FORMAT_RGBA_8888)来完成。要简单很多。
  2. 想要相机预览视图不可见,可以在cameraProvider.bindToLifecycle时不传preview参数,在布局中将其设置为invisible好像也行。
  3. 可以直接用ImageView的setImageBitmap作图像分析的显示,没必要自定义View用Canvas绘图。
  4. 图像分析的分辨率也可以通过ImageAnalysis的setTargetResolution方法来完成。
    贵项目代码没有全看,不到之处敬请谅解,欢迎指正!

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.