OpenCV RotatedRect angle is wrong
来源:互联网 发布:苹果手机制作软件 编辑:程序博客网 时间:2024/06/05 09:09
Improving on the answer of @Adam Goodwin i want to add my little code that changes the behaviour a little bit:
I wanted to have the angle between the longer side and vertical (to me it is the most natural way to think about rotated rectangles):
If you need the same, just use this code:
void printAngle(RotatedRect calculatedRect){ if(calculatedRect.size.width < calculatedRect.size.height){ printf("Angle along longer side: %7.2f\n", calculatedRect.angle+180); }else{ printf("Angle along longer side: %7.2f\n", calculatedRect.angle+90); }}
To see it in action just insert it in Adam Goodwins code:
printf("Angle given by minAreaRect: %7.2f\n", calculatedRect.angle);printAngle(calculatedRect);printf("---\n");
原文
0 0
- OpenCV RotatedRect angle is wrong
- opencv笔记 RotatedRect类
- RotatedRect类opencv
- RotatedRect类opencv
- RotatedRect类opencv
- 基础——RotatedRect中返回的角度angle
- 基础——RotatedRect中返回的角度angle
- opencv 3.0 旋转矩形 RotatedRect
- OpenCV - Detect skew angle
- OpenCV - Detect skew angle
- OpenCV对图片中的RotatedRect进行填充
- 关于opencv中RotatedRect的角度疑问
- opencv:RotatedRect和CvBox2D的角度疑云
- 获取OpenCV中RotatedRect的绝对角度
- OpenCV之RotatedRect类、minAreaRect函数详解
- OpenCV中RotatedRect 以及 Rect介绍
- OpenCV - Bounding Box & Skew Angle
- CPU Utilization is Wrong
- MapReduce读取txt文件存储至HBase,以文件名作Key,整个文件内容作Value
- Yii2.0中文开发向导——RBAC(基于角色的访问控制权限)表结构原理分析
- 爆破员将四十枚电雷管私自送人使用被判刑51爆破
- ubuntu12.04配置网络
- Android RIL结构分析与移植
- OpenCV RotatedRect angle is wrong
- C程序设计语言(K&R)——学习笔记
- 车牌识别算法介绍与实践
- autorelease销毁时间
- Cocos2d-x学习笔记(5)
- 判定一个点是否在多边形内部
- win32的hook
- [ZOJ][1001]A + B Problem
- Java RandomAccessFile用法