Ask Your Question

atp's profile - activity

2018-11-19 15:28:12 -0600 edited question Conversion between multichannel and multidimensional matrices

Conversion between multichannel and multidimensional matrices Is there a direct way to convert from a multichannel matri

2018-11-19 15:25:25 -0600 commented question Conversion between multichannel and multidimensional matrices

thanks, I removed the zeros part.

2018-11-19 15:25:03 -0600 edited question Conversion between multichannel and multidimensional matrices

Conversion between multichannel and multidimensional matrices Is there a direct way to convert from a multichannel matri

2018-11-19 15:19:01 -0600 commented question Conversion between multichannel and multidimensional matrices

Thanks, fixed.

2018-11-19 15:18:34 -0600 edited question Conversion between multichannel and multidimensional matrices

Conversion between multichannel and multidimensional matrices Is there a direct way to convert from a multichannel matri

2018-11-19 15:01:29 -0600 asked a question Conversion between multichannel and multidimensional matrices

Conversion between multichannel and multidimensional matrices Is there a direct way to convert from a multichannel matri

2017-01-16 11:17:16 -0600 commented answer Transpose CV_8UC Image

It won't be a as fast as the transpose that exists within opencv? Why?

2017-01-15 21:32:26 -0600 asked a question Transpose CV_8UC Image

How do I transpose an image that does has a number of channels that is not covered by the standard transpose function in OpenCV?

2016-12-28 05:03:37 -0600 received badge  Editor (source)
2016-12-28 05:03:03 -0600 asked a question Access channels of CV_8UC Image

I want to convert a float matrix to an unsigned char matrix with the same number of channels.

cv::Mat imgA(3, 3, CV_32FC(5));
// image is filled with something
cv::Mat imgB;
imgA.convertTo(imgB, CV_8UC(imgA.channels()));

How can the additional channels of a CV_8UC image be accessed? The following gives a segmentation fault.

std::cout << (int) imgB.at<uchar>(0,0,1) << "\n";
2016-12-28 04:55:00 -0600 received badge  Scholar (source)
2016-12-16 12:30:02 -0600 received badge  Supporter (source)
2016-12-16 12:29:10 -0600 commented answer Copy Multidimensional Matrix

Interesting. I was not aware of CV_32FC(k) to create a matrix with k channels. I created a multidimensional matrix using:

int sizes[3] = {100, 100, 5};
cv::Mat img(3, sizes, CV_32F);

Would your code work in this case as well?

2016-12-16 10:21:51 -0600 asked a question Copy Multidimensional Matrix

Let's say I have a nxnx3 matrix and I want to copy that matrix into a nxnx5 matrix (and fill the remaining channels with other stuff). How can this be done in OpenCV? I'm looking for a solution that is not using a for loop.