English 中文(简体)
公开v
原标题:matrix type conversion in opencv
  • 时间:2011-06-27 06:51:56
  •  标签:
  • opencv

在过滤器的帮助下,我试图将图像汇集到CV_64F类的矩阵中,并储存在过滤器上。 D职能公开。 但是,目的地矩阵的类型有所变化,在分配帮助下,试图将其改成CV_64F。 To 0r Convert 发挥职能,但我无法这样做。 谁能帮助? 这是我守则的内容。

                     cv::Mat op = cv::Mat(25,25,a.type(),Arr1); // a is the image matrix and op is the filter.
         cv::Point anchor = Point(-1,-1);
         cv::Mat b = cv::Mat(a.size(),CV_64F);
         cv::Mat l = cv::Mat(a.size(),CV_64F);
         cv::Mat m = cv::Mat(a.size(),CV_64F);

        //prnmt(a);

         filter2D(a,b,-1,op,anchor,0,BORDER_DEFAULT);
         b.assignTo(l,CV_64F);
最佳回答

我尝试使用以下与《开放CV》2.3相同的代码,并在打电话到<编码>2D后,即:< 编码>bs>。

cv::Mat a(100, 100, CV_64F); 
cv::Mat op(25, 25, CV_64F);
cv::Mat b(a.size(), CV_64F);
cv::Mat l(a.size(), CV_64F);
cv::Mat m(a.size(), CV_64F);
cv::Point anchor(-1, -1);

filter2D(a, b, -1, op, anchor, 0, cv::BORDER_DEFAULT);

您的代码是<代码>a?

b改为filter2D?

Which version of OpenCV are you using?

问题回答

暂无回答




相关问题
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 ...

热门标签