Closed 0awful closed 7 years ago
Fixed it, but figured I would post for other's information.
The fix was to stop coding the rect in terms of a fraction, which yields a fatal error if you do so.
Hi @imizaac, you can still use fractions, but since the values you use are interpreted as integers, the result of the fractions is still an integer thus all values are 0. They need to be floating-points, so your code with fractions should look like this:
let recipientAddressLocation = CGRect.init(x: 85.0/600.0, y: 100.0/900.0, width: 365.0/600.0, height: 85.0/900.0)
let senderAddressLocation = CGRect.init(x: 10.0/600.0, y: 30.0/900.0, width: 260.0/600.0, height: 65.0/900.0)
let weightLocation = CGRect.init(x: 510.0/600.0, y: 30.0/900.0, width: 80.0/600.0, height: 75.0/900.0)
let trackingLocation = CGRect.init(x: 10.0/600.0, y: 430.0/900.0, width: 370.0/600.0, height: 30.0/900.0)
Same thing goes for aspect ratio:
let labelSettings = PPDocumentSpecification.init(aspectRatio: 4.0/6.0, decodingInfo: UPSLabelInfo)
Regards, Jure
Thanks! Marking as closed
I am getting this error:
[WTF] processDetection [BlinkOcrRecognizer.cpp:255] 2017-09-17 19:42:39.676256-0700 blinkPackages[4470:5419114] FIXME: Internal bug detected. Detector returned 0 location names for 4 locations!
I have parsers with group names that match 4 locations, despite what the error code states.
Context: I am using a PPBlinkOCRRecognizer to perform TemplateOCR. Previously all my locations were missing their targets on the template, but everything was working. I used geometry to derive the rects as a fraction from my template. Now, whenever I point my camera at an object that matches the aspect ratio of the item that I'm trying to OCR I get this fatal error.
Code for the ViewController is included below, all you need to do is attach a button and it will "work"
I have verified that the names do indeed match, I have renamed the parsers to match their location names, I have increased and decreased the dewarped height. This problem began to occur upon changing the rects to a location that arrives at a match on a 4/6 aspect ratio item.