gpt4 book ai didi

c++ - 使用 Opencv 检测文本上的角点

转载 作者:塔克拉玛干 更新时间:2023-11-03 07:29:53 26 4
gpt4 key购买 nike

我需要有关 opencv 图像处理的帮助,我有一种梯形要处理,所以我需要扭曲透视图,这很容易做到,但我需要在此图像上提取源点。注意,图像只有文本,在这个例子中我画了红线来显示我需要得到的东西。我需要检测角点(示例中用蓝点标记)。

enter image description here

有什么帮助吗?

最佳答案

您可以通过执行 the bounding box technique 来隔离图像中的文本,角点将存储在 vertices 变量中:

cv::Point2f vertices[4];
box.points(vertices);

您将能够通过访问它们的 X、Y 坐标来操纵它们:

std::cout << "Point 1: " << vertices[0].x << "," << vertices[0].y << std::endl;
std::cout << "Point 2: " << vertices[1].x << "," << vertices[1].y << std::endl;
std::cout << "Point 3: " << vertices[2].x << "," << vertices[2].y << std::endl;
std::cout << "Point 4: " << vertices[3].x << "," << vertices[3].y << std::endl;

我共享的链接提供了此技术的完整实现。 这就是您要找的机器人!

关于c++ - 使用 Opencv 检测文本上的角点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13604990/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com