1、文档识别 - 接口说明

接口地址
图片为base64流 https://netocr.com/api/recog_document_base64
图片为file格式 https://netocr.com/recog_document_file
接口调用方法 post

(注:调用图片为base64流接口时传参数img,调用图片为file格式接口传参数file)

2、请求参数

(1) 图片为base64流

接口地址 https://netocr.com/api/recog_document_base64
接口调用方法 post

接口接收参数:

序号 名称 类型 必填 说明
1 img String 上传的文件(图片的base64流)
2 key String 用户ocrKey
3 secret String 用户ocrSecrert
4 typeId Integer 识别类型:3060
5 format String json
6 nLanguage Integer 识别语言:2 英文、3 中文(默认)
7 filterColor Integer 滤色:0 关闭(默认)、1 弱滤红、2 强滤红、3 弱滤蓝、4 强滤蓝
8 backgroundFilter Integer 背景色过滤:0 关闭(默认)、1 开启

(2) 图片为file格式

接口地址 https://netocr.com/recog_document_file
接口调用方法 post

接口接收参数:

序号 名称 类型 必填 说明
1 file MultipartFile 上传的文件(上传文件的字段名必须是“file”)
2 key String 用户ocrKey
3 secret String 用户ocrSecrert
4 typeId Integer 识别类型:3060
5 format String json
6 nLanguage Integer 识别语言:2 英文、3 中文(默认)
7 filterColor Integer 滤色:0 关闭(默认)、1 弱滤红、2 强滤红、3 弱滤蓝、4 强滤蓝
8 backgroundFilter Integer 背景色过滤:0 关闭(默认)、1 开启

(3) 识别文件下载

接口地址 https://netocr.com/api/external_download
接口调用方法 get

接口接收参数:

序号 名称 类型 必填 说明
1 filePath String 识别结果的文件路径 pdfPath、jsonPath

3、结果示例

