working on crop
This commit is contained in:
parent
93e2234c4e
commit
f74e3e1c85
12 changed files with 1135 additions and 220 deletions
|
|
@ -71,16 +71,37 @@ export type OcrEngine = 'tesseract' | 'easyocr' | 'paddleocr';
|
|||
|
||||
export type OcrPreprocess = 'none' | 'bgsub' | 'tophat';
|
||||
|
||||
export interface DiffOcrParams {
|
||||
export interface DiffCropParams {
|
||||
diffThresh?: number;
|
||||
rowThreshDiv?: number;
|
||||
colThreshDiv?: number;
|
||||
maxGap?: number;
|
||||
trimCutoff?: number;
|
||||
ocrPad?: number;
|
||||
}
|
||||
|
||||
export interface OcrParams {
|
||||
kernelSize?: number;
|
||||
upscale?: number;
|
||||
useBackgroundSub?: boolean;
|
||||
dimPercentile?: number;
|
||||
textThresh?: number;
|
||||
softThreshold?: boolean;
|
||||
useBackgroundSub?: boolean;
|
||||
usePerLineOcr?: boolean;
|
||||
lineGapTolerance?: number;
|
||||
linePadY?: number;
|
||||
psm?: number;
|
||||
mergeGap?: number;
|
||||
linkThreshold?: number;
|
||||
textThreshold?: number;
|
||||
lowText?: number;
|
||||
widthThs?: number;
|
||||
paragraph?: boolean;
|
||||
}
|
||||
|
||||
export interface DiffOcrParams {
|
||||
crop?: DiffCropParams;
|
||||
ocr?: OcrParams;
|
||||
}
|
||||
|
||||
interface DaemonRequest {
|
||||
|
|
@ -236,6 +257,11 @@ export class OcrDaemon {
|
|||
};
|
||||
}
|
||||
|
||||
/** Eagerly spawn the daemon process so it's ready for the first real request. */
|
||||
async warmup(): Promise<void> {
|
||||
await this.ensureRunning();
|
||||
}
|
||||
|
||||
async stop(): Promise<void> {
|
||||
this.stopped = true;
|
||||
if (this.proc) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue