feat: add bounded crop evidence and keyed gallery cache
This commit is contained in:
parent
69de9ea418
commit
0d0e9f82b9
8 changed files with 1065 additions and 41 deletions
|
|
@ -123,7 +123,8 @@ class VisionOcr(OcrEngine):
|
|||
ok, encoded = cv2.imencode(".png", image)
|
||||
if not ok:
|
||||
return OcrResult(engine=self.name, elapsed_ms=(time.perf_counter() - started) * 1000.0)
|
||||
data = NSData.dataWithBytes_length_(encoded.tobytes(), len(encoded.tobytes()))
|
||||
raw = encoded.tobytes()
|
||||
data = NSData.dataWithBytes_length_(raw, len(raw))
|
||||
source = self._quartz.CGImageSourceCreateWithData(data, None)
|
||||
cg_image = self._quartz.CGImageSourceCreateImageAtIndex(source, 0, None)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue