Questions tagged [opencv-mat]

A part of OpenCV API

An OpenCV API part: http://docs.opencv.org/modules/core/doc/basic_structures.html

65 questions
0
votes
2 answers

bug in cv::Max?

Either I am doing something very wrong, or there is a problem with cv::max. I am calling it in the most obvious way possible: #include #include int main() { cv::Mat t1 = cv::Mat::zeros(cv::Size(3,3), CV_8UC1); …
cduguet
  • 442
  • 3
  • 21
0
votes
0 answers

How to make cv::Mat_ objects

I need to use class cv::Mat_ from OpenCV library for performing some data processing. I have a struct type such as this struct data{short a; short b; short c; } If I try to create a cv::Mat_ object like this, cv::Mat_d_cells(10,50); I get…
Max
  • 1
  • 1
0
votes
0 answers

Segmentation Fault on using PyArray_SimpleNewFromData on converting mat to numpyarray

Strange Segmentation Fault in PyArray_SimpleNewFromData Segmentation fault in PyArray_SimpleNewFromData I am posting this question after trying all the possible solutions in the two posts mentioned above, I am still facing a segmentation. My Code is…
0
votes
2 answers

Confused by OpenCV image representation

I'm loading image into cv::Mat. For some reason, when I'm printing each pixel data, color doesn't match with actual image pixels. Clearly, there is no (28, 36, 255), (127, 127, 255) colors on the image. Could someone point to my mistake? Here are…
Peter
  • 435
  • 1
  • 3
  • 11
0
votes
1 answer

OpenCV 2.4 : C API for converting cvMat to IplImage

I'm having an YUYV image buffer in cvMat object (snippet shown below). I had to convert this cvMat object to IplImage for color conversion. CvMat cvmat = cvMat(480, 640, CV_8UC2, yuyv_buff); I tried the below options to convert this cvmat object to…
Avis
  • 988
  • 2
  • 11
  • 31
0
votes
1 answer

OpenCV Mat to Qt QString

I'm using opencv in a Qt app. I've seen some generic c++ ways of printing out the values of a Mat and have done so with cout << "myMat = "<< endl << " " << myMat << endl << endl; Ideally I could have a QString with the contents of this Mat. Is…
C Banana
  • 45
  • 9
0
votes
1 answer

OpenCV C2 types of images?

Does the second channel of a C2 image represent the alpha channel or do they just fill the gap between C1-C3,C4?
kobermann
  • 45
  • 5
0
votes
0 answers

Converting char* to cv::Mat in NDK Android studio

I have a native C++ method, which I am using to read an image called "hi.jpg". The code below finds the asset, and loads the data into a char* buffer. (I've tried other methods such as imread() and the file is not found). I would then like to change…
Ber12345
  • 89
  • 1
  • 12
0
votes
1 answer

CvMat: sizes of input arguments do not match

My code opens image with road signs, detects them, rescale to specified size and then puts them into matrix. vector > contours; vector hierarchy; findContours(maski, contours, hierarchy, CV_RETR_EXTERNAL,…
Magda1993
  • 23
  • 5
0
votes
2 answers

How to divide an image in four quadrants and rotate 180 degrees the quadrant 1 and 4 with OpenCV?

So, I have this activity when I have to take an image, divide it into four quadrants and then rotate the quadrants 1 nd four in the same imagen, without creating another window. I have already this code but I just got to make the rotations in…
Monica S
  • 1
  • 1
0
votes
1 answer

Crashing app at UIImageFromCVMat() in iOS

Here is the Code I have used to Convert CVMat to UIImage using OpenCV. With this Code everything works fine there is NO Crash in that. But Color gets changed. -(UIImage *)UIImageFromCVMat:(cv::Mat)cvMat { cvtColor(cvMat, cvMat,…
Mrug
  • 4,963
  • 2
  • 31
  • 53
0
votes
1 answer

How to use OpenCV's cv::Mat& to calculate "Coefficient of Variation"?

I'm trying to build an iOS to detect image changes from Camera. OpenCV's iOS SDK kindly provides a delegate method passing cv::Mat&. How can I calculate "Coefficient of Variation" using cv::Mat& ? Should I look for a solution from combining multiple…
petershine
  • 3,190
  • 1
  • 25
  • 49
0
votes
1 answer

OpenCV clone() and copyTo() methods don't produce Mat of same type as original?

I am new to OpenCV and following along with a book. I am trying to extract a binary image indicating component regions with the following: cv::Mat result; result = image.clone(); cv::watershed(image, result); When executed, this produces the…
Cauchy Kun
  • 177
  • 2
  • 11
0
votes
0 answers

Multidimensional cv::Mat initialization and display

Being a Matlab/Python guy and a novice in C++, I'm having major frustration moving to OpenCV in C++ for image processing purposes. I'm working with Kinect v2 so there is only one Windows example I found online which I'm modifying. This example gives…
AVJ
  • 213
  • 3
  • 11
0
votes
0 answers

Trying a Matching Contours, trouble with CV Mat and Iplimage

I am doing a Matching Contours test. Here I use image called "refshape.bmp" (link: https://www.dropbox.com/s/06hrjji49uyid4w/refshape.bmp?dl=0) And image called "2.bmp" (link: https://www.dropbox.com/s/5t73mvbdfbtqvs1/2.BMP?dl=0) to do this…