Git Product home page Git Product logo

quaggajs's People

Contributors

danmana avatar davincho avatar dgreif avatar elsigh avatar ericblade avatar gitter-badger avatar jclarkin avatar jpsfs avatar lasserafn avatar midnightdesign avatar mtillmann avatar nicolashenry avatar plpeeters avatar seanhussey avatar serratus avatar tomashubelbauer avatar tricki avatar xvzf avatar zupzup 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quaggajs's Issues

_inputStream.setWidth is not a function

Sometimes I get the following with 'x-large' for my patchsize
640px x 160px
Uncaught TypeError: _inputStream.setWidth is not a functioncheckImageConstraints @ admin_bundle.js:75641canRecord @ admin_bundle.js:75657that.trigger @ admin_bundle.js:68945(anonymous function) @ admin_bundle.js:75613checkVideo @ admin_bundle.js:75406loadedData @ admin_bundle.js:75415

Remove event listeners

I couldn't find any way to remove event listeners. This causes problems when calling decodeSingle multiple times with different callbacks. The result callback should only be called for results from that frame, but instead all previously provided callbacks are also called each time a result is found. The result callback should be removed from the event listeners when processing of the single frame is done.

I would also like to be able to attach and remove event listeners for the live scanning (when using init), so it is not just for decodeSingle that this is useful.

How do I determine from the result set (or other means) what type of barcode was read?

In my current test case, I have told it to allow readers: ["code_128_reader", "ean_reader", 'code_39_reader']
I am getting back some quirky results, and when I look at the result.codeResult.code I see that I need to strip off start and stop bits on some formats. So I think I need to know - does Quagga think it read a code 128, or an EAN or a 39? so I can post process (and debug) --- currently my test camera is getting some interesting barcode readings from the row of books behind me. Sometimes in the Detected Callback I'm getting a 0 length code, other times 2 or 3 characters. Other times proper EAN etc.., readings.
Is the format of the code read somewhere in the result object? (codeset is always returning "" even on 'good reads' - that is where I thought I might be expecting to see which format was 'located'.)
If this isn't clear, I'll try to explain better!

File input example broken?

Hi!
I have tried file input example with Code 128 image saved from here https://en.wikipedia.org/wiki/Code_128

When I'm trying to use that "wikipedia" barcode image with the file input example I cannot get the results.
That "wikipedia" image is working perfectly with LiveStream example (scanned that code from my laptop's screen with my Android.)

Is that example broken?

Configuring decoding/localization area

I would like to have the ability to configure the area of the image/video which should be processed by quaggaJS. The configuration should look like the following:

"inputStream": {
    "type": "LiveStream",
    "constraints": {
        "width": 640,
        "height": 480
    },
    "area": {
        "top": "10%",
        "right": "20%",
        "left": "20%",
        "bottom": "10%"
    }
}

The area property defines the rectangle in percentage (similar to CSS position attributes). For now, having percentage values is more universal and independent of the resolution.

how about the barcode with large gaps

how to locate the barcode with large gaps , such as, RSS14..., a large whitespace between two black bars.
you said:

First of all, cells containing no, or just one component are discarded immediatelly and are not used for further processing.

but, one component may be the bar...

Code39 barcodes

I have some Code39 barcodes (as seen on roadid race bibs (http://www.roadid.com/sponsorship/SampleBib.aspx)

Quagga will do a partial reading sometimes and return 345 as 34 or 45. I thought about enforcing 3 digits for the read, but RoadID doesn't always include 3 digits (e.g, 50 not 050).

Any advice? (new to barcodes) Looking to use this in github.com/mzimmerman/racergo

Typescript support .d.ts

Just wanted to let you know we have created a Typescript .d.ts file for QuaggaJS.

An employee of mine and I are currently testing it. (We are new to quagga). Once we have things working with it, we will submit it to 'definitely typed' and we intend to keep it 'up to date'.

If anyone would like a 'pre-release' or want to test it with us - let me know.

I'll update this issue as appropriate.

Internet Explorer supported?

Sorry for the dumb-ass question, but I can't make any of the QuaggaJS examples work in any version of IE. I've tried IE11/10 in Windows 8.1 & IE on Windows Phone 8.1.

All of these browsers support the File API and Canvas, so I figured the images should be getting into Quagga, just no further?

iOS Compatibility via PhoneGap

Hi Serratus,

This may have already been covered and if so, my apologies. I just haven't been able to locate much on it. Im aware that Safari does not user the getUserMedia API and it is my understanding that the cordova media plugins for photo & video capture will not work. Is there any other method of getting this to run in iOS?

Bug a simple add library?

I have simle html5 page:

<div class="form-group" style="text-align: center">
        <video id="video" width="320" height="240" autoplay></video>
        <canvas id="barcode" width="320" height="240" style="display:none"></canvas>
</div>
<script>
 this start of using video
</script>

I add library in head:

<script src="/Scripts/Libs/quagga.min.js" type="text/javascript"></script>

After adding the library I stopped working component video, just a black screen.

init with video element

Would be it possible add init variation that takes video element as one argument, e.g. initWithVideo : function(config, cb, video)?

Current implementation queries #interactive.viewport from document and further video, which doesn't work with Shadow DOM (web components).

          var $viewport = document.querySelector("#interactive.viewport");
          if ($viewport) {
            video = $viewport.querySelector("video");
            if (!video) {
              video = document.createElement("video");
              $viewport.appendChild(video);
            }
          }

I would nice to utilise this great library to implement e.g. Polymer element.

live stream issues with EAN barcode-type

Hi. I'm having problems with decoding EAN barcodes with live stream.

But I see in your examples that you succeed to decode this type with pictures. I don't understand why it doesn't code. I haven't change any lines in the library.

Local context issue in windows 8.1 Cordova app

I keep getting the following issue in my windows 8.1 Cordova app:
Can’t load blob:206CFAF7-9077-4449-B2AE-961E738D4AE9. An app can’t load remote web content in the local context.

Can you please give me help on solving this, I really need help asap. Tx

Extra info:
Uses Angular JS
Windows 8.1
Windows Phone 8.1

Examples not really helpful

Very interested in this library, but I can't find any documentation on how to configure it. I'm playing around with http://serratus.github.io/quaggaJS/examples/live_w_locator.html, but all I get is a green outlined rectangle on the image.

What is supposed to happen on this page? Is it supposed to find and announce when it discovers a barcode? Is there any documentation that describes what affect "Resolution", "Patch-size", etc has?

2D barcode scan

will this work for 2d barcodes(pdf417) i have been trying to scan a pdf417 barcode nothing happens in the browser can you please help me out. I have attached image for your reference iam using chrome on andriod mobile. when i click stop nothing happens.
image1

Codabar support

QuaggaJS would be useful for libraries (I mean book-lenders, not code resources!) if it supported the Codabar symbology. There is already web-based software for loaning books to borrowers, and integrating QuaggaJS could make any tablet with a webcam capable of being a checkout computer. Thanks!

Does I need to add a video tag?

Sorry but I don't understand how to use this library. The livesteam example works online but I don't know how to use it.

If i put this on my code I get undefined video on this part of you code:
....
InputStream.createLiveStream = function(video) {
video.setAttribute("autoplay", true);
....

Quagga.init({
inputStream : {
name : "Live",
type : "LiveStream"
},
decoder : {
readers : ["code_128_reader"]
}
}, function(err) {
if (err) {
console.log(err);
return
}
console.log("Initialization finished. Ready to start");
Quagga.start();
});

Static Images Example Fails

The static Images example fails silently. The dev console on Firefox reports

  • "Security Error: The operation is insecure" - quagga.min.js:9:0
  • Unknown property '-moz-box-shadow'. Declaration dropped.

On google chrome (version 41) I get..

  • "Uncaught SecurityError: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data."
  • The value "device-width;" for key "width" is invalid, and has been ignored.
  • Error parsing a meta element's content: ';' is not a valid key-value pair separator. Please use ',' instead.

It seems to be related to running the examples locally (as well as my own code) because
the examples themselves work fine when running them from the browser here on github.

I'm working on an independent project for my employer in retail as a tech demo that could save us a significant amount of money in employee labor for an otherwise irritating and expensive (albeit simple) everyday task. I'm not a full time programmer but I'd gladly toss a twenty your way via paypal or what-have-you, if someone can fix this. Thanks.

Faster recognition for barcodes

This was posted on HN and I think it deserves a look:

It appears you are breaking the image into smaller 'patches' and looping through those to look for chunks of a barcode. Even if the algorithm is resolution independent, you might be able to exit the loop 50-60% earlier if you detect from the middle and go out in a spiral. In other words, the order in which you iterate the loop can make a difference.

I'm going to start looking at this, but I'm open to feedback.

Use Second Camera

How is it possible to change to a (possible) second Camera ? Like Tablets and Mobil Phones...
This programm is using the front camera

Large barcodes not detecting corectly

Hello

Quaggajs is very nice for barcode reading but i found some issues that large barcode reads wrongly in live locator. Not getting the correct result.

And also another thing sometimes it is not correctly focusing the barcode. Can we have any solution for this? Can we make it as touch and focus correctly and then scan the barcode and after getting the correct data stop it.

I am familiar with getusermedia but this barcode scanning making problems to me. Because sometimes we are getting the wrong result with barcode scanning. But in zxing app it is focusing correctly and getting the correct solution always and also for lengthy barcodes too. So if i get the accurate result like that then i will be very happy.

Init callback not called

I couldn't get the callback to init to be called. It appears that the callback value is getting dropped in the initialize function, which only declares one argument but is called with two in Quagga.init.

Getting a JS Error: "No /$/quagga" (somewhere in the RequireJS code)

I'm getting the following error:

No /$/quagga

Which comes from the following block of code:

    function callDep(name) {
        if (hasProp(waiting, name)) {
            var args = waiting[name];
            delete waiting[name];
            defining[name] = true;
            main.apply(undef, args);
        }

        if (!hasProp(defined, name) && !hasProp(defining, name)) {
            throw new Error('No ' + name);
        }
        return defined[name];
    }

This appears to be related to the RequireJS implementation you're using, but I'm not exactly sure of how things work in that library.

Can you take a quick look? I'd really love to use your reader.

Would like to set length of expected code (for Code 39 VIN detection)

It would be cool to say I want a bar code of a particular length for a variable-length encoding to keep the workers working until they decode a value of a particular length.

In my case I'm playing with VINs which use the code_39_reader but a valid VIN is always 17 characters long.

doing a scan, ean is being interpreted as upc_e

The addition of the format was a great help in determining some scan errors I'm getting. Specifically, I'm getting some of my ean barcodes interpreted as upc_e.

Is there a way I can get 'the image' that was used for processing back without going into debug? (If the answer is 'no, use debug' then I'll work on understanding that tomorrow. But if there is a way I can get the image that was used for the onDetected - then I'll use that (and it will allow me to have my customers send me 'faulty reads' as well, I'll write the code to allow them to email me any 'bad reads' along with the result data object.)

Edge Browser

When you're ready to start testing with Edge, let me know. At this point I'll just say it doesn't work for us, and I'll gather you a better error description when you're ready to work on it (in case there are any quick updates from MS over the next few days.) Note: According to MS, it 'should' be working in Edge. A bug report I submitted in IE 11 came back to me last week as 'good news, it's fixed and working in Edge'. And the errors are the same in debug mode and when using web workers - I mention this because I am told that the web worker method you are using wouldn't have worked even if the user media object did.

change of reader in decodeSingle example not working

I wasn't able to change the used reader with the code from the example in the readme file:

Quagga.decodeSingle({
  readers: ['ean_reader'],
  locate: true,
  src: 'ean'
}, function(result){
  console.log(result);
});

However it worked with the following:

Quagga.decodeSingle({
  decoder: {
     readers: ["ean_reader"]
  },
  locate: true,
  src: 'ean'
}, function(result){
  console.log(result);
});

Microsoft Edge Support

Hello,

The demo with live stream works on Chrome and Firefox for me, but not IE, so I installed Windows 10 on my tablet and tried running the page on Microsoft Edge. I thought the decoder would work because Microsoft Edge now supports getUserMedia. The webcam now works, but the decoder still does not work. It also doesn't display any of the example images. I've been trying to figure out what Chrome and Firefox supports that Microsoft Edge doesn't... Maybe this is an easy fix?

EDIT: I didn't read the other issues, please delete this.

Minification causes JavaScript SyntaxError

For some reason, the code doesn't work anymore when minified, which is a bummer since it's almost three times smaller that way. The JavaScript error I'm getting is "Uncaught SyntaxError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The URL 'undefined' is invalid.". The error originates from the blob worker URL.

I'm getting this error 4 times, which seems to be one time per worker, given it launches 4 workers when I use the non-minified version.

Angular & quaggaJS problems

Hello!

I having problem using quagga in a angular application, the quagga reader does work when visiting the blank page without angular.

But used in a angular application I don't get any reply from the quagga "onDetected".

Do anyone have any suggestions on this problem?

Error handling - swallowed up (displayed on console) - how do I find out?

I notice that, if I disconnect my camera, line 8078 throws a console.log(e) but my code doesn't seem to get a chance to be notified of it and/or notify my user.

Am I missing a way? If I'm not, could you allow for an optional error call back function as well for those of us who want to notify our users or take appropriate action?

Live Example fails in Chrome on Moto X (2014)

Trying to follow the example with get user media on chrome for android. Preview looks like this:

I have a Moto X. Works fine on Firefox for android. Tried Chrome Beta and it had the same problem.

screenshot_2015-04-15-10-13-32

Quagga.stop() should also disconnect from the camera

After QuaggaJS calls getUserMedia and establishes a connection to the device's camera, there does not seem to be a way to stop the camera again. There should be a way to do that and also calling Quagga.stop() should disconnect from the camera.

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.