跳至內容

馬賽克移除 API

只需呼叫一次 API,即可移除任何影像的馬賽克*。

$curl -i -k -X POST 'https://api.mosaicremoval.com/sjccup' \
-H 'Authorization:APPCODE YourAppCode' (授權:APPCODE YourAppCode
-data'{"media_id": 「圖片的 Base64 編碼值,最長邊不超過 4000px;移除前綴 data:image/png;base64″,」keep_distortion「:布林類型,false - 自動糾正失真,true - 禁用糾正」,"keep_ori":布林類型,false - 圖片將被旋轉到正確的方向,true - 上傳時保留方向}' \
-H'Content-Type:application/json;charset=UTF-8'。

API 簡介

使用MosaicRemoval.com API,專門移除馬賽克的人工智能技術變得前所未有的簡單。只要幾行程式碼,您就可以將這項技術帶入您的應用程式中。

開始使用

步驟 1: 購買專用於 API 的套件,查看 定價.

步驟 2: 電子郵件 [email protected] 以取得專屬的 AppCode。

步驟 3: 使用下列程式碼範例可快速上手。

步驟 4: 回到參數參考來調整請求。

驗證

我們使用特殊的 API Key(或 App Code)來驗證使用者。您可以在此輕鬆取得。API 金鑰是獨一無二的,與其他金鑰截然不同。基於安全理由,請勿公開您的 App Code。

Main.java
public static void 主要(字串[] args) {
    字串 主機 = "https://api.mosaicremoval.com";
    字串 路徑 = "/sjccup";
    字串 方法 = 「傳送」;
    字串 應用程式碼 = "YourAppCode";
    地圖<字串, 字串> 页眉 =  HashMap<字串, 字串>();
    // 標頭中的最終格式(中間有空格)是 Authorization:APPCODE 83359fd73fe94948385f570e3c139105
    headers.put(「授權」, "APPCODE " + appcode);
    // 根據 API 要求定義相對應的 Content-Type
    headers.put(「內容類型」, "application/json; charset=UTF-8");
    地圖<字串, 字串> 查詢 =  HashMap<字串, 字串>();
    字串 身體 = "{\"media_id/":\「Base64 編碼的圖像值,最長邊不超過 4000px;移除前綴 data:image/png;base64/」,\"keep_distortion/「:布林類型,false - 自動糾正扭曲,true - 禁用糾正」,\"keep_ori/「:布林類型,false - 圖像將旋轉到正確的方向,true - 上傳時保留方向}」;
     {
        HttpResponse 回應 = HttpUtils.發佈(host、path、method、headers、querys、bodys);
        系統.out.println(response.toString());
        // 取得回應的正文
        // System.out.println(EntityUtils.toString(response.getEntity()));
    } 捕捉 (例外 e) {
        e.列印堆疊追蹤();
    }
}
請求.php
<?php
    $host = "https://api.mosaicremoval.com";
    $path = "/sjccup";
    $method = "POST";
    $appcode = "YourAppCode";
    $headers = array();
    array_push($headers, "Authorization:APPCODE " . $appcode);
    // Define the corresponding Content-Type according to API requirements
    array_push($headers, "Content-Type" . ":" . "application/json; charset=UTF-8");
    $querys = "";
    $bodys = "{\"media_id\":\"Base64 encoded image value, 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}";
    $url = $host . $path;
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($curl, CURLOPT_FAILONERROR, false);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HEADER, true);
    if (1 == strpos("$".$host, "https://")) {
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
    }
    curl_setopt($curl, CURLOPT_POSTFIELDS, $bodys);
    var_dump(curl_exec($curl));
?>
request.py
輸入 urllib, urllib2, sys
輸入 ssl

主機 = 'https://api.mosaicremoval.com'
路徑 = '/sjccup'
方法 = POST
應用程式碼 = 您的應用程式碼
查詢 = ''
身體 = {}
url = 主機 + 路徑

