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
3 answers

Convert an open cv mat to an integer array

I am trying to convert an open cv mat of type CV_8UC3 (RGB) to an integer array. void copyMatToJIntArray(Mat m,jint* jia) { Mat tempMat; cvtColor(m,tempMat,CV_BGRA2RGB); jint size = tempMat.rows*tempMat.cols* tempMat.elemSize(); …
MacLiamor
  • 1
  • 1
  • 3
-1
votes
1 answer

Draw bean machine

I'm trying to draw Bean Machine as follow: @Override protected void paintComponent(Graphics g) { super.paintComponent(g); int width = getWidth(); int height = getHeight(); int xCenter = getWidth() / 2; int yCenter = getHeight()…
user7664681
-1
votes
1 answer

Indexing inside a nested loop in matlab

I would like to create a matrix to hold the result of functions in a nested loop as follow: list = [0.01; 0.03; 0.1; 0.3; 1; 3; 10; 30]; res = zeros((size(list,1)),(size(list,1))); for i = list for j = list res(i,j)=function(depending on i…
KH_
  • 305
  • 4
  • 13
-1
votes
2 answers

Calculating change of values between same day in different years

I need to calculate so called MAT (Movie Anual Total), means the % change in sales value between same day in two different year: ID Sales Day Month Year A 500 31 12 2015 A 100 1 1 2016 A 200 2 1 2016 ... …
aannie
  • 7
  • 2
  • 8
-1
votes
1 answer

constructing image after applying inverse fourier transform opencv

I am trying to apply fourier transform to an image, by following the code from link http://www.docs.opencv.org/2.4/doc/tutorials/core/discrete_fourier_transform/discrete_fourier_transform.html , after this I am trying to remove the noise components…
Bala
  • 19
  • 4
-1
votes
2 answers

OpenCV decode CV_32FC1 into png

I would like to convert a OpenCV CV_32FC1 Mat into a png to save it and later use it in a Unity Shader. I would like to decode it so that the first channel contains the highest 8 bits, the second channel the next 8 bits and the third channel the…
BT9
  • 87
  • 1
  • 11
-1
votes
2 answers

How to create mat file containing video in it

I'm new to matlab programming.I have an image processing code which helps to load a mat file in it. the code accepts .mat file as input with video file in it. …
zoho_deployment
  • 137
  • 2
  • 19
-1
votes
1 answer

Fail assertion opencv mat.inl.hpp line 930

I have a trivial problem but I don't know how to solve it. I just wanna do a simple "foreach" of a Mat to view rgb values. I have next code: for(int i=0; i
-1
votes
1 answer

opencv MAT multiplication tips (java)

I am trying to make a simple mat multiplication (following this example) but it is giving me a very strange error. I am implementing this on processing IDE by the way. import gab.opencv.*; import org.opencv.core.Mat; import…
Bontempos
  • 77
  • 8
-1
votes
1 answer

vector opencv issues

I am trying to read images of size 19x19 into vector. I have 2429 number of such images. But when I run my code, I am sure some Mat images are not read into the vector. Is it a memory issue. If yes, can anyone help me. I confirmed this after having…
-1
votes
1 answer

Is there a way to make a dft from an complex ma

the problem is to fourie transform ( cv::dft ) a signal with fourie descriptors. So the mat should be complex numbers :( But my problem is how can make a mat with complex numbers ? Please help me to find an example or any other that show me how to…
Alf85
  • 1
  • 3
-1
votes
2 answers

Update a M.file variables from command windows in Matlab?

I have a simple but interesting question. i tired hard to google it but my google got upset and giving me the same results... i wanted to know is it possible to Update a constant variable form workspace command.. A Simple Example: function y…
user2851655
  • 133
  • 2
  • 9
-1
votes
2 answers

Load many images in vector Opencv

I'm trying to store multiple images in a folder on a vector for later processing. The problem is that I get the error: *Debug Assertion Failed! Expression: vector subscript out of range.* The code that I'm testing is as follows. stringstream…
Azucena Lobato
  • 9
  • 1
  • 1
  • 2
-1
votes
2 answers

Accessing a cv::Mat independently from its size

I need to access a cv::Mat, but i don't have to know the sizeof the Matrix, so is there a way to access the elements of a cv::Mat for all the sizes? I mean without doing a switch on the type of the Matrix. So this is what i have : int image_type =…
Othman Benchekroun
  • 1,998
  • 2
  • 17
  • 36
-1
votes
1 answer

What is the equivalent function for " cvWriteFrame " to use Mat - image type?

What is the equivalent function for " cvWriteFrame " to use Mat - image type ? In IplImage it can be done using like below: CvVideoWriter *writer; IplImage* frame = " IMAGE "; cvWriteFrame(writer, frame); How to write video for Mat Files.
RoboMe
  • 113
  • 2
  • 13