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
-1
votes
1 answer

How to append data to an existing .mat file without loading the existing data from that mat file in MATLAB?

I have a very huge chunk of data say about 3GB. When I try to load it and save it in a mat file, my laptop hangs as I have only 4GB RAM. Now I figured if I can divide my original data in smaller chunks and do whatever processing i need to do and…
-1
votes
1 answer

Mat explicit assignment error opencv

I am trying to initialize a Mat variable, that will hold the following matrix [1,0,0,0 0,1,0,0 0,0,1,0 0,0,0,1] From this link, I got a method to do this and implemented the same Mat Tfrm =…
Lakshmi Narayanan
  • 5,220
  • 13
  • 50
  • 92
-1
votes
1 answer

Why labels give me error

I am labeling my images but this part of my code give me error runtime error , where i assign the labels to it , when i remove this line code runs fine : int count_2=0; cv::Mat training_mat(num_img , dictionarySize,CV_32FC1); cv::Mat…
Rocket
  • 553
  • 8
  • 31
-1
votes
1 answer

Error reading values from Mat

I am trying to implement HMM in opencv. First i create arrays of double, and copy them to Mat variables, Mat INIT = Mat(0,3,CV_64F,trans).clone(); Then i am trying to access the individual pixel/position values from the matrix as: cout <<…
informeto
  • 162
  • 2
  • 14
-2
votes
2 answers

How to skip a step if a condition is met in a previous step - Stepper | Angular Material

How do I skip a step using a true/false condition of a variable present in a few steps back?
Kountou
  • 1
  • 2
-2
votes
2 answers

How to build cv::Mat from coloured rectangles

My goal is to create yield maps using OpenCV. These yield maps need to be built with coloured rectangles to indicate yield. An example of a Mat built by rectangles here. So is it possible to create a cv::Mat with coloured rectangles? The amount of…
Epsi
  • 115
  • 7
-2
votes
1 answer

Different values in accessing openCV Mat

I'm facing a strange problem. My Mat is declared as: cv::Mat matr(src.rows, src.cols, CV_32FC1); If i print it using cout<
0abc0cba0
  • 7
  • 5
-2
votes
1 answer

Converting vector of floats in CHW format to a cv::Mat

I have a std:vector storing elements in CHW format. Here, C=8, H=48, W=48. I wish to store this in a cv::Mat in HWC format. I am clueless as to how to do this.
user11733000
-2
votes
2 answers

Getting java.lang.IllegalArgumentException: width and height must be > 0 error while initializing Mat in android

I am trying to initialize Mat and this is my code Mat imgRgba = new Mat(); final Bitmap bitmap = Bitmap.createBitmap(imgRgba.width(), imgRgba.height(), Bitmap.Config.RGB_565); Utils.matToBitmap(imgRgba, bitmap); I have tried this…
-2
votes
2 answers

How to fix Angular bug requiring user to click a separate element before choosing a second mat chip

Here is the link for an example of the issue I will attempt to describe. In the chips autocomplete example, click the text box to select a new fruit. Now, before clicking anywhere else, click again on the text box as you did before. This should…
Tim Kelly
  • 1
  • 6
-2
votes
1 answer

i need a function opencv in java return the percentage of the color in the mat , please

i need a function opencv in java return the percentage of the color in the mat , please public boolean procentage(Mat imageOne, int porsontageDeChangemnt) { boolean tr = false; int width = (int) imageOne.width(); int height = (int)…
Amine
  • 1
  • 1
-2
votes
1 answer

Can not read .mat file into python

I have been trying for days, searching for the proper way to read this file in my python project. Which is an ordinary matlab datastructure file. https://drive.google.com/open?id=1E1w1eQn6pTcQ1lkhGMJzmB5ugtmaDPht I am familiar about how to read h5…
mahmoud fathy
  • 361
  • 1
  • 7
  • 17
-2
votes
1 answer

How to get a cv::Mat to 2 by 2 maximum value mean?

0, 1, 0, 0 ,0, 0 0, 0, 2, 0 ,4, 0 0, 1, 0, 5 ,0, 0 0, 0, 1, 0 ,1, 0 0, 0, 0, 0 ,1, 0 I am using opencv. Assume that cv: mat data is the same as the above array. I want to get the average of the maximum of 2 by 2 of the array. As great as …
김주환
  • 17
  • 6
-2
votes
1 answer

Read from .mat file

working with MATLAB, I have a Matrix M, I want to save it in a .mat file then import it and reuse it in my code. I have tried: save ('file1.mat','M') MSaved=load('file1.mat'); Name | Size | Bytes | Class |…
user3967257
  • 69
  • 1
  • 5
-2
votes
1 answer

How to convert a Mat object of OpenCV into a int?

I am new in OpenCV code. I am working on a project and I need to split a video signal in its 3 different components. I have already obtain the RGB matrix of the video signal such us mat object. However, I need to convert this mrgba mat into a int to…
1 2 3
62
63