{
    "message": {
        "status": 0,
        "value": "识别完成"
    },
    "info": {
        "pdfPath": "/../20241112073753032206.pdf",
        "ofdPath": "/../20241112073753032206.ofd",
        "jsonPath": "/../20241112073753032206.json",
        "txtPath": "/../20241112073753032206.txt",
        "result": [
            {
                "path": "",
                "table": "<body><div><p RectRow=58,16,1221,20,57,63,1220,66>那少年到了钟楼上,转身拿钟绳的时候,看见楼梯上传声洞对面\n</p><p RectRow=57,92,1224,92,57,142,1224,142>站着一个穿白衣服的人。他叫道:\"谁在那里?\"但是那人不回\n</p><p RectRow=57,166,1210,169,56,216,1209,219>答,也不动。少年叫道:\"答应我,要不就走开,夜里你在这里做\n</p></div></body>",
                "ocr": {
                    "Height": 674,
                    "NodeID": 0,
                    "NodeType": "page",
                    "Width": 1503,
                    "rcInImage": "0,0,1503,674",
                    "text": [
                        {
                            "IsHorz": false,
                            "NodeID": 1,
                            "NodeType": "text",
                            "rcInImage": "0,0,1503,674",
                            "row": [
                                {
                                    "NodeID": 2,
                                    "NodeType": "row",
                                    "RowText": "那少年到了钟楼上,转身拿钟绳的时候,看见楼梯上传声洞对面",
                                    "char": [
                                        {
                                            "NodeID": 3,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "那",
                                            "rcInImage": "59,17,100,67"
                                        },
                                        {
                                            "NodeID": 4,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "少",
                                            "rcInImage": "100,17,141,67"
                                        },
                                        {
                                            "NodeID": 5,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "年",
                                            "rcInImage": "141,17,182,67"
                                        },
                                        {
                                            "NodeID": 6,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "到",
                                            "rcInImage": "182,17,223,67"
                                        },
                                        {
                                            "NodeID": 7,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "了",
                                            "rcInImage": "223,17,264,67"
                                        },
                                        {
                                            "NodeID": 8,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "钟",
                                            "rcInImage": "264,17,305,67"
                                        },
                                        {
                                            "NodeID": 9,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "楼",
                                            "rcInImage": "305,17,346,67"
                                        },
                                        {
                                            "NodeID": 10,
                                            "NodeType": "char",
                                            "confidence": 6684,
                                            "dwCode": "上",
                                            "rcInImage": "346,17,387,67"
                                        },
                                        {
                                            "NodeID": 11,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": ",",
                                            "rcInImage": "387,17,428,67"
                                        },
                                        {
                                            "NodeID": 12,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "转",
                                            "rcInImage": "428,17,469,67"
                                        },
                                        {
                                            "NodeID": 13,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "身",
                                            "rcInImage": "469,17,510,67"
                                        },
                                        {
                                            "NodeID": 14,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "拿",
                                            "rcInImage": "510,17,551,67"
                                        },
                                        {
                                            "NodeID": 15,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "钟",
                                            "rcInImage": "551,17,592,67"
                                        },
                                        {
                                            "NodeID": 16,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "绳",
                                            "rcInImage": "592,17,633,67"
                                        },
                                        {
                                            "NodeID": 17,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "的",
                                            "rcInImage": "633,17,674,67"
                                        },
                                        {
                                            "NodeID": 18,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "时",
                                            "rcInImage": "674,17,715,67"
                                        },
                                        {
                                            "NodeID": 19,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "候",
                                            "rcInImage": "715,17,756,67"
                                        },
                                        {
                                            "NodeID": 20,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": ",",
                                            "rcInImage": "756,17,797,67"
                                        },
                                        {
                                            "NodeID": 21,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "看",
                                            "rcInImage": "797,17,838,67"
                                        },
                                        {
                                            "NodeID": 22,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "见",
                                            "rcInImage": "838,17,879,67"
                                        },
                                        {
                                            "NodeID": 23,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "楼",
                                            "rcInImage": "879,17,920,67"
                                        },
                                        {
                                            "NodeID": 24,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "梯",
                                            "rcInImage": "920,17,961,67"
                                        },
                                        {
                                            "NodeID": 25,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "上",
                                            "rcInImage": "961,17,1002,67"
                                        },
                                        {
                                            "NodeID": 26,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "传",
                                            "rcInImage": "1002,17,1043,67"
                                        },
                                        {
                                            "NodeID": 27,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "声",
                                            "rcInImage": "1043,17,1084,67"
                                        },
                                        {
                                            "NodeID": 28,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "洞",
                                            "rcInImage": "1084,17,1125,67"
                                        },
                                        {
                                            "NodeID": 29,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "对",
                                            "rcInImage": "1125,17,1166,67"
                                        },
                                        {
                                            "NodeID": 30,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "面",
                                            "rcInImage": "1166,17,1207,67"
                                        },
                                        {
                                            "NodeID": 31,
                                            "NodeType": "char",
                                            "confidence": 10000,
                                            "dwCode": "\n",
                                            "rcInImage": "1207,17,1248,67"
                                        }
                                    ],
                                    "rcInImage": "58,16,1221,20,57,63,1220,66"
                                },
                                {
                                    "NodeID": 32,
                                    "NodeType": "row",
                                    "RowText": "站着一个穿白衣服的人。他叫道:\"谁在那里?\"但是那人不回",
                                    "char": [
                                        {
                                            "NodeID": 33,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "站",
                                            "rcInImage": "58,93,99,143"
                                        },
                                        {
                                            "NodeID": 34,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "着",
                                            "rcInImage": "99,93,140,143"
                                        },
                                        {
                                            "NodeID": 35,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "一",
                                            "rcInImage": "140,93,181,143"
                                        },
                                        {
                                            "NodeID": 36,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "个",
                                            "rcInImage": "181,93,222,143"
                                        },
                                        {
                                            "NodeID": 37,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "穿",
                                            "rcInImage": "222,93,263,143"
                                        },
                                        {
                                            "NodeID": 38,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "白",
                                            "rcInImage": "263,93,304,143"
                                        },
                                        {
                                            "NodeID": 39,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "衣",
                                            "rcInImage": "304,93,345,143"
                                        },
                                        {
                                            "NodeID": 40,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "服",
                                            "rcInImage": "345,93,386,143"
                                        },
                                        {
                                            "NodeID": 41,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "的",
                                            "rcInImage": "386,93,427,143"
                                        },
                                        {
                                            "NodeID": 42,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "人",
                                            "rcInImage": "427,93,468,143"
                                        },
                                        {
                                            "NodeID": 43,
                                            "NodeType": "char",
                                            "confidence": 9992,
                                            "dwCode": "。",
                                            "rcInImage": "468,93,509,143"
                                        },
                                        {
                                            "NodeID": 44,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "他",
                                            "rcInImage": "509,93,550,143"
                                        },
                                        {
                                            "NodeID": 45,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "叫",
                                            "rcInImage": "550,93,591,143"
                                        },
                                        {
                                            "NodeID": 46,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "道",
                                            "rcInImage": "591,93,632,143"
                                        },
                                        {
                                            "NodeID": 47,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": ":",
                                            "rcInImage": "632,93,673,143"
                                        },
                                        {
                                            "NodeID": 48,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "\"",
                                            "rcInImage": "673,93,714,143"
                                        },
                                        {
                                            "NodeID": 49,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "谁",
                                            "rcInImage": "714,93,755,143"
                                        },
                                        {
                                            "NodeID": 50,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "在",
                                            "rcInImage": "755,93,796,143"
                                        },
                                        {
                                            "NodeID": 51,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "那",
                                            "rcInImage": "796,93,837,143"
                                        },
                                        {
                                            "NodeID": 52,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "里",
                                            "rcInImage": "837,93,878,143"
                                        },
                                        {
                                            "NodeID": 53,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "?",
                                            "rcInImage": "878,93,919,143"
                                        },
                                        {
                                            "NodeID": 54,
                                            "NodeType": "char",
                                            "confidence": 7370,
                                            "dwCode": "\"",
                                            "rcInImage": "919,93,960,143"
                                        },
                                        {
                                            "NodeID": 55,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "但",
                                            "rcInImage": "960,93,1001,143"
                                        },
                                        {
                                            "NodeID": 56,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "是",
                                            "rcInImage": "1001,93,1042,143"
                                        },
                                        {
                                            "NodeID": 57,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "那",
                                            "rcInImage": "1042,93,1083,143"
                                        },
                                        {
                                            "NodeID": 58,
                                            "NodeType": "char",
                                            "confidence": 9886,
                                            "dwCode": "人",
                                            "rcInImage": "1083,93,1124,143"
                                        },
                                        {
                                            "NodeID": 59,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "不",
                                            "rcInImage": "1124,93,1165,143"
                                        },
                                        {
                                            "NodeID": 60,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "回",
                                            "rcInImage": "1165,93,1206,143"
                                        },
                                        {
                                            "NodeID": 61,
                                            "NodeType": "char",
                                            "confidence": 10000,
                                            "dwCode": "\n",
                                            "rcInImage": "1206,93,1247,143"
                                        }
                                    ],
                                    "rcInImage": "57,92,1224,92,57,142,1224,142"
                                },
                                {
                                    "NodeID": 62,
                                    "NodeType": "row",
                                    "RowText": "答,也不动。少年叫道:\"答应我,要不就走开,夜里你在这里做",
                                    "char": [
                                        {
                                            "NodeID": 63,
                                            "NodeType": "char",
                                            "confidence": 9997,
                                            "dwCode": "答",
                                            "rcInImage": "58,167,97,220"
                                        },
                                        {
                                            "NodeID": 64,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": ",",
                                            "rcInImage": "97,167,136,220"
                                        },
                                        {
                                            "NodeID": 65,
                                            "NodeType": "char",
                                            "confidence": 7457,
                                            "dwCode": "也",
                                            "rcInImage": "136,167,175,220"
                                        },
                                        {
                                            "NodeID": 66,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "不",
                                            "rcInImage": "175,167,214,220"
                                        },
                                        {
                                            "NodeID": 67,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "动",
                                            "rcInImage": "214,167,253,220"
                                        },
                                        {
                                            "NodeID": 68,
                                            "NodeType": "char",
                                            "confidence": 9997,
                                            "dwCode": "。",
                                            "rcInImage": "253,167,292,220"
                                        },
                                        {
                                            "NodeID": 69,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "少",
                                            "rcInImage": "292,167,331,220"
                                        },
                                        {
                                            "NodeID": 70,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "年",
                                            "rcInImage": "331,167,370,220"
                                        },
                                        {
                                            "NodeID": 71,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "叫",
                                            "rcInImage": "370,167,409,220"
                                        },
                                        {
                                            "NodeID": 72,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "道",
                                            "rcInImage": "409,167,448,220"
                                        },
                                        {
                                            "NodeID": 73,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": ":",
                                            "rcInImage": "448,167,487,220"
                                        },
                                        {
                                            "NodeID": 74,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "\"",
                                            "rcInImage": "487,167,526,220"
                                        },
                                        {
                                            "NodeID": 75,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "答",
                                            "rcInImage": "526,167,565,220"
                                        },
                                        {
                                            "NodeID": 76,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "应",
                                            "rcInImage": "565,167,604,220"
                                        },
                                        {
                                            "NodeID": 77,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "我",
                                            "rcInImage": "604,167,643,220"
                                        },
                                        {
                                            "NodeID": 78,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": ",",
                                            "rcInImage": "643,167,682,220"
                                        },
                                        {
                                            "NodeID": 79,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "要",
                                            "rcInImage": "682,167,721,220"
                                        },
                                        {
                                            "NodeID": 80,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "不",
                                            "rcInImage": "721,167,760,220"
                                        },
                                        {
                                            "NodeID": 81,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "就",
                                            "rcInImage": "760,167,799,220"
                                        },
                                        {
                                            "NodeID": 82,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "走",
                                            "rcInImage": "799,167,838,220"
                                        },
                                        {
                                            "NodeID": 83,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "开",
                                            "rcInImage": "838,167,877,220"
                                        },
                                        {
                                            "NodeID": 84,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": ",",
                                            "rcInImage": "877,167,916,220"
                                        },
                                        {
                                            "NodeID": 85,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "夜",
                                            "rcInImage": "916,167,955,220"
                                        },
                                        {
                                            "NodeID": 86,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "里",
                                            "rcInImage": "955,167,994,220"
                                        },
                                        {
                                            "NodeID": 87,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "你",
                                            "rcInImage": "994,167,1033,220"
                                        },
                                        {
                                            "NodeID": 88,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "在",
                                            "rcInImage": "1033,167,1072,220"
                                        },
                                        {
                                            "NodeID": 89,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "这",
                                            "rcInImage": "1072,167,1111,220"
                                        },
                                        {
                                            "NodeID": 90,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "里",
                                            "rcInImage": "1111,167,1150,220"
                                        },
                                        {
                                            "NodeID": 91,
                                            "NodeType": "char",
                                            "confidence": 10002,
                                            "dwCode": "做",
                                            "rcInImage": "1150,167,1189,220"
                                        },
                                        {
                                            "NodeID": 92,
                                            "NodeType": "char",
                                            "confidence": 10000,
                                            "dwCode": "\n",
                                            "rcInImage": "1189,167,1228,220"
                                        }
                                    ],
                                    "rcInImage": "57,166,1210,169,56,216,1209,219"
                                }
                            ]
                        }
                    ]
                }
            }
        ],
        "typeId": 3060
    }
}

results matching ""

    No results matching ""