English 中文(简体)
为什么在把开放式散货单乘数时结果不同?
原标题:Why are the results different when multiplying OpenCV Mats?
  • 时间:2023-12-21 02:23:41
  •  标签:
  • opencv
  • mat

这里的转变是4x4 汇总表

1.000, 0.000, -0.004, 0.784,
-0.000, 1.000, 0.001, -0.205,
0.004, -0.001, 1.000, -1.435,
0.000, 0.000, 0.000, 1.000

这里是一种三维病媒

507.347,359.172,229.584

我开展了以下开放式散货单复制作业:

双重数据[]={507.347、359.172、229.584、1};

cv::Mat s(4, 1, CV_64F, data);
cv::Mat d = transformMatrix * s;

产出结果如下,但与使用计算器计算的价值不同。

开放CV Mat Multiply result = 矩阵* (507.347,359.172,229.584) = (507.394,359.158,229.605)

计算结果=507.213,359.197,230.538

为什么结果不同? 刑法是否有错误?

问题回答

我研究了这一法典(C++):

cv::Matx<double,4,4> M =
{
    1.000, 0.000, -0.004, 0.784,
    -0.000, 1.000, 0.001, -0.205,
    0.004, -0.001, 1.000, -1.435,
    0.000, 0.000, 0.000, 1.000
};

double data[] = { 507.347, 359.172, 229.584, 1 };
cv::Mat s(4, 1, CV_64F, data);

auto Result = M * s;
std::cout << Result;

但产出变成:

[507.212664;
 359.196584;
 229.819216;
 1]

页: 1





相关问题
Python/OpenCV: Converting images taken from capture

I m trying to convert images taken from a capture (webcam) and do some processing on them with OpenCV, but I m having a difficult time.. When trying to convert the image to grayscale, the program ...

How to smooth a histogram?

I want to smooth a histogram. Therefore I tried to smooth the internal matrix of cvHistogram. typedef struct CvHistogram { int type; CvArr* bins; float thresh[CV_MAX_DIM][2]; /* ...

Testing complex datatypes?

What s are some ways of testing complex data types such as video, images, music, etc. I m using TDD and wonder are there alternatives to "gold file" testing for rendering algorithms. I understand that ...

Displaying OpenCV iplimage data structures with wxPython

Here is my current code (language is Python): newFrameImage = cv.QueryFrame(webcam) newFrameImageFile = cv.SaveImage("temp.jpg",newFrameImage) wxImage = wx.Image("temp.jpg", wx.BITMAP_TYPE_ANY)....

What is the memory structure of OpenCV s cvMat?

Imagine I have the following: CvMat* mat = cvCreateMat(3,3,CV_16SC3) This is a 3x3 matrix of integers of channel 3. Now if you look at OpenCV documentation you will find the following as the ...

Face detection and comparison

I m running a small research on face detection and comparison for my article. Currently, I m using rapid face detection based on haar like features based on OpenCV cascade (I ll implement learning ...

热门标签