【OpenCV】OpenCV中的结构体、类与EmguCV的对应表

来源:互联网 发布:对不起我爱你知乎 编辑:程序博客网 时间:2024/05/04 07:10

来源:http://blog.csdn.net/utimes/article/details/8459882

Basic Structures

main data structures used in opencv.

OpenCV中的 C 结构

OpenCV中的 C++ 封装

EmguCV中的 C# 封装



CvPoint 
CvPoint2D32f 
CvPoint2D64f 
CvPoint3D32f 
CvPoint3D64f
Point_<typename _Tp>
Point3_<typename _Tp>
 
Point_<int>(Point2i, Point) 
Point_<float>(Point2f) 
Point_<double>(Point2d) 
Point3_<float>(Point3f) 
Point3_<double>(Point3d) 
Point3_<int>(Point3i)


System.Drawing.Point 
System.Drawing.PointF 
MCvPoint2D64f 
MCvPoint3D32f 
MCvPoint3D64f

CvSize 
CvSize2D32f
Size_<typename _Tp> 
Size_<int>(Size, Size2i) 
Size_<float>(Size2f)

System.Drawing.Size 
System.Drawing.SizeF

CvRectRect_<typename _Tp> 
Rect_<int>(Rect)
System.Drawing.Rectangle
CvScalar (A container for 1-,2-,3-or4-tuples of doubles)Scalar_<typename _Tp> 
Scalar_<double>(Scalar) 
(:public Vec<_Tp, 4>) 
(Scalar is widely used to pass pixel values)

MCvScalarCvBox2DRotatedRectMCvBox2DCvMat (A multi-channel dense matrix)MatMCvMat 
MCvHistogram 
Matrix<TDepath>CvMatND (Multi-dimensional dense multi-channel array)MatMCvMatND 
MatND<TDepth>IplImageMatMIplImage 
Image<TColor, TDepth>CvSparseMatSparseMatSparseMatrix<TDepath>CvArr (“metatype”only used as function parameter)InputArray 
OutputArrayCvArray<TDepth>CvTermCriteria (Termination criteria for iterative algorithms)TermCriteria
MCvTermCriteria

Dynamic Structures

for creating growable sequences and other dynamic data structures allocated in CvMemStorage. If you use the new C++, Python, Java etc interface, you will unlikely need this functionality. Use std::vector or other high-level data structures instead.

OpenCv中的 C 结构
OpenCV中的 C++ 封装
Emgu.CV中的 C# 封装
CvMemStorageMemStorageMemStorageCvMemBlock  CvMemStoragePos  CvSeqSeq<typename _Tp>MCvSeq 
Seq<T>CvSliceRangeMCvSliceCvSet (derived from CvSeq) MCvSetCvGraph (derived from CvSet)  CvGraphScanner (used for depth-first graph traversal)  CvTreeNodeIterator (used to traverse trees of sequences)  

Extra C++ Basic Structures

some basic structures in C++ version.

Matx<typename _Tp, int m, int n> 

  • typedef Matx<float, 1, 2> Matx12f;
  • typedef Matx<double, 6, 6> Matx66d;

Vec<typename _Tp, int n> (:public Matx<_Tp, n, 1>)

  • typedef Vec<uchar, 2> Vec2b;
  • typedef Vec<short, 4> Vec4s;
  • typedef Vec<int, 3> Vec3i;
  • ...float,double...

Ptr<typename _Tp>  for smart reference-counting pointers

Matrix Expressions: (Mat A, B; Scalar s; double alpha)

  • Addition, substraction, negation: A + B, A - B, A + s, A - s, s - A, -A
  • Scaling: A * alpha
  • Per-element multiplication and division: A.mul(B), A/B, alpha/A
  • Matrix multiplication: A*B
  • Transposition: A.t() (means AT)
  • Matrix inversion and pseudo-inversion, solving linear systems and least-squares problems: A.inv([method]) (~ A-1) , A.inv([method])*B (~ X: AX=B)
  • Comparison: A cmpop B, A cmpop alpha, alpha cmpop A, where cmpop is one of : >, >=, ==, !=, <=, <. The result of comparison is an 8-bit single channel mask whose elements are set to 255 (if the particular element or pair of elements satisfy the condition) or 0.
  • Bitwise logical operations: A logicop B, A logicop s, s logicop A, ~A, where logicop is one of : &, |, ^.
  • Element-wise minimum and maximum: min(A, B), min(A, alpha), max(A, B), max(A, alpha)
  • Element-wise absolute value: abs(A)
  • Cross-product, dot-product: A.cross(B) A.dot(B)
  • Any function of matrix or matrices and scalars that returns a matrix or a scalar, such as norm, mean, sum, countNonZero, trace, determinant, repeat, and others.
  • Matrix initializers ( Mat::eye(), Mat::zeros(), Mat::ones() ), matrix comma-separated initializers, matrix constructors and operators that extract sub-matrices (see Mat description).
  • Mat_<destination_type>() constructors to cast the result to the proper type.

原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 浓硫酸沾到皮肤上怎么办 浓硫酸溅到皮肤上怎么办 浓硫酸滴到皮肤上怎么办 浓硫酸洒在皮肤上怎么办 浓硫酸溅到眼睛里怎么办 盐酸弄到眼睛了怎么办 稀硫酸进眼睛里怎么办 草酸弄到皮肤上怎么办 大理石被盐酸烧发白怎么办 香薰蜡烛化了怎么办 吸入了大量燃烧纸气体怎么办 狗链条上锈了怎么办 思维迟钝反应慢嘴笨怎么办 小孩思维慢反应迟钝怎么办 苹果4g网络慢怎么办 医院没有号了怎么办啊 fgo宝具动画卡顿怎么办 死刑犯在执行前死亡怎么办 汕头交警 违章扣分怎么办办理 幼儿园家长不保险应该怎么办 csgo掉白银坑了怎么办 错过教资认定现场确认怎么办 乡村建设导致民房开裂怎么办 项目部公章丢了怎么办 手机掉了没有卡怎么办 苹果系统软件删了还是出现怎么办 钉钉检测到作弊怎么办 电脑麦说话声音小怎么办 穿越火线麦克风有杂音怎么办 手闲不住就抠东西怎么办 大便堵在肛门口怎么办 在外地流量不够用怎么办 电脑键盘数字键没反应怎么办 音响音量键坏了怎么办 摩托罗拉移动电话通话没声音怎么办 摩托罗拉对讲机充电座坏了怎么办 手机导航键太灵敏怎么办 经侦大队不立案怎么办 槐茂酱菜太咸怎么办 法院执法局执法不公怎么办 搞养殖卖不出去怎么办