Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding top and left to bounding frame return #18

Open
mat2718 opened this issue Jan 3, 2023 · 1 comment
Open

adding top and left to bounding frame return #18

mat2718 opened this issue Jan 3, 2023 · 1 comment

Comments

@mat2718
Copy link

mat2718 commented Jan 3, 2023

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

adding top and left to bounding frame return

Here is the diff that solved my problem:

diff --git a/node_modules/vision-camera-ocr/android/src/main/java/com/visioncameraocr/OCRFrameProcessorPlugin.kt b/node_modules/vision-camera-ocr/android/src/main/java/com/visioncameraocr/OCRFrameProcessorPlugin.kt
index 8ae6279..1e22c03 100644
--- a/node_modules/vision-camera-ocr/android/src/main/java/com/visioncameraocr/OCRFrameProcessorPlugin.kt
+++ b/node_modules/vision-camera-ocr/android/src/main/java/com/visioncameraocr/OCRFrameProcessorPlugin.kt
@@ -88,6 +88,8 @@ class OCRFrameProcessorPlugin: FrameProcessorPlugin("scanOCR") {
         if (boundingBox != null) {
             frame.putDouble("x", boundingBox.exactCenterX().toDouble())
             frame.putDouble("y", boundingBox.exactCenterY().toDouble())
+            frame.putInt("left", boundingBox.left)
+            frame.putInt("top", boundingBox.top)
             frame.putInt("width", boundingBox.width())
             frame.putInt("height", boundingBox.height())
             frame.putInt("boundingCenterX", boundingBox.centerX())
diff --git a/node_modules/vision-camera-ocr/lib/typescript/index.d.ts b/node_modules/vision-camera-ocr/lib/typescript/index.d.ts
index 47f1816..a3b6c3f 100644
--- a/node_modules/vision-camera-ocr/lib/typescript/index.d.ts
+++ b/node_modules/vision-camera-ocr/lib/typescript/index.d.ts
@@ -2,6 +2,8 @@ import type { Frame } from 'react-native-vision-camera';
 declare type BoundingFrame = {
     x: number;
     y: number;
+    top: number;
+    left: number;
     width: number;
     height: number;
     boundingCenterX: number;
@@ -41,4 +43,5 @@ export declare type OCRFrame = {
  * Scans OCR.
  */
 export declare function scanOCR(frame: Frame): OCRFrame;
-export {};
+export { };
+
diff --git a/node_modules/vision-camera-ocr/src/index.tsx b/node_modules/vision-camera-ocr/src/index.tsx
index b4eeb76..608828a 100644
--- a/node_modules/vision-camera-ocr/src/index.tsx
+++ b/node_modules/vision-camera-ocr/src/index.tsx
@@ -4,6 +4,8 @@ import type { Frame } from 'react-native-vision-camera';
 type BoundingFrame = {
   x: number;
   y: number;
+  top: number;
+  left: number;
   width: number;
   height: number;
   boundingCenterX: number;

This issue body was partially generated by patch-package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@mat2718 and others