这是我的代码:我正在使用 numpy 和 opencv
q = np.array(image)
q = q.reshape(-1, q.shape[2])
r = np.subtract(q,p)
print r
Run Code Online (Sandbox Code Playgroud)
基本上发生的情况是,如果 q 数组中的值大于 p,则减法循环回到 256 并减去那里剩下的值。如果减法为负值,我宁愿得到 0 值。有人知道这样做的好方法吗?
在将输入包含到我的事件目标时,我在使用 AWS CLI 时遇到一些问题。如果没有输入,此命令和 json 文件可以正常工作。通过控制台创建输入时,我没有任何问题。
bash命令:
aws events put-targets --cli-input-json file://target.json
JSON 文件:
{
"Rule": "site.la-01-rule",
"Targets": [
{
"Id": "site.la-01",
"Arn": "arn:aws:lambda:us-west-1:<account-number>:function:annual-rotation-schedules",
"Input": "This is an input"
}
]
}
Run Code Online (Sandbox Code Playgroud)
错误信息:
调用 PutTargets 操作时发生错误 (ValidationException):目标 site.la-01 输入中的 JSON 语法错误:[源:(String)“这是一个输入”;行:1,列:5
其他信息:
感谢您的帮助!