#Retrieve qrcode vertices

1 messages Β· Page 1 of 1 (latest)

potent obsidian
leaden solstice
#

Do you expect this in screen space?

leaden solstice
#

Well, the corner points are not currently offered in the api.
However, the code for it exist but I assume its in image space.

potent obsidian
#

Just to be clear, if have an image frame like this, using the example mentioned above I obtain the boundingbox (in red), while what I need are the corner points of the qrcode (in green)

#

So in image space would be ok and then I could do my own transformation. Which api should I use to retrieve them?

leaden solstice
#

Its currently not part of the api

potent obsidian
#

Any plan to add this feature?

leaden solstice
#

Yes, but need some time. May I know your deadlines?

potent obsidian
#

Well, basically I need it asap πŸ™‚ This the reason I asked about your plan. Just to understand if I could wait or look for an alternative solution

leaden solstice
#

Oh 😐
I'm currently busy with a tight schedule for a plugin release 😐

#

May I know what platform is your current focus?

potent obsidian
#

Yes. Hopefully I need to target both Android and iOS at same time (just in case, android could go first, but quickly followed by iOS).
Eventually let's consider the worst scenario, so after you plugin release (I imagine you refer to the essential-kit for the 1st november) . When will you be able to deliver this update?

leaden solstice
potent obsidian
#

Ok. Let's try this way. Thank you

leaden solstice
#

I sent you a dm. Just import the package on the existing one and you should see GetCornerPoints in the Barcode.

Haven't done for iOS yet as it has some extra setup needed but for now you can continue with android and test it.

potent obsidian
#

Got it, thanks! I'll test it next days and let you know

potent obsidian
#

Patch imported and I confirm I can see Barcode.CornerPoints property πŸ‘

leaden solstice
#

Thanks for confirming. I need some time to get the equivalent ios part.

#

Did you check the values and are they expected?

potent obsidian
#

The points seems correct related to a texture I use as ImageInputSource. It seems to always return 4 corner starting from the bottom left in counterclockwise order (despite I didn't find any specs on official Google ML Kit documentation). Anyhow I'm doing further tests. Eventually I let you know

potent obsidian
#

Hi there, any chance to have also iOS api and possibly an official release of Easy ML Kit with these features? πŸ™‚ (Switching development branches is almost annoying by the fact I've to handle patched version manually πŸ˜† , but also for build automation)

leaden solstice
potent obsidian
#

Yes, thank you πŸ™

potent obsidian
#

Any news? πŸ™‚

leaden solstice
#

Ouch! Sorry!

#

I will plan this week.

potent obsidian
#

ok thanks

leaden solstice
#

@potent obsidian
I will get both of your concerns resolved (the one with crash and vertices access). I'm on it.

leaden solstice
#

Version 3.2.1 was submitted to store and it offers CornerVertices on both platforms.

potent obsidian
#

ok. I'll check it out

potent obsidian
#

Hi @leaden solstice after doing some in-depth testing on iOS implementation, it seems to have two differences from Android implementation:

  • Barcodes list is null in case if no qrcode is found (instead Android return empty list. Not a big issue, just for reporting it)
  • QRcode vertices are not correct.

Here follow an implementation example to show of the two issue.

#
void Update()
{
    if (_isScanInProgress) return;
    _isScanInProgress = true;

    Debug.Log("FDF Scan: " + _scanCounter++);

    var image = new ImageInputSource(_texture); //Simulating a new texture per scan

    _scanner.Prepare(image, _scannerOptions, (scanner, error) => 
    {
        if (error != null)
        {
            Debug.LogError("FDF Prepare failed: " + error.Description);
            _isScanInProgress = false;
            return;
        }
      
        scanner.Process((scanner, result) =>
        {
            if (result.HasError())
            {
                Debug.LogError(result.Error.Description);
                _isScanInProgress = false;
                return;
            }
            
            if (result.Barcodes != null) {
            
                foreach (Barcode each in result.Barcodes)
                {
                    Debug.Log(string.Format("QRCode Info: Format: {0}, Value Type : {1}, Raw Value : {2}, Bounding Box : {3}", each.Format, each.ValueType, each.RawValue, each.BoundingBox));

                    var bl = each.CornerPoints[0];
                    var br = each.CornerPoints[1];
                    var tr = each.CornerPoints[2];
                    var tl = each.CornerPoints[3];
                    Debug.Log(string.Format("QRCode Points: BL: {0}, BR: {1}, TR: {2}, TL: {3}", bl, br, tr, tl));
                }            
            }
           _isScanInProgress = false;
           scanner.Close(null);
        });
    });
}
#

And the Log related to the scanned QRCode:

QRCode Info: Format: QR_CODE, Value Type : URL, Raw Value : https://www.google.com, Bounding Box : (x:60.00, y:108.00, width:230.00, height:227.00)
QRcode Points: BL: (0.00, 3.22), BR: (0.00, 3.78), TR: (0.00, 3.77), TL: (0.00, 3.30)
#

As you can see, in the points the X value is always 0.00, and also Y even if valorized has questionable value

potent obsidian
#

@leaden solstice just recalling your attention on this thread as a few time is passed πŸ™‚ ! Do you have any feedback on this behaviour?

leaden solstice
#

Hey! Got busy with other issues. I know its late but any chance I can get some time to look into it?