最后编辑于2022-04
Encoding encoding = Encoding.UTF8;
string base64 = getFileBase64(img);
string str = HttpUtility.UrlEncode(base64);
byte[] buffer = encoding.GetBytes(str);
// 如果有可选参数
var options = new Dictionary{
{"probability", "true"}
};
// 带参数调用通用文字识别, 图片参数为本地图片
var result = client.TaxiReceipt(buffer, options);
返回 {{"log_id": 4627403841124432727,"error_code": 216201,"error_msg": "image format error"}} 错误
收藏
点赞
0
个赞
请登录后评论
TOP
切换版块
这个问题是由于您图片base64编码的问题,sdk内部可能已经做了一些处理,建议使用我们的源码:https://github.com/Baidu-AIP/dotnet-sdk