Skip to content

Commit

Permalink
Tweaked the canvas debug for OCR
Browse files Browse the repository at this point in the history
  • Loading branch information
TwoAbove committed Mar 5, 2024
1 parent d24ef17 commit 20eb935
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/components/LiveSeedStats/OCRHandler/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,10 @@ class OCRHandler extends EventTarget {
);

if (this.canvasRef) {
// to debug
this.canvasRef.current!.width = img.width;
this.canvasRef.current!.height = img.height;
const ctx = this.canvasRef.current!.getContext("2d")!;
// ctx.fillStyle = "#000000";
// ctx.fillRect(0, 0, 1000, 1000);
ctx.drawImage(img, 40, 0);
ctx.drawImage(img, 0, 0);
}

const res = await this.tesseractWorker.recognize(img as any);
Expand Down

0 comments on commit 20eb935

Please sign in to comment.