EmguCV类(CvInvoke_Class) 方法整理

合集下载

车牌识别emgucv

车牌识别emgucv

using System;using System.Collections.Generic;using System.Text;using System.Drawing;using Emgu.Util;using Emgu.CV;using Emgu.CV.Structure;using tessnet2;using System.Diagnostics;namespace LicensePlateRecognition{/// <summary>/// A license plate detector/// </summary>public class LicensePlateDetector : DisposableObject{private Tesseract _ocr;/// <summary>/// Create a license plate detector/// </summary>public LicensePlateDetector(){//create OCR_ocr = new Tesseract();//You can download more language definition data from///p/tesseract-ocr/downloads/list//Languages supported includes://Dutch, Spanish, German, Italian, French and English_ocr.Init("eng", false);}/// <summary>/// Detect license plate from the given image/// </summary>/// <param name="img">The image to search license plate from</param>/// <param name="licensePlateList">A list of images where the detected license plate region is stored</param>/// <param name="filteredLicensePlateList">A list of images where the detected license plate region with noise removed is stored</param>/// <param name="boxList">A list where the region of license plate, defined by an MCvBox2D is stored</param>/// <returns>The list of words for each license plate</returns>public List<List<Word>> DetectLicensePlate(Image<Bgr, byte> img, List<Image<Gray, Byte>> licensePlateList, List<Image<Gray, Byte>> filteredLicensePlateList, List<MCvBox2D> boxList){//Stopwatch w = Stopwatch.StartNew();List<List<Word>> licenses = new List<List<Word>>();using (Image<Gray, byte> gray = img.Convert<Gray, Byte>())using (Image<Gray, Byte> canny = new Image<Gray, byte>(gray.Size))using (MemStorage stor = new MemStorage()){CvInvoke.cvCanny(gray, canny, 100, 50, 3);Contour<Point> contours = canny.FindContours(Emgu.CV.CvEnum.CHAIN_APPROX_METHOD.CV_CHAIN_APPROX_SIMPLE,Emgu.CV.CvEnum.RETR_TYPE.CV_RETR_TREE,stor);FindLicensePlate(contours, gray, canny, licensePlateList, filteredLicensePlateList, boxList, licenses);}//w.Stop();return licenses;}private void FindLicensePlate(Contour<Point> contours, Image<Gray, Byte> gray, Image<Gray, Byte> canny,List<Image<Gray, Byte>> licensePlateList, List<Image<Gray, Byte>> filteredLicensePlateList, List<MCvBox2D> boxList,List<List<Word>> licenses){for (; contours != null; contours = contours.HNext){Contour<Point> approxContour = contours.ApproxPoly(contours.Perimeter * 0.05, contours.Storage);if (approxContour.Area > 100 && approxContour.Total == 4){//img.Draw(contours, new Bgr(Color.Red), 1);if (!IsParallelogram(approxContour.ToArray())){Contour<Point> child = contours.VNext;if (child != null)FindLicensePlate(child, gray, canny, licensePlateList,filteredLicensePlateList, boxList, licenses);continue;}MCvBox2D box = approxContour.GetMinAreaRect();double whRatio = (double)box.size.Width / box.size.Height;if (!(3.0 < whRatio && whRatio < 8.0)){Contour<Point> child = contours.VNext;if (child != null)FindLicensePlate(child, gray, canny, licensePlateList, filteredLicensePlateList, boxList, licenses);continue;}Image<Gray, Byte> plate = gray.Copy(box);Image<Gray, Byte> filteredPlate = FilterPlate(plate);List<Word> words;using (Bitmap bmp = filteredPlate.Bitmap)words = _ocr.DoOCR(bmp, filteredPlate.ROI);licenses.Add(words);licensePlateList.Add(plate);filteredLicensePlateList.Add(filteredPlate);boxList.Add(box);}}}/// <summary>/// Check if the four points forms a parallelogram/// </summary>/// <param name="pts">The four points that defines a polygon</param>/// <returns>True if the four points defines a parallelogram</returns>private static bool IsParallelogram(Point[] pts){LineSegment2D[] edges = PointCollection.PolyLine(pts, true);double diff1 = Math.Abs(edges[0].Length - edges[2].Length);double diff2 = Math.Abs(edges[1].Length - edges[3].Length);if (diff1 / edges[0].Length <= 0.05 && diff1 / edges[2].Length <= 0.05&& diff2 / edges[1].Length <= 0.05 && diff2 / edges[3].Length <= 0.05){return true;}return false;}/// <summary>/// Filter the license plate to remove noise/// </summary>/// <param name="plate">The license plate image</param>/// <returns>License plate image without the noise</returns>private static Image<Gray, Byte> FilterPlate(Image<Gray, Byte> plate){Image<Gray, Byte> thresh = plate.ThresholdBinaryInv(new Gray(120), new Gray(255));using (Image<Gray, Byte> plateMask = new Image<Gray, byte>(plate.Size))using (Image<Gray, Byte> plateCanny = plate.Canny(new Gray(100), new Gray(50)))using (MemStorage stor = new MemStorage()){plateMask.SetValue(255.0);for (Contour<Point> contours = plateCanny.FindContours(Emgu.CV.CvEnum.CHAIN_APPROX_METHOD.CV_CHAIN_APPROX_SIMPLE,Emgu.CV.CvEnum.RETR_TYPE.CV_RETR_EXTERNAL,stor);contours != null; contours = contours.HNext){Rectangle rect = contours.BoundingRectangle;if (rect.Height > (plate.Height >> 1)){rect.X -= 1; rect.Y -= 1; rect.Width += 2; rect.Height += 2;rect.Intersect(plate.ROI);plateMask.Draw(rect, new Gray(0.0), -1);}}thresh.SetValue(0, plateMask);}thresh._Erode(1);thresh._Dilate(1);return thresh;}protected override void DisposeObject(){_ocr.Dispose();}}}。

invoke调用方法

invoke调用方法

invoke调用方法通过invoke调用方法什么是invoke调用方法?在编程领域中,invoke是一种常用的方法调用技术。

通过invoke 调用方法,可以实现动态调用和执行特定的代码段。

无论是在前端开发还是后端开发,invoke都是非常有用的工具。

下面将介绍不同编程语言中的invoke调用方法。

Java中的invoke调用方法在Java中,可以使用反射来实现invoke调用方法。

下面是一些常用的Java反射API,可以用来实现invoke调用方法:•():根据类的完全限定名获取Class对象。

•():根据方法名和参数类型获取Method对象。

•():调用指定对象的方法。

以下是一个Java中使用invoke调用方法的示例:Class<?> clazz = ("");Object obj = ().newInstance();Method method = ("myMethod", , );(obj, 42, "Hello, World!");Python中的invoke调用方法在Python中,可以使用反射机制来实现invoke调用方法。

Python提供了getattr()和setattr()等内置函数来实现反射。

以下是一个Python中使用getattr()和setattr()实现invoke调用方法的示例:class MyClass:def my_method(self, num, message):print(f"Number: {num}, Message: {message}")obj = MyClass()method_name = "my_method"method = getattr(obj, method_name)method(42, "Hello, World!")JavaScript中的invoke调用方法在JavaScript中,可以使用()和()来实现invoke调用方法。

使用C#+EmguCV处理图像入门(一)

使用C#+EmguCV处理图像入门(一)

使⽤C#+EmguCV处理图像⼊门(⼀)⾸先我们先了解⼀下该库的⼀些相关信息OpenCV(Open Source Computer Vision Library)是⼀个(开源免费)发⾏的跨平台计算机视觉库,可以运⾏在Linux、Windows、Android、ios等操作系统上,它轻量级⽽且⾼效---由⼀系列C函数和少量C++类构成,同时提供了Python、Ruby、MATLAB等语⾔的接⼝,实现了图像处理和计算机视觉⽅⾯的诸多通⽤算法。

EmguCV是OpenCV的⼀个跨平台的.Net封装,由于OpenCV是⽤C和C++编写的,Emgu⽤C#对其进⾏封装,允许⽤.Net语⾔来调⽤OpenCV函数,如C#、VB、VC++等,同时该封装也可以被编译到Mono平台和允许在Windows、Mac OS、Android、iPhone、iPad等多个平台上运⾏。

OpenCV官⽹:https:///EmguCV官⽹:/wiki/index.php/Main_Page然后EMguCV的⼀些模块的介绍见下图接下来咱们来配置EmguCV(安装与配置环境)1.从官⽹下载安装包(官⽹地址上⾯已经有了)附:安装地址尽量不要安装到C盘,部分win10会出现访问权限限制安装之后如下图2.配置环境变量(在系统⾼级设置⾥⾯的PATH变量)控制⾯板=》系统和安全=》系统=》⾼级系统设置=》⾼级=》环境变量=》系统变量=》PATH添加D:\EmguCV3.3\emgucv-windesktop 3.3.0.2824\bin;D:\EmguCV3.3\emgucv-windesktop 3.3.0.2824\libs\x86;D:\EmguCV3.3\emgucv-windesktop 3.3.0.2824\libs\x64;配置完成后,咱们就可以开始写代码了,在VS上⾯新建控制台项⽬(C#)3.引⽤DLL然后引⽤=》添加引⽤=》浏览=》选择你安装路径下的bin⽂件夹⾥⾯的dll4.选择引⽤之后,再到程序上⾯引⽤命名控件常⽤的类库:using Emgu.CV;using Emgu.CV.Structure;using Emgu.CV.CvEnum;using Emgu.Util;然后开始我们的helloword代码:1 Mat imgscr = CvInvoke.Imread("1.jpg");//读取图像2 CvInvoke.Imshow("img", imgscr);//显⽰图像3 CvInvoke.WaitKey(0);//按键等待。

C#EmguCV机械手相机9点坐标标定

C#EmguCV机械手相机9点坐标标定

C#EmguCV机械⼿相机9点坐标标定很多初学者,都对标定概念模糊不清,分不清坐标系之间的关系,搞不清相机标定和机械⼿相机标定有什么关系,想当初⾃⼰也是⼀个⼈摸索了很久,本⽂将尽量给⼤家解释。

我们通常所说的相机标定分为两种,⼀种是相机参数的标定,这⼀般⽤到张⽒标定法,标定的作⽤是校正相机⾃⾝的畸变,利⽤校正得到的参数对图形进⾏处理后再呈现出来。

关于这⽅⾯的资料,⽹上⼤把,我也不再此说明。

⼀般的机械⼿定位也不会进⾏这个标定,因为现在的相机畸变还是很⼩的,精度可以满⾜⼤多数要求。

本⽂要介绍的是第⼆种,相机和机械⼿之间的标定,作⽤:建⽴相机坐标系和机械⼿坐标系之间的关系,即给机械⼿装上眼睛,让它去哪就去哪。

常⽤的⽅法是9点标定,所⽤到函数是EstimateRigidTransform,⽹上关于 estimateRigidTransform 的详细说明很少,Emgucv的⼏乎没有。

当时找了N久,⼀度以为opencv没有坐标系转换的算法,差点就投奔halcon去了,不得不说,opencv在机器视觉⽅⾯的应⽤是完全不如halcon的。

EstimateRigidTransform有两个⽅法。

⽅法⼀:Mat EstimateRigidTransform(PointF[] sourcePoints, PointF[] destinationPoints, bool fullAffine);返回的是⼀个2*3的double的矩阵。

第⼀个参数sourcePoints:换之前图像上的点(相机坐标系下的点)第⼆个参数destinationPoints:换之后图像上的点(机械⼿坐标系下的点)第三个参数fullAffine: TRUE(全仿射变换,包括:rotation, translation, scaling,shearing,reflection)FALSE(带有约束的仿射变换)⽅法⼆:Mat EstimateRigidTransform(IInputArray src, IInputArray dst, bool fullAffine); //返回的是图像第⼀个参数src:变换之前的图像第⼆个参数dst:变换之前的图像第三个参数fullAffine: TRUE(全仿射变换,包括:rotation, translation, scaling,shearing,reflection)FALSE(带有约束的仿射变换)因为我们需要的是坐标点,所以选⽤第⼀个函数。

emgucv例子

emgucv例子

emgucv例子
Emgu CV(也称为Emgu Computer Vision)是一个基于OpenCV
库的跨平台计算机视觉库,它提供了用于图像处理、对象检测、人
脸识别、视频分析等功能的丰富工具和类库。

下面我将从多个角度
来介绍Emgu CV的例子。

首先,Emgu CV提供了丰富的图像处理功能,包括图像滤波、
边缘检测、图像变换等。

例如,你可以使用Emgu CV来实现图像的
模糊处理、边缘检测以及图像的缩放和旋转等操作。

这些功能可以
帮助你处理图像数据,提取特征并进行后续的分析和识别。

其次,Emgu CV还支持对象检测和识别。

你可以利用Emgu CV
提供的算法和工具来实现目标检测、物体跟踪以及形状识别等功能。

例如,你可以使用Emgu CV来开发一个人脸识别系统,检测视频中
的人脸并进行识别和跟踪。

此外,Emgu CV还提供了丰富的视频处理功能。

你可以利用Emgu CV来实现视频的读取、处理和分析,包括视频流的捕获、帧
处理、运动检测等。

这些功能可以帮助你开发视频监控系统、视频
分析系统以及视频内容识别等应用。

总之,Emgu CV提供了丰富的计算机视觉功能和工具,可以帮助开发者快速实现图像处理、对象检测、人脸识别、视频分析等功能。

通过使用Emgu CV,开发者可以更加高效地开发和部署计算机视觉应用,实现图像和视频数据的分析和识别。

希望这些例子可以帮助你更好地了解Emgu CV的功能和应用。

基于EmguCV的GPU加速人脸识别

基于EmguCV的GPU加速人脸识别

信息科学①基金项目:本文获江苏省淮安市国际合作科技项目(项目编号:HAC201618)资助。

DOI:10.16660/ki.1674-098X.2018.09.150基于Emgu CV的GPU加速人脸识别①李刚 孙平(淮阴师范学院 江苏淮安 223300)摘 要:Emgu CV是.NET平台下对OpenCV图像处理库的封装,可以实现人脸识别的判断。

本文着重讨论了在.NET 下基于Emgu CV利用GPU加速技术实现了静态图像的人脸检测、人脸识别、人脸比对,以及视频流中的人脸识别。

该软件获得我校技术进步二等奖,实验结果证明本程序运行稳定,结果可靠,识别速度快。

关键词:Emgu CV GPU加速 人脸检测 人脸识别中图分类号:TP39 文献标识码:A 文章编号:1674-098X(2018)03(c)-0150-04 Abstract: Emgu CV is OpenCV image processing library encapsulation on .net platform, that can be used to realize face recognition judgment. This article emphatically introduced Emgu CV graphics library for face detection, face match, and face recognition in image and in video as well, with the assist of GPU speeding technology. This implemented procedure was granted 2nd prize in the Advanced Technologies in Huaiyin Normal University. Long-time running demos show the procedure worked stably, reliably and quickly.Key Words: Emgu CV; GPU; Face Detection; Face Recognition人脸识别作为一种成熟而新颖的生物特征识别技术,具有识别精度高,识别速度快,使用方便,不易被仿冒等优点,与虹膜识别、指纹扫描等这些生物特征识别技术相比,人脸识别技术在各个应用方面都表现出得天独厚的技术优势,而且成本低廉,易于推广使用,企业用户的接受程度非常高。

emgucv 计算像素平均值

emgucv 计算像素平均值

emgucv 计算像素平均值EmguCV是一个基于C#编写的开源计算机视觉库,它提供了丰富的图像处理与计算机视觉函数和算法。

在EmguCV中,计算像素平均值是一个非常常见的操作,本文将介绍如何使用EmguCV来计算像素平均值,并对此进行详细解析。

首先,我们需要导入EmguCV库并创建一个图像对象。

EmguCV提供了Image类来表示一个图像,我们可以使用该类来加载、保存和处理图像。

```csharpusing Emgu.CV;using Emgu.CV.Structure;Image<Bgr, byte> image = new Image<Bgr,byte>("path_to_image.jpg");```在上述代码中,我们使用了Image<Bgr, byte>泛型类来表示一个RGB图像。

通过指定泛型参数,我们可以指定图像的颜色空间和像素数据类型。

接下来,我们需要将图像转换为灰度图像。

在计算像素平均值时,一般将图像转换为灰度图像,这样可以简化计算过程。

```csharpImage<Gray, byte> grayImage = image.Convert<Gray, byte>();```在上述代码中,我们使用了Convert方法将RGB图像转换为灰度图像。

Convert方法接受一个目标图像类型作为参数,并返回一个转换后的图像对象。

然后,我们需要计算图像的像素平均值。

对于灰度图像,像素的取值范围是0-255,我们可以通过遍历图像的所有像素,并计算所有像素值的总和,再除以像素总数来得到平均值。

```csharpdouble total = 0;int count = 0;for (int y = 0; y < grayImage.Height; y++){for (int x = 0; x < grayImage.Width; x++){total += grayImage.Data[y, x, 0];count++;}}double average = total / count;```在上述代码中,我们使用了Data属性来获取图像的像素数据。

颜色直方图的计算、显示、处理、对比及反向投影

颜色直方图的计算、显示、处理、对比及反向投影

颜色直方图的计算、显示、处理、对比及反向投影(How to Use Histogram? Calculate, Show, Process, Compare and BackProject)作者:王先荣前言颜色直方图直观的显示了图像在色彩空间的分布状况,本文将讨论在EmguCv及OpenCv中跟直方图相关的一些基本操作,包括:计算、显示、处理、对比及反向投影,并谈谈在实践过程中得到的一些经验。

如无特别说明,下文所提的直方图均指颜色直方图。

直方图的计算EmguCv将OpenCv的一系列直方图函数封装到了类DenseHistogram里面,可以用方法Calculate方便的计算图像的直方图。

不过值得注意的是,该方法接受的第一个参数是“单通道”图像数组;而一般情况下的图像都是3通道的,在计算之前我们需要用Image<TColor,TDepth>.Split方法将其分解成单通道图像,然后选择需要参与直方图计算的通道。

下面有几段计算直方图的代码,分别计算单通道(红色)直方图、色调和饱和度直方图。

计算直方图///<summary>///计算直方图(红色)///</summary>private void CalcHistRed(){//计算int rBins = 256;RangeF rRange = new RangeF(0f, 255f);Image<Bgr, Byte> imageSource = new Image<Bgr, By te>((Bitmap)pbSource.Image);Image<Gray, Byte> imageRed = imageSource.Split() [2];DenseHistogram hist = new DenseHistogram(rBins, rRange);hist.Calculate(new IImage[] { imageRed }, false, null);//显示pbHistogram.Image = GenerateHistImage(hist).Bitm ap;//释放资源imageSource.Dispose();imageRed.Dispose();hist.Dispose();}///<summary>///计算直方图(色调和饱和度)///</summary>private void CalcHistHs(){//计算int hBins = 180;RangeF hRange = new RangeF(0f, 179f); //色调的范围在0~180之间int sBins = 256;RangeF sRange = new RangeF(0f, 255f);Image<Bgr, Byte> imageSource = new Image<Bgr, By te>((Bitmap)pbSource.Image);Image<Hsv, Byte> imageHsv = imageSource.Convert< Hsv, Byte>(); //将色彩空间从BGR转换到HSVImage<Gray, Byte>[] imagesHsv = imageSource.Spli t(); //分解成H、S、V三部分DenseHistogram hist = new DenseHistogram(new int [] { hBins, sBins }, new RangeF[] { hRange, sRange });hist.Calculate(new IImage[] { imagesHsv[0], imag esHsv[1] }, false, null);//显示pbHistogram.Image = GenerateHistImage(hist).Bitm ap;//释放资源imageSource.Dispose();imageHsv.Dispose();foreach (Image<Gray, Byte> image in imagesHsv)image.Dispose();hist.Dispose();}直方图的显示我们可以用以下方式来查看直方图:(1)使用HistogramViewer窗体显示直方图;(2)使用HistogramBox控件显示直方图;(3)用自己写的方法将直方图转换成图像,然后显示出来。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Normalize
规范化输入数组
Randn(IInputOutputArray, IInputArray, IInputArray)
用正态分布的随机数填充数组
Randn(IInputOutputArray, MCvScalar, MCvScalar)
用正态分布的随机数填充数组
RandShuffle
将原数组(矩阵)打乱
用于标定立体相机
StereoRectify
计算每个摄像机的旋转矩阵(虚拟地)使两个摄像机图像平面处于相同的平面。
StereoRectifyUncalibrated
在不知道摄像头的固有参数和它们在空间的相对位置计算校正变换
方法
CalibrateCamera(IInputArray, IInputArray, Size, IInputOutputArray, IInputOutputArray, IOutputArray, IOutputArray, CalibType, MCvTermCriteria)
cvGetRawData
以低级别信息填充输出变量。
cvGetRow
返回头文件信息,对应于输入数组的指定行。
cvGetRows
返回头文件信息,对应输入数组的指定行跨度。
cvGetSubRect
返回头文件,对应于输入数组的指定矩形。换句话说,它允许用户将输入阵列的一部分视为独立阵列。通过还可提取ROI的子阵列。
计算源数据的加权平均和,使得acc变为帧序列的运行平均值(Calculates weighted sum of input src and the accumulator acc so that acc becomes a running average of frame sequence: acc(x,y)=(1-alpha) * acc(x,y) + alpha * image(x,y) if mask(x,y)!=0 where alpha regulates update speed (how fastaccumulator forgets about previous frames).
StereoCalibrate(MCvPoint3D32f[][],PointF[][],PointF[][], IInputOutputArray, IInputOutputArray, IInputOutputArray, IInputOutputArray, Size, IOutputArray, IOutputArray, IOutputArray, IOutputArray, CalibType, MCvTermCriteria)
方法
Add
数组相加
AddWeighted
数组权重相加
Add
数组相加
AddWeighted
数组权重相加
BitwiseAnd
计算两个数组的每元素的逐位逻辑连接:dst(I)= src1(I)&src2(I)if mask(I)!= 0。所有数组必须具有相同的类型(除了掩膜)和大小
dst(I)=src1(I) & src2(I)
cvInitImageHeader
初始化图像的头文件结构,指针指向由用户指定,并返回指针。(Initializes the image header structure, pointer to which is passed by the user, and returns the pointer.)
估计每个视图的照相机固有参数和外部参数
CalibrateCamera(MCvPoint3D32f[][],PointF[][], Size, IInputOutputArray, IInputOutputArray, CalibType, MCvTermCriteria,Mat[],Mat[])
估计每个视图的照相机固有参数和外部参数
SolvePnPRansac
利用Ransac方法利用点对求解相机的旋转矩阵(虚拟地)使两个摄像机图像平面处于相同的平面。
Undistort
转换图像以补偿径向和切向透镜失真
UndistortPoints
与cvInitUndistortRectifyMap相似但也不同,相似的内容是他们都可用于校正镜头失真和透视变换。不同的是函数cvInitUndistortRectifyMap实际上执行的是反向转换以初始化地图,而这个函数执行的是正向变换。
找到圆圈网格中心
GetDefaultNewCameraMatrix
返回默认的新相机矩阵
GetOptimalNewCameraMatrix
基于自由缩放参数返回新的相机矩阵
StereoCalibrate(IInputArray, IInputArray, IInputArray, IInputOutputArray, IInputOutputArray, IInputOutputArray, IInputOutputArray, Size, IOutputArray, IOutputArray, IOutputArray, IOutputArray, CalibType, MCvTermCriteria)
cvSet2D
为数组的特定元素分配新值
Determinant
返回方阵矩阵的行列式。
Eigen
计算对称矩阵的特征值和特征向量
Exp
计算输入数组的每个元素的指数
dst(I)= exp(src(I))
FindFundamentalMat
使用四种方法之一计算基本矩阵,如果没有找到矩阵,则返回找到的基本矩阵(1或3)和0的数量
Sqrt
为源数据的每个数组元素开方。多通道数据每个通道会被单独处理
Sum
对每个通道计算阵列元素的和S、
Sc = sumI arr(I)c
SVBackSubst
进行奇异值回代(Performs a singular value back substitution.)
SVDecomp
SVD分解,将矩阵A分解为对角矩阵和两个正交矩阵的乘积
Norm(IInputArray, NormType, IInputArray)
返回计算的范数。多通道阵列被视为单通道,即所有通道的结果相加。
Norm(IInputArray, IInputOutputArray, NormType, IInputArray)
返回计算的范数。多通道阵列被视为单通道,即所有通道的结果相加。
用于标定立体相机(Estimates transformation between the 2 cameras making a stereo pair. If we have a stereo camera, where the relative position and orientatation of the 2 cameras is fixed, and if we computed poses of an object relative to the fist camera and to the second camera, (R1, T1) and (R2, T2), respectively (that can be done with cvFindExtrinsicCameraParams2), obviously, those poses will relate to each other, i.e. given (R1, T1) it should be possible to compute (R2, T2) - we only need to know the position and orientation of the 2nd camera relative to the 1st camera. That's what the described function does. It computes (R, T) such that: R2=R*R1, T2=R*T1 + T)
BitwiseOr
计算两个数组的每元素逐位分离(Calculates per-element bit-wise disjunction of two arrays)
dst(I)=src1(I)|src2(I)
CalcCovarMatrix
计算一组向量的协方差矩阵
cvClearND
清除(设置为零)密集数组的特定元素或删除稀疏数组的元素。如果买没有元素,该函数不运行
Swap(Mat, Mat)
交换两个矩阵
Swap(UMat, UMat)
交换两个矩阵
Trace
返回矩阵对角线元素之和
Transform
对src数组的每个元素进行矩阵变换,并将结果存储到dst中。源数组和目标数据应该有相同的深度、尺寸或ROI的尺寸。transmat和shiftvec应该是浮点型矩阵
Transpose
Gemm
执行广义矩阵乘法
dst = alpha*op(src1)*op(src2) + beta*op(src3), where op(X) is X or XT
Flip
以不同的3种方式翻转数组(行和列索引为0)
Invert
反转矩阵src1并将结果存储在src2中
InvertAffineTransform
反转仿射变换
LUT
使用查找表中的值填充目标数组
Max
计算两个数组的每个元素最大值赋给新数组
dst(I)=max(src1(I), src2(I))
Min
计算两个数组的每元素最小值,赋值到新数组中
dst(I)= min(src1(I),src2(I))
MinMaxIdx
查找数组中全局的最大值最小值
MinMaxLoc
Randu(IInputOutputArray, IInputArray, IInputArray)
相关文档
最新文档