https://github.com/eetagent/deno-ocrmac
Deno module for the macOS Vision framework image OCR
https://github.com/eetagent/deno-ocrmac
deno deno-module esm macos module objective-c objective-c-library ocr vision
Last synced: 4 months ago
JSON representation
Deno module for the macOS Vision framework image OCR
- Host: GitHub
- URL: https://github.com/eetagent/deno-ocrmac
- Owner: EETagent
- License: wtfpl
- Created: 2023-09-24T10:04:20.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-01-29T13:42:38.000Z (over 1 year ago)
- Last Synced: 2025-04-07T20:41:12.678Z (about 1 year ago)
- Topics: deno, deno-module, esm, macos, module, objective-c, objective-c-library, ocr, vision
- Language: TypeScript
- Homepage: https://esm.sh/gh/EETagent/deno-ocrmac/mod.ts
- Size: 1.32 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
```typescript
import OCRMac, {
Orientation,
RecognitionLevel,
} from "jsr:@eetagent/deno-ocrmac";
using ocr = new OCRMac();
const result = await ocr.getTextFromImageByteArray(
Deno.readFileSync("./image.png"),
RecognitionLevel.Accurate,
true,
Orientation.Left,
);
console.log(result);
```
```typescript
/**
* Constants that identify the performance and accuracy of the text recognition.
* @enum {number}
*/
export enum RecognitionLevel {
Accurate = 0,
Fast = 1,
}
/**
* The orientation of the image/buffer based on the EXIF specification.
* For details see kCGImagePropertyOrientation.
* The value has to be an integer from 1 to 8.
* This supersedes every other orientation information.
* @enum {number}
*/
export enum Orientation {
Up = 1,
UpperMirrored = 2,
Down = 3,
DownMirrored = 4,
Left = 8,
LeftMirrored = 5,
Right = 6,
RightMirrored = 7,
}
export type BoundingBox = {
y: number;
w: number;
x: number;
h: number;
};
export type Result = Array<{
boundingBox: BoundingBox;
text: string;
}>;
```