CyrexEnterprise / ImageDetectionCordovaPlugin

Image detection cordova plugin
MIT License
102 stars 43 forks source link

Nothing is detecting ... #15

Closed musab1234 closed 6 years ago

musab1234 commented 6 years ago

I save 6 patterns images. But none of them is showing success in isDetecting event. Camera overlay is displayed. But i put images in front of them nothing happens.


   var imgDetectionPlugin = window.plugins.ImageDetectionPlugin || new ImageDetectionPlugin();
    imgDetectionPlugin.startProcessing(true, function(success){
        console.log(success);
    }, function(error){
        console.log(error);
    });

    var patterns = [
      // 6 images string array of base64
   ]

    imgDetectionPlugin.setPatterns(patterns, function(success){
        console.log(success);
    }, function(error){
        console.log(error);
    });

    imgDetectionPlugin.isDetecting(function(success){
      console.log(success);
      var resp = JSON.parse(success);
      alert(resp.index);
      console.log(resp.index, "image detected - ", resp.index, resp.coords, resp.center);
    }, function(error){
        console.log(error);
    });

    imgDetectionPlugin.setDetectionTimeout(2, function(success){
        console.log(success);
    }, function(error){
        console.log(error);
    });
a31859 commented 6 years ago

@musab1234 Can you try to see if by setting only one image at the time the detection happens? The implementation must loop through all the images to find a match so this might taking more time to callback a successful detection.

musab1234 commented 6 years ago

No gain , no event detected with one image pattern, output of log is

Frame processing set to 'true', screen size is h - 592, w - 384 index.js:31 Pattens to be set - 1 Before set pattern 0 After set pattern 1 Patterns set - 1

musab1234 commented 6 years ago

Yes @a31859 , its detecteddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd with one image . Thanks alot <3

a31859 commented 6 years ago

Glad it's working