Ask Your Question

IIVirusII's profile - activity

2020-01-07 15:24:27 -0600 received badge  Supporter (source)
2019-12-30 14:02:40 -0600 received badge  Student (source)
2019-12-30 06:14:30 -0600 commented answer Convert a 2D array to Mat (OpenCV) using C++, but the output of the Mat is wrong

thank you.

2019-12-30 06:14:21 -0600 marked best answer Convert a 2D array to Mat (OpenCV) using C++, but the output of the Mat is wrong

I am trying to convert a simple 2D array to Mat in C++, but when I output Mat it shows that it is filling the matrix by skipping an element.

int size = 3;
static unsigned int x [3][3];
for (int i = 0; i <size;i++){
        for(int j = 0; j <size; j++){
            x[i][j] = 255*3;
            std::cout << x[i][j]<<' ' << 'x'<<std::endl;
        }
}
cv::Mat A(size,size, CV_16U,x);
std::cout<< A<<' '<<std::endl;

Output:

765 x 765 x 765 x 765 x 765 x 765 x 765 x 765 x 765 x

[765, 0, 765; 0, 765, 0; 765, 0, 765]

Another example I tried:

int x[6] = {2,4,8,9,6,5};
cv::Mat A (2,3, CV_16U,x);
std::cout<< A<<' '<<std::endl;

Output:

[2, 0, 4; 0, 8, 0]

Can anyone please tell me what I am doing wrong, thanks.

2019-12-30 06:14:21 -0600 received badge  Scholar (source)
2019-12-30 06:02:03 -0600 asked a question Convert a 2D array to Mat (OpenCV) using C++, but the output of the Mat is wrong

Convert a 2D array to Mat (OpenCV) using C++, but the output of the Mat is wrong I am trying to convert a simple 2D arra

2019-12-09 06:25:16 -0600 received badge  Enthusiast
2019-12-08 05:56:37 -0600 commented answer Cube Eye camera (3D depth camera) and Opencv

Thanks, I will try it.

2019-12-08 04:19:56 -0600 commented question Cube Eye camera (3D depth camera) and Opencv

I just edited the code from the SDK in the question.

2019-12-08 04:09:35 -0600 received badge  Editor (source)
2019-12-08 04:09:35 -0600 edited question Cube Eye camera (3D depth camera) and Opencv

Cube Eye camera (3D depth camera) and Opencv Hi, I am try to create a small project, that needs hand gestures recogniti

2019-12-07 20:27:20 -0600 asked a question Cube Eye camera (3D depth camera) and Opencv

Cube Eye camera (3D depth camera) and Opencv Hi, I am try to create a small project, that needs hand gestures recogniti

2019-11-16 11:28:49 -0600 commented question Accessing a USB connected camera

If the camera I am using have a C++ libs/dll, how can that help to connect the camera to OpenCV