图片矩阵变形
接口说明
- 路径:
/abby_yearbook_excel_parser
对一张平面的图片进行四角坐标的矩阵变换
这是一个支持参数的Form文件上传接口
HTML代码参考
<form id="form">
左上角坐标: <input type="text" name="left_top" value="" placeholder="50,50">
<br>
右上角坐标: <input type="text" name="left_top" value="" placeholder="x,y">
<br>
左下角坐标: <input type="text" name="right_down" value="" placeholder="50,50">
<br>
右下角坐标: <input type="text" name="left_down" value="" placeholder="x,y">
<br>
<label for="position_mode">坐标模式:</label>
<select name="position_mode" id="position_mode">
<option value="absolute">绝对定位</option>
<option value="relative">相对定位</option>
</select><br>
<input type="file" name="file">
</form>
<button onclick="upload()">提交</button>
<script>
function upload() {
var formElement = document.getElementById("form");
var xhr = new XMLHttpRequest();
xhr.open("POST", "/upload_file");
xhr.send(new FormData(formElement));
}
</script>
请求参数
参数名称 | 类型 | 示例 | 说明 |
---|---|---|---|
left_top | str | "50,150" | 左上角坐标,中间用"," 分割 |
right_top | str | "50,150" | 右上角坐标,中间用"," 分割 |
right_down | str | "50,150" | 右下角坐标,中间用"," 分割 |
left_down | str | "50,150" | 左下角坐标,中间用"," 分割 |
position_mode | str | "absolute" | "relative" |
file | 二进制形式 | 前端通过Form标签或者示例添加 | 二进制形式的File, |
相应结果