我想检测图像中包含很多子结构的多个(相似)矩形对象。所以,我目前的计划是使用高斯模糊、形态学和边缘检测(Canny
)。使用边缘检测后,我得到了这个(阈值参数非常低):
目前我尝试通过使用HoughLines
和之findContours
后来获得它。对于这项工作,我需要拨弄了很多与门限参数Canny
和HoughLines
。
当我对一张图像进行正确处理时,参数很可能不适用于下一张(例如,前一张图像中的边缘不太占优势,导致霍夫变换检测到太多线条)。另一个问题是,有时内部结构与外边缘的一侧同等或更少占主导地位。
我尝试使用更强的模糊或形态,但在某些时候这模糊了矩形之间的小间隙。
鉴于边缘图像(最好使用opencv),我可以以其他方式提取更大的矩形吗?获得 4 个角点就足够了。
我的目标是使用serde和time-rs将具有RFC-3339时间戳的对象从 Json 序列化为 Rust 结构(反之亦然)。
我希望这...
use serde::Deserialize;
use time::{OffsetDateTime};
#[derive(Deserialize)]
pub struct DtoTest {
pub timestamp: OffsetDateTime,
}
fn main() {
let deserialization_result = serde_json::from_str::<DtoTest>("{\"timestamp\": \"2022-07-08T09:10:11Z\"}");
let dto = deserialization_result.expect("This should not panic");
println!("{}", dto.timestamp);
}
Run Code Online (Sandbox Code Playgroud)
...创建结构并将时间戳显示为输出,但我得到...
thread 'main' panicked at 'This should not panic: Error("invalid type: string \"2022-07-08T09:10:11Z\", expected an `OffsetDateTime`", line: 1, column: 36)', src/main.rs:12:38
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Run Code Online (Sandbox Code Playgroud)
我的依赖项如下所示:
[dependencies]
serde = { version = …
Run Code Online (Sandbox Code Playgroud) 我想使用Azure 中的Api 管理来限制对我的Azure 容器应用程序的访问。
我成功地将 Api 管理与容器应用程序链接起来,并使用 Api 密钥激活了订阅,这将阻止通过 Api 管理服务 URL 进行公共访问。但问题是,仍然可以通过容器应用程序的公共 Url 来访问容器应用程序。
仍然可以选择Ingress Traffic
在容器应用程序中进行设置Limited to Container Apps Environment
,但 Api 管理也将无法访问容器应用程序。
正确保护 Api 管理服务背后的容器应用程序的正确方法是什么?
我的目标是通过 AWS CDK 启用区域 WebAcl 的日志记录。这似乎可以通过 Cloud Formation 实现,并且 CDK 中有适当的构造。但是,当使用以下代码创建日志组并将其链接到LoggingConfiguration时...
const webAclLogGroup = new LogGroup(scope, "awsWafLogs", {
logGroupName: `aws-waf-logs`
});
// Create logging configuration with log group as destination
new CfnLoggingConfiguration(scope, "webAclLoggingConfiguration", {
logDestinationConfigs: webAclLogGroup.logGroupArn, // Arn of LogGroup
resourceArn: aclArn // Arn of Acl
});
Run Code Online (Sandbox Code Playgroud)
...我在 期间遇到异常cdk deploy
,指出 LogdestinationConfig 中的字符串不是正确的 Arn(日志消息中 Arn 的某些部分已被删除):
Resource handler returned message: "Error reason: The ARN isn't valid. A valid ARN begins with arn: and includes other …
Run Code Online (Sandbox Code Playgroud)