跳至正文

手写清除 API

只需调用一次应用程序接口,即可移除任何图像*上的笔迹

$curl -i -k -X POST 'https://api.removehandwriting.com/sjccup' \
-H 'Authorization:APPCODE YourAppCode' (授权:APPCODE YourAppCode
–data ‘{“media_id”:”Base64 encoded value of the image, with the longest side not exceeding 4000px; remove the prefix data:image/png;base64″,”keep_distortion”:boolean type, false – auto-corrects distortion, true – disables correction”,”keep_ori”:boolean type, false – the image will be rotated to the correct orientation, true – retains the orientation when uploaded}’ \
-H'Content-Type:application/json;charset=UTF-8'(内容类型:应用/json; charset=UTF-8

应用程序接口简介

使用 RemoveHandwriting.com API,移除手写内容的人工智能技术变得前所未有的简单。只需几行代码,您就可以将这项技术引入您的应用程序。

开始

步骤 1: 购买 API 专用软件包,查看 定价.

步骤 2: 电子邮件 service@removehandwriting.com 以获取专用的 AppCode。

步骤 3: 使用以下代码示例可快速入门。

步骤 4: 回到参数参考,调整请求。

认证

我们使用特殊的 API 密钥(或应用程序代码)对用户进行身份验证。在这里可以轻松获取。API 密钥独一无二,与其他密钥截然不同。出于安全考虑,请不要公布您的应用程序代码。

				
					public static void main(String[] args) {
    String host = "https://api.removehandwriting.com";
    String path = "/sjccup";
    String method = "POST";
    String appcode = "YourAppCode";
    Map headers = new HashMap();
    // 头信息的最终格式(中间有空格)是 Authorization:APPCODE 83359fd73fe94948385f570e3c139105
    headers.put("Authorization", "APPCODE " + appcode);
    // 根据 API 要求定义相应的 Content-Type
    headers.put("Content-Type", "application/json; charset=UTF-8");
    Map querys = new HashMap();
    String bodys = "{\"media_id\":\"Base64 编码图像值,最长边不超过 4000px;移除前缀 data:image/png;base64/",\"keep_distortion\":布尔类型,false - 自动校正扭曲,true - 禁用校正",\"keep_ori\":布尔类型,false - 将图像旋转到正确方向,true - 上传时保留方向}";

    try {
        HttpResponse response = HttpUtils.doPost(host, path, method, headers, querys, bodys);
        System.out.println(response.toString());
        // 获取响应的正文
        // System.out.println(EntityUtils.toString(response.getEntity());
    } catch (Exception e) {
        e.printStackTrace();
    }
}
				
			
				
					
				
			
				
					导入 urllib、urllib2、sys
导入 ssl

host = 'https://api.removehandwriting.com'
路径 = '/sjccup'
方法 = 'POST
应用程序代码 = 'YourAppCode'
querys = ''
bodys = {}
url = host + path

bodys[''] = "{\"media_id\":\"Base64 编码图像值,最长边不超过 4000px;移除前缀 data:image/png;base64/",\"keep_distortion\":boolean type, false - 自动纠正扭曲,true - 禁用纠正",\"keep_ori\":boolean type, false - 图像将旋转到正确方向,true - 上传时保留方向}"
post_data = bodys['']
request = urllib2.Request(url, post_data)
request.add_header('Authorization', 'APPCODE ' + appcode)
# 根据 API 要求定义相应的 Content-Type
request.add_header('Content-Type', 'application/json; charset=UTF-8')
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
response = urllib2.urlopen(request, context=ctx)
content = response.read()
if (content):
    print(content)
				
			
				
					NSString *appcode = @"YourAppCode";
NSString *host = @"https://api.removehandwriting.com";
NSString *path = @"/sjccup";
NSString *method = @"POST";
NSString *querys = @"";
NSString *url = [NSString stringWithFormat:@"%@%@%@", host, path, querys];
NSString *bodys = @"{\"media_id/":\"Base64编码图像值,最长边不超过4000px;移除前缀data:image/png;base64/",\"keep_distortion/":布尔类型,false-自动校正扭曲,true-禁用校正",\"keep_ori/":布尔类型,false-图像将旋转到正确方向,true-上传时保留方向}";

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString: url] cachePolicy:1 timeoutInterval:5];
request.HTTPMethod = method;
[request addValue:[NSString stringWithFormat:@"APPCODE %@", appcode] forHTTPHeaderField:@"Authorization"];
// 根据 API 要求定义相应的 Content-Type
[request addValue:@"application/json; charset=UTF-8" forHTTPHeaderField:@"Content-Type"];
NSData *data = [bodys dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:data];
NSURLSession *requestSession = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
NSURLSessionDataTask *task = [requestSession dataTaskWithRequest:request
    completionHandler:^(NSData * _Nullable body, NSURLResponse * _Nullable response, NSError * _Nullable error) {
    NSLog(@"Response object: %@", response);
    NSString *bodyString = [[NSString alloc] initWithData:body encoding:NSUTF8StringEncoding];

    // 打印响应正文
    NSLog(@"Response body: %@", bodyString);
}];

[任务恢复]
				
			
错误代码 错误信息 说明
0 成功 成功
1000 身体错误 请求正文错误
1001 参数错误 请求参数错误
1002 内容类型错误 内容类型错误
1003 图像不存在 未找到图像文件
1004 图像大小错误 图像尺寸错误
1005 图像格式错误 图像格式错误
1006 无效签名 无效签名
1007 体型误差 体型误差
1008 无授权 授权失败
2000 服务器未知错误 服务器未知错误
2001 服务器超时 服务器超时
2003 无内容识别 未识别内容
2004 验证数据错误 验证数据错误
3000 远程服务器错误 远程服务器错误
4000 基础服务器错误 基础服务器错误

以下计划为应用程序接口专用计划

6 个月有效期

499 $ 0.1 / 学分
  • 5000 学分
立即行动
最受欢迎

6 个月有效期

799 $ 0.08 / 学分
  • 10000 个信用点

1 年有效期

3999 $ 0.04 / 学分
  • 100000 个信用点
独家

100% 退款保证!

放心购买。如果您发现该工具不能满足您的需求,我们将提供 7 天无条件退款保证。您可以放心付款。我们有 退款政策 以确保您的付款安全。