GithubHelp home page GithubHelp logo

Running out of options | Unable to detect QR code similar to the built-in camera app in the phone about react-native-vision-camera HOT 11 CLOSED

neilanthonyte avatar neilanthonyte commented on September 21, 2024
Running out of options | Unable to detect QR code similar to the built-in camera app in the phone

from react-native-vision-camera.

Comments (11)

Dingenis avatar Dingenis commented on September 21, 2024

hey @neilanthonyte, did you follow the guide on the website regarding QR scanning? From your code I can't see if you pass in the codeScanner into the Camera component.

from react-native-vision-camera.

neilanthonyte avatar neilanthonyte commented on September 21, 2024

hi @Dingenis thanks for the response . . yes I did . . here is the component

const codeScanner = useCodeScanner({
    codeTypes: ['qr', 'ean-13'],
    onCodeScanned: (codes) => {
      onScanFinished({data: codes[0].value});
      onClose();
    }
  })

<Camera 
                  exposure={camera.current ? 1 : 0}
                  ref={camera}
                  focusable={true}
                  codeScanner={codeScanner} 
                  device={device} 
                  format={format}
                  enableDepthData={true}
                  enableHighQualityPhotos={true}
                  pixelFormat='native'
                  style={StyleSheet.absoluteFill}
                  isActive={show} />

from react-native-vision-camera.

Dingenis avatar Dingenis commented on September 21, 2024

Mhh weird! Maybe you could use a different QR/barcode to scan? Could be that this specific code doesn't work too well.

from react-native-vision-camera.

neilanthonyte avatar neilanthonyte commented on September 21, 2024

yeah that's what I thought @Dingenis the weird thing is that . . i tried QR code checker and it managed to scan the code and get the value.
Screenshot 2024-02-26 at 8 39 55 PM

the QR code also works when I scan it using the built-in camera app on the phone
Group

from react-native-vision-camera.

Dingenis avatar Dingenis commented on September 21, 2024

Mhhh I get that πŸ€” Maybe you could check if the QR scanner in your app works at all by just trying to scan a bunch of codes from the internet. That way, you could narrow down the cause.

from react-native-vision-camera.

neilanthonyte avatar neilanthonyte commented on September 21, 2024

hi @Dingenis yes upon testing several QR codes it works with the normal QR code design (white background) . . our current QR code design has black background
Screenshot 2024-02-27 at 7 40 45 AM

. . could that be the reason why the scanner can't detect the QR code? if so do you have an idea as to why the built-in camera app can detect the QR code with black background?

from react-native-vision-camera.

Dingenis avatar Dingenis commented on September 21, 2024

hey @neilanthonyte, I am not sure. This library uses Google MLKit for QR/barcodes, maybe it could be related to this: googlesamples/android-vision#62

from react-native-vision-camera.

xulihang avatar xulihang commented on September 21, 2024

There should be a white quiet zone around the QR code or the library may not be able to detect it.

You can also use other advanced barcode reader to read it like this one: https://github.com/tony-xlh/vision-camera-dynamsoft-barcode-reader/

from react-native-vision-camera.

neilanthonyte avatar neilanthonyte commented on September 21, 2024

@Dingenis yep definitely related . . :) thanks so much for the reference.

from react-native-vision-camera.

neilanthonyte avatar neilanthonyte commented on September 21, 2024

@xulihang thank you so much for the response . . I will definitely try your suggestion and post an update here on the result.

from react-native-vision-camera.

mrousavy avatar mrousavy commented on September 21, 2024

Hey - I use the MLKit library under the hood. If you enabled it in gradle.properties (as the guide in the docs suggests) and it still doesn't work, there is nothing I can do.

Maybe try using one of the Frame Processor plugins, those are more flexible and might detect more stuff or work in different environemnts - the goal of the CodeScanner is to be a simple easy to use installation.

from react-native-vision-camera.

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.