CtrEditor/Documentation/paddleocr-api.md

25 KiB

PaddleOCRSharp Base class for engine objects Custom loading path for PaddleOCR.dll, default is empty. If specified, it needs to be assigned before engine instantiation. Initialization Get the current path of the program Get the current path of the program Convert Image to Byte[] Release memory Get underlying error information Json helper class Json deserialization Model configuration object det_infer model path cls_infer model path rec_infer model path Full path of ppocr_keys.txt file Table model configuration object table_model_dir model path Table recognition dictionary OCR recognition parameters Whether to use GPU; default false GPU id, effective when using GPU; default 0 Requested GPU memory; default 4000 Number of threads for CPU prediction. When the machine has sufficient cores, the higher this value, the faster the prediction; default 10 Whether to use mkldnn library; default true Whether to perform text detection; default true Whether to perform text recognition; default true Whether to perform text orientation classification; default false When the input image length and width are greater than 960, the image is scaled proportionally so that the longest side is 960; default 960 Used to filter the binary image predicted by DB. Setting to 0.-0.3 has no significant effect on results; default 0.3 DB post-processing threshold for filtering boxes. If detection has missing boxes, this can be reduced accordingly; default 0.5 Represents the tightness of the text box. Smaller values mean the text box is closer to the text; default 1.6 Whether to use dilation on the output map, default false true: use polygon box to calculate bbox; false: use rectangle box. Rectangle calculation is faster, polygon boxes are more accurate for curved text areas. Whether to visualize the results. If true, the prediction results will be saved as an ocr_vis.png file in the current directory. Default false Whether to use direction classifier, default false Score threshold for direction classifier, default 0.9 Direction classifier batchsize, default 1 Recognition model batchsize, default 6 Recognition model input image height, default 48 Recognition model input image width, default 320 Whether to display prediction results, default false When using GPU prediction, whether to enable tensorrt, default false OCR modifiable parameters Dynamically modify whether to detect. When OCRParameter.det=true, m_det can dynamically turn off the det parameter Dynamically modify whether to recognize. When OCRParameter.rec=true, m_rec can dynamically turn off the rec parameter When the input image length and width are greater than 960, the image is scaled proportionally so that the longest side is 960; default 960 Used to filter the binary image predicted by DB. Setting to 0.-0.3 has no significant effect on results; default 0.3. Effective when m_det=true DB post-processing threshold for filtering boxes. If detection has missing boxes, this can be reduced accordingly; default 0.5. Effective when m_det=true Represents the tightness of the text box. Smaller values mean the text box is closer to the text; default 1.6. Effective when m_det=true OCR recognition result List of text blocks Recognition result text Recognition result text in Json format Return string format Recognized text block List of coordinate vertices around the text block Text block content Text recognition confidence Angle classification confidence Angle classification label Return string format Point object X coordinate, in pixels Y coordinate, in pixels Default constructor Constructor Return string format OCR structured recognition result Table recognition result Number of rows Number of columns List of cells List of text blocks Cell Cell constructor Row number Column number Text blocks Recognized text PaddleOCR text recognition engine object Initialize OCR engine object with default parameters Initialize OCR engine object with default parameters Model configuration object, if null then default values are used PaddleOCR recognition engine object initialization Model configuration object, if null then default values are used Recognition parameters, if null then default values are used PaddleOCR recognition engine object initialization Model configuration object, if null then default values are used Recognition parameters in json string format Get default configuration Root directory Perform text recognition on image file Image file OCR recognition result Perform text recognition on image object Image OCR recognition result Text recognition Image memory stream OCR recognition result Text recognition Image base64 OCR recognition result Text recognition Image memory address Image width Image height Image channel, usually 3 or 1 OCR recognition result Result parsing Structured text recognition Image Table recognition result Calculate table splitting Dynamically modify parameters after initialization Modifiable parameter object Whether successful, calling before initialization will result in failure Whether to enable rectangular processing of detection results. Single characters are easily detected as diamond shapes, processing them as rectangles can improve recognition accuracy. Only applicable for horizontal text. Release object PaddleOCR table recognition engine object PaddleStructureEngine recognition engine object initialization PaddleStructureEngine recognition engine object initialization Model configuration object, if null then default values are used PaddleStructureEngine recognition engine object initialization Model configuration object, if null then default values are used Recognition parameters, if null then default values are used PaddleStructureEngine recognition engine object initialization Model configuration object, if null then default values are used Recognition parameters in Json format, if null then default values are used Get default configuration Root directory Perform table text recognition on image file Image file Table recognition result Perform table text recognition on image object Image Table recognition result Perform table text recognition on image Byte array Image byte array Table recognition result Perform table text recognition on image Base64 Image Base64 Table recognition result Result parsing Release object OCR recognition parameters When the input image length and width are greater than 488, the image is scaled proportionally, default 488 Whether to merge empty cells Batch recognition quantity