Giter Club home page Giter Club logo

camerawithgooglevisionapi's Introduction

Camera2Vision

This sample will let you use the basic functionalities of both Camera1 API and Camera2 API, but with a Google Vision Face,ocr,qrcode/barcode Detector added. You will get all the power of Google Vision Services on your Camera1/Camera2 application. You can switch between Front and Back cameras, take pictures and record video!

multi-detector

  • Add Multi Detector
  • OCR,FACE,BARCODE

Pre-requisites

  • Android SDK 25 (or higher)
  • Android Build Tools v25.0.2 (or higher)
  • Android Support Repository

Issues

Maybe you fill find out that the captured picture is flipped on some devices. You will have to read the EXIF data embedded in the picture to acquire rotation info and flip manually with a Matrix.

Tests

Tested and working on:

  • LG Nexus 5 (API Level: 23)
  • Samsung Galaxy S4 (API Level: 22)
  • Samsung Galaxy S5 Mini (API Level: 23)
  • Motorola G2 XT1072 (API Level: 23)
  • Samsung Galaxy Core (API Level: 18)
  • Pixel (API Level: 25)

Please let me know if you test with success on your devices so I can update this list.

how to use

set the image resolution,
 //init stream size
        stream1Size = new Size(3840,2160);//w,h

License

Copyright 2017 Minniti Ezequiel Adrian

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

camerawithgooglevisionapi's People

Contributors

tsengkuop226 avatar tssa8 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

camerawithgooglevisionapi's Issues

Performance issue

Real time face detection is working slower with Camera2 than Camera1. Did you improve the performance of your code?

Invalid image data size

java.lang.IllegalArgumentException: Invalid image data size.
at com.google.android.gms.vision.Frame$Builder.setImageData(com.google.android.gms:play-services-vision-common@@19.1.3:25)
at com.example.barcodestudy.others.Camera2Source$FrameProcessingRunnable.run(Camera2Source.java:1357)
at java.lang.Thread.run(Thread.java:764)

    Issue from code block:
outputFrame = new Frame.Builder()
                            .setImageData(
                                    ByteBuffer.wrap(mPendingFrameData)
                                    , stream1Size.getWidth()
                                    , stream1Size.getHeight()
                                    , ImageFormat.NV21)
                            .setId(mPendingFrameId)
                            .setTimestampMillis(mPendingTimeMillis)
                            .setRotation(getDetectorOrientation(mSensorOrientation))
                            .build();

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.