bodys[''] = "{\"media_id/":\「Base64 編碼的圖像值,最長邊不超過 4000px;移除前綴 data:image/png;base64/」,\"keep_distortion/「:布林類型,false - 自動糾正扭曲,true - 禁用糾正」,\"keep_ori/「:布林類型,false - 圖像將旋轉到正確的方向,true - 上傳時保留方向}」
post_data = 身體['']

請求 = urllib2.請求(url, post_data)
請求。新增標題(授權, APPCODE ' + appcode)
# 根據 API 要求定義相應的 Content-Type
請求。新增標題(內容類型, 'application/json; charset=UTF-8')

ctx = ssl。建立預設上下文()
ctx.check_hostname = 虛假
ctx.verify_mode = ssl.CERT_NONE

回應 = urllib2.開啟(request, context=ctx)
內容 = 回應。閱讀()

如果 (內容):
    列印(內容)
請求.m
NSString *應用程式碼 = @"YourAppCode";
NSString *主機 = @"https://api.mosaicremoval.com";
NSString *路徑 = @"/sjccup";
NSString *方法 = @"POST";
NSString *查詢 = @"";
NSString *url = [NSString stringWithFormat:@"%@%@%@", host, path, querys];
NSString *身體 = @"{\"media_id\":\「Base64 編碼的圖像值,最長邊不超過 4000px;移除前綴 data:image/png;base64\」,\"keep_distortion\「:布林類型,false - 自動糾正扭曲,true - 禁用糾正\」,\"keep_ori\「:布林類型,false - 圖像將旋轉到正確的方向,true - 上傳時保留方向}」;

NSMutableURLRequest *請求 = [NSMutableURLRequest requestWithURL:[NSURL URLWithString: url] 
                                                        cachePolicy:1 
                                                    timeoutInterval:5];
request.HTTPMethod = method;
[請求 addValue:[NSString stringWithFormat:@"appcode %@", 應用程式碼] 
    forHTTPHeaderField:@"Authorization"];

// 根據 API 要求定義相對應的 Content-Type
[請求 addValue:@"application/json; charset=UTF-8" 
    forHTTPHeaderField:@"Content-Type"];

NSData *資料 = [身體 dataUsingEncoding:NSUTF8StringEncoding];
[請求 setHTTPBody:資料];

NSURLSession *請求會話 = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration 預設會話設定]];
NSURLSessionDataTask *工作 = [requestSession dataTaskWithRequest:請求
    completionHandler:^(NSData * 可空 身體、 NSURLResponse *可空 回應、 NSError * _Nullable 錯誤) {
    NSLog(@"Response object: %@",回應);
    NSString *bodyString = [[NSString 分配] initWithData:身體 編碼:NSUTF8StringEncoding];
    // 列印回應的正文
    NSLog(@"Response body: %@", bodyString);
}];
[任務 簡歷];
錯誤代碼 錯誤訊息 說明
0 成功 成功
1000 身體錯誤 請求正文錯誤
1001 參數錯誤 請求參數錯誤
1002 內容類型錯誤 Content-Type 錯誤
1003 影像不存在 未找到影像檔案
1004 影像大小錯誤 影像大小錯誤
1005 影像格式錯誤 影像格式錯誤
1006 無效簽名 無效簽名
1007 身體尺寸誤差 體型誤差
1008 沒有授權 授權失敗
2000 伺服器未知錯誤 伺服器未知錯誤
2001 伺服器超時 伺服器超時
2003 無內容辨識 無法辨識內容
2004 驗證資料錯誤 驗證資料錯誤
3000 遠端伺服器錯誤 遠端伺服器錯誤
4000 基本伺服器錯誤 基本伺服器錯誤

下列計劃為 API 專用

終生

199 $ 0.199 / 信用額
  • 1000 學分
立即行動
最受歡迎

終生

599 $ 0.12 / 信用額
  • 5000 學分

終生

999 $ 0.08 / 信用額
  • 12000 個信用點
獨家

100% 退款保證!

安心購買。如果您發現此工具無法滿足您的需求,我們提供 7 天無問退費保證。您可以放心付款。我們有 退款政策 以確保您的付款安全。