OpenCV之Point&Rect总结
时间: 2018-08-31来源:OSCHINA
前景提要
「深度学习福利」大神带你进阶工程师,立即查看>>> #include "mainwindow.h" #include <QApplication> #include <QList> #include <QDebug> /* 总结:Rect与Point等都只能是int类型,如果是是float,会自动转换成整形 */ int main(int argc, char *argv[]) { QApplication a(argc, argv); QList<Rect>RectList; float x = 10.33; float y = 10.0; float w = 300.123; float h = 300.45; Rect rect(x, y, w, h); qDebug() << rect.width << rect.height; //300 300 Point point(x, y); qDebug() << point.x << point.y; //10 10 RectList.push_back(rect); for(auto it = RectList.begin(); it != RectList.end(); ++it) { (*it).x = (*it).x * 2; (*it).y = (*it).y / 2; qDebug() <<(*it).x ; } qDebug() << RectList.back().x << RectList.back().y << RectList.back().width << RectList.back().height; waitKey(); return a.exec(); }

科技资讯:

科技学院:

科技百科:

科技书籍:

网站大全:

软件大全:

热门排行