Questions tagged [mat]

Use this tag for questions dealing with opencv cv::Mat (or cvMat) data structure. Use [mat-file] tag for Matlab binary file format. Use [matrix] tag for other types of 2D numeric data structures.

cv::Mat (or cvMat) is a basic data structure defined by to handle tabular (2D or 3D) numeric data.

DO NOT CONFUSE THIS TAG WITH
for general data structures for tabular numeric data.
for Matlab's binary file format.

941 questions
-2
votes
2 answers

what is the meaning of Mat drawing = Mat::zeros( canny_output.size(), CV_8UC3 );?

Mat drawing = Mat::zeros( canny_output.size(), CV_8UC3 ); this is a part of code what this really does is making a object in Mat structure called drawing i don't really understand what is with Mat::Zeros please help me i am new to open cv and c++..
Shamane Siriwardhana
  • 3,951
  • 6
  • 33
  • 73
-2
votes
1 answer

Mat pointer( Mat *arr) initiallize

I was studying opencv, mat structure. But, In source code, it used a mat pointer. (Image) But, It occured error. because, Mat *costVol isn't initiallized. I don't know how to initialize the costVol, variable. code: Mat lGray, rGray; Mat tmp; Mat…
-2
votes
1 answer

What is ~ operator in opencv , C++?

I encountered the following while trying to convert some C++ code that uses OpenCV to Java. I'd like to know what the ~ operator does to the Mat object gradient_grown in the following code and what's the Java equivalent to this? Mat…
-2
votes
1 answer

how to save matrix with type *.mat then load it in matlab?

how to save matrix with extension .mat for example I've this matrix : x = round (100*rand(4,4)) I want to save x matrix in file x.mat then load it which can access element of this matrix, I tried by loading x.matrix but it was gave me struct 1X1
sarot
  • 49
  • 1
  • 1
  • 4
-3
votes
1 answer

Download a vector of GpuMats to host

I have a std::vector that I want to access on my host. How would I perform one batch memcpy operation (or download operation) to return a vector of cv::Mats? I am running this on the Jetson TX2, so I have the ability to do unified shared memory.
-3
votes
1 answer

How to convert .pgm file to .mat file in Matlab?

I have to convert 'Yale' dataset whose format is .pgm to .mat file, I searched about this issue but couldn't find anything. I appreciate any help.
Samaneh Rezaei
  • 73
  • 2
  • 11
-3
votes
1 answer

Trapezodial Rule Matlab

I am completing an assignment for a class. We were to follow a flow chart to find the values for the trap rule code. I believe the problem is with my main code. I am not sure if there is a problem with my function code or my main code, any help…
mrh0028
  • 11
  • 2
-4
votes
1 answer

Assertion failed I couldn't find the cause of the problem

for (size_t i = 1; i < count + 1; i++) { Mat img = vFrames[i - 1].Image1; Mat half1(mFinalImage, cv::Rect(-final_vector[i - 1].x + minx + abs(minx), -final_vector[i - 1].y - miny + abs(maxy), img.cols, img.rows)); …
-4
votes
1 answer

cv::Mat.data always returns the same value

I have a red image - just for testing. The RGB Color is (217/18/36). I perform the following code: void QuaterImage(Mat& SrcImage, Mat& DestImage, bool Downsample) { int newWidth = 0, newHeight = 0; int newOrigWidth = 0, newOrigHeight = 0; …
Jan021981
  • 521
  • 3
  • 28
-4
votes
2 answers

Opencv: How to Split a Mat into its BGR color channels

I am coding this system in Java, and I would like to split a Mat into its 3 specific color channels so that I may work on each color channel separately. Ideally when the image is split, its channels will be stored as Mats as well. My end goal is to…
-4
votes
1 answer

OpenCV: How do I make a Mat colorized where the Mask is white

I am new to OpenCV and just doing a basic RGB color filter. I was doing this by testing each pixel, but that's inefficient. So I tried Core.inRange but that returns a mask (black and white) and I need a colored Mat. Here is what I currently have: //…
Titan
  • 33
  • 10
1 2 3
62
63