Git Product home page Git Product logo

Comments (10)

franck-nadeau avatar franck-nadeau commented on August 15, 2024 1

from react-native-openalpr.

RobertSasak avatar RobertSasak commented on August 15, 2024 1

I released master as 1.2.0 https://github.com/RobertSasak/react-native-openalpr/releases/tag/1.2.0
It contains also Take picture ios PR #49

from react-native-openalpr.

RobertSasak avatar RobertSasak commented on August 15, 2024 1

I have updated the example https://github.com/RobertSasak/react-native-openalpr/blob/master/example/App.js

from react-native-openalpr.

azanli avatar azanli commented on August 15, 2024

You're in luck. I just recently submitted a PR for including an image capture() feature in the Android version. If you clone the openalpr-with-image-capture branch of this repo, you should have access to the capture functionality which you are seeking. You would be able to do something like this with your onPlateRecognized():

  onPlateRecognized({ plate, confidence }) {
    if (confidence > 0.9) {
      if (this.license !== plate) { // Only take a picture if the plate recognized is different from the recent one
         this.license = plate;
         this.takePicture();
       }
    }
  }
}

takePicture() {
  this.cameraRef.capture()
  .then((data) => ....)
  .catch((e) => ...)
}

I will look into adding this feature into iOS when the time comes. In the meantime, you're welcome to get started on a new branch! Just refer to react-native-camera and you'll be tip top!

from react-native-openalpr.

franck-nadeau avatar franck-nadeau commented on August 15, 2024

I added that functionality for iOS in this PR

Here is how to use it:

this. cameraRef.takePicture().then(
        uri => {
              console.log(`uri for the image ${uri}`;
        },
        error => {
              console.log(`Error : ${error}`;
        }
      );

from react-native-openalpr.

cdvntr avatar cdvntr commented on August 15, 2024

Hi @franck-nadeau,

I get CameraManager.takePicture is not a function error and when i log the ref i actually can't see the function.

from react-native-openalpr.

franck-nadeau avatar franck-nadeau commented on August 15, 2024

Hello.

A few things,

  • first you need to be on master because there hasn't been a release for about 2 years.
 "react-native-openalpr": "RobertSasak/react-native-openalpr#master",
  • second, this will only work on iOS.
  • third you should use the Camera.takePicture() helper function that I added.

Let me know if this still does not work for you.

from react-native-openalpr.

cdvntr avatar cdvntr commented on August 15, 2024

@franck-nadeau Thanks for the quick answer,

  • This is on my package.json : "react-native-openalpr": "RobertSasak/react-native-openalpr#master",
  • I am working on ios.

After calling the function from the module not the ref, i get;

TypeError: _reactNativeOpenalpr.default.takePicture is not a function.

Also when i call it with Camera.prototype.takePicture, i get;

TypeError: CameraManager.takePicture is not a function

from react-native-openalpr.

franck-nadeau avatar franck-nadeau commented on August 15, 2024

I am not sure why that is. It is working fine off my own repo (and my PR was merged in this one too). Anyway, you could try using it as I am:

"react-native-openalpr": "franck-nadeau/react-native-openalpr#master",

Here is my code for your info.

  onPlateRecognized({ plate, confidence }) {
    if (confidence > 90) {
      // We got a good match, lets take a screenshot of it.
      this.refs.camera.takePicture().then(
        uri => {
        },
        error => {
        }
      );
    }
  }

render() {
...
 <Camera
          ref="camera"
....

from react-native-openalpr.

CevaComic avatar CevaComic commented on August 15, 2024

Can someone update the example in the repo with this method too ? I can't manage to make it work , i would appreciate a working example. Thank you

from react-native-openalpr.

Related Issues (20)

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.