【OpenCV学习】基本数据结构
作者:gnuhpc
出处:http://www.cnblogs.com/gnuhpc/
#include <cv.h> #include <stdio.h> #include <stdlib.h> int main() { CvPoint Point1=cvPoint(300,200); CvPoint2D32f Point2 = cvPoint2D32f(200.0,240.0); CvPoint2D64f Point3 = cvPoint2D64f(100.0,300.0); CvPoint3D32f Point4 = cvPoint3D32f(100.0,200.0,300.0); CvPoint3D64f Point5 = cvPoint3D64f(100.0,100.0,100.0); CvPoint2D32f Point6 = cvPointTo32f(Point1); CvPoint Point7 = cvPointFrom32f(Point6); printf("2 Dimension/n"); printf("Point1 : (%d ,%d)/n",Point1.x,Point1.y); printf("Point2 : (%.1f,%.1f)/n",Point2.x,Point2.y); printf("Point3 : (%.1f,%.1f)/n",Point3.x,Point3.y); printf("/n3 Dimension/n"); printf("Point4 : (%.1f,%.1f,%.1f)/n",Point4.x,Point4.y,Point4.z); printf("Point5 : (%.1f,%.1f,%.1f)/n",Point5.x,Point5.y,Point5.z); printf("/nConvert/n"); printf("Point6 : (%.1f,%.1f)/n",Point6.x,Point6.y); printf("Point7 : (%d,%d)/n/n",Point7.x,Point7.y